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?

  • Pardon? ssh is not involved. I am running Slackware on my laptop. – Gregory Nisbet Dec 5 '16 at 5:44
  • Which distribution? On Debian, there is a configuration option, to restrict starting X only from console user or only from root or all can do it. – Giacomo Catenazzi Dec 5 '16 at 14:55

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.


To understand this first we have to understand the difference between terminal, shell and console.

  • Terminal is a program that run a shell , in the past it was a physical device (Before terminals were monitors with keyboards, they were teletypes) and then its concept was transferred into software, like Gnome-Terminal.
  • Gnome-Terminal, a black windows appear that run Shell so we can run our commands.
  • Console is a special sort of terminal, it was also a Physical device . example in Linux we have virtual consoles which we can access them by combination of Ctrl + Alt + F1 to F7.

virtual consoles because in early times it was a physical device. but now it not a saparate dedicated device. so we call it virtual terminals..

Most terminals nowadays are strictly speaking terminal emulators. It is a type of role in the workings of a UNIX-like system and at the same time the basic interface offered by the systems.

In fact everything, including the GUI builds on top of it.[1]

Colloquially we can say "terminal" refer to end-points in a computer network with a star-topography.

then a question arises. As GUI are built up on console. then what to do if we want to do some command line operations. and the answer for that is terminal... which further emulates the console.. and let us enter our favorite command in it.

explanation of [1]

So Here we know that even GUI is built up on console.. and by entering the command startx you further again are requesting to open up and new XServer. So think by your own why should the GUI Terminal should let you to do that???[do you want to break your XServer??]. and if you really want to force that command.. just run startx command by administrative privileges. you will succeed but for sure you are going to break your XServer runtime.

and to answer you last question.. [What resource can you access on a "raw" console that you can't on a shell running under screen?]

In fact till now i don't saw any case where i cannot access the resource by the terminal running on Xserver. You must be able to access all the resources by the internal Xserver GUI terminal.. (because that too was designed to fullfill all the needs that ordinary console was giving!!!)..

But running a command which results the same as Cutting a branch of tree on while sitting exactly on that branch.. will definitely create error.

Everything makes sense in field of Computer Science.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.