You are mis-remembering how Xorg used to work :). Remember that X used to start on VT7 and up, because VT1 through VT6 were reserved for text consoles.
With systemd and logind, by default the VTs are set up on-demand. If you never switched to VT2, then getty
and login
are not started on VT2. Instead, VT2 remains available... and can be claimed by a program like Xorg, which uses the first free VT.
Another way to see that your Xorg session is actually on VT2, is that ps -ax
will show that it has tty2
as its controlling terminal.
In the old system, if you logged in to a text VT and started Xorg, it would never re-use your current text VT. I was confused because startx
re-uses your text VT on a modern system - but this is due to using logind. With logind, X is able to start as an unprivileged process... and it does not have the privilege to switch to a different VT. The -keeptty
option mentioned in the log message was added specifically for this reason.
I suggest not trying to run Xorg -keeptty
inside sudo -i
. -keeptty
was not specifically intended for this case. Or at least, it does not work correctly on my system, it seems the old and the new code start fighting with each other :) -
I get a screen showing a text cursor (underline) which is not flashing, and "ctrl+alt+f6" does not switch to text vt6; I have to use alt+sysrq+R first. (I have enabled sysrq on my Fedora system). Switching back to the original vt with "ctrl+alt+f5" then shows the black screen that I would have expected. The controlling terminal of the X process is tty5
, but lsof -p
shows that it also has tty2
open. Switching to VT2 dumps me back on VT5, with Xorg logging an error
[ 40399.826] (II) AIGLX: Suspending AIGLX clients for VT switch
[ 40399.826] (II) AIGLX: Resuming AIGLX clients after VT switch
[ 40399.826] (EE) modeset(0): failed to set mode: Permission denied
[ 40399.826] (EE)
Fatal server error:
[ 40399.827] (EE) EnterVT failed for screen 0
[ 40399.827] (EE)
[ 40399.827] (EE)
Please consult the Fedora Project support
at http://wiki.x.org
for help.
[ 40399.827] (EE) Please also check the log file at "/var/log/Xorg.10.log" for additional information.
[ 40399.827] (EE)
[ 40399.828] (II) AIGLX: Suspending AIGLX clients for VT switch
[ 40400.029] (EE) Server terminated with error (1). Closing log file.