I am following the guideline in multiple-desktops-on-one-linux-pc to start another X session. If I switch to VT-3, I can successfully start a new X session using
startx gnome-session -- :1
or
startx -display :1 -- :1 vt3 &
However, when I switch back to my original X session running on VT-7 by pressing
Ctrl+Alt+F7, I find that the X server has crashed and it keeps crashing every time I go back to the second X-server.
However, if I switch to VT-3 and back to VT-7 without starting a second x session, my original x server does not crash.
And if I switch from my second xserver on tty3 to another tty like tty2 then back to my original x-server on Ctrl-Alt-F7, the xserver does not crash. The crash only happens if I switch from VT-3 to VT-7 after starting a second X session in VT-3.
Looking at Xorg.0.log I found these error messages
[ 22162.112] (II) event2 - Power Button: device removed
[ 22162.136] (II) event4 - Video Bus: device removed
[ 22162.161] (II) event1 - Sleep Button: device removed
[ 22162.193] (II) event14 - Integrated Camera: Integrated C: device removed
[ 22162.233] (II) event3 - AT Translated Set 2 keyboard: device removed
[ 22162.249] (II) event5 - SynPS/2 Synaptics TouchPad: device removed
[ 22162.281] (II) event6 - ThinkPad Extra Buttons: device removed
[ 22162.313] (II) event15 - py-evdev-uinput: device removed
[ 22162.329] (II) event15 - py-evdev-uinput: device removed
[ 22162.361] (II) AIGLX: Suspending AIGLX clients for VT switch
[ 22175.090] (II) AIGLX: Resuming AIGLX clients after VT switch
[ 22175.091] (EE) modeset(0): drmSetMaster failed: Invalid argument
[ 22175.091] (EE) modeset(0): failed to set mode: Permission denied
[ 22175.091] (EE)
Fatal server error:
[ 22175.091] (EE) EnterVT failed for screen 0
[ 22175.091] (EE)
[ 22175.091] (EE)
Please consult the The X.Org Foundation support
at http://wiki.x.org
for help.
[ 22175.091] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[ 22175.091] (EE)
[ 22175.091] (II) AIGLX: Suspending AIGLX clients for VT switch
[ 22175.134] (EE) Server terminated with error (1). Closing log file.
I am unsure what the reason for the crash is or how to fix it. Looking up this error message, most people seem to talk about graphic or nvidia drivers, but I did not change the drivers since installing my distro and I don't have an nvidia graphic cards. A similar issue was posted in question: Switching to a second X session kills the first, but I don't think I have the driver problem as grep "nouveau" /var/log/syslog returns nothing.
Any help is much appreciated.