Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So my workstation at work got rebooted and I'm currently not logged in physically there with a graphical session. I have ssh access to it, and I can start a new X windows session and use my graphical applications remotely. I was just wondering if there was a way to start the main desktop session remotely, so that I can then connect and interact with it and next time I get in front of the workstation, I can just pick up where I left off...

share|improve this question
up vote 2 down vote accepted

You can start a console GUI session remotely: run startx. However, that's likely not to work because you'll lack the permission. On most setups, only the user physically logged in on the console is allowed to use the console.

Different distributions have adopted different mechanisms to control who can start an X session on the console. I believe that on RHEL this is done through systemd, but I don't know how.

If you start an X application on the console display, you won't be able to interact with it remotely. There are a few exceptions such as Emacs that are capable of connecting to multiple displays, but in general X applications open a connection to the X display when they start and never look back. You can use Xmove or Xpra to mediate between the X server and the application; an X application started inside Xmove or Xpra can be moved to a different X server (like detaching and attaching a screen session).

Another option once you've started the console X session would be to interact with it remotely. You can use X11vnc for that, and access the remote session with a VNC client.

share|improve this answer
Well that's more what I had in mind. If I can run startx then I can connect to the main X server (:0) and interact with my main desktop. I will try and let you know what happens. – FrenchKheldar Oct 26 '12 at 22:00

I'd suggest a look at the following projects (although I kind of doubt that xpra can handle a whole session)

  • the x2go terminal server project seems pretty well for this task (see this Linux Magazine article); however it could be a little over-the-top for a smallish setup.

  • xpra:

    Xpra is 'screen for X': it allows you to run X programs, usually on a remote host, direct their display to your local machine, and then to disconnect from these programs and reconnect from the same or another machine, without losing any state. It gives you remote access to individual applications.

And have a look around, some other tools have also been mentioned here already (e.g. here).

(Something more direct might be possible (see this note of "startx over ssh"), but it the "picking up where I left part" will not work.)

Edit Something just crossed my mind -- if you use some desktop manager that supports auto-login (say, slim, nodm, gdm3, kdm); you should be able to start a session for one specific user on :0 (via, say, /etc/init.d/gdm3 start).

And there is XDMCP (with security concerns).

share|improve this answer
Thanks these are interesting. But I guess there is no way to perform a remote login that accomplish the same thing as a physical login (ie start display:0). – FrenchKheldar Oct 25 '12 at 16:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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