Can’t Run startx from Inside Screen Session

gnu-screenstartxx11

I'm running Slackware GNU/Linux 14.2, which doesn't start an X server by default. On a whim, I tried running startx inside a screen session and got the warning

/usr/libexec/Xorg.wrap: Only console users are allowed to run the X server
xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error
Couldn't get a file descriptor referring to the console

Why can't I run startx from inside a screen session? What resource can you access on a "raw" console that you can't on a shell running under screen?

Best Answer

Running startx only makes sense if you are in front of the computer. Testing for console ownership is one way to determine this. As you have found out, it can be fooled by operating in a screen session. In that case, no X for you.

Related Question