I have an application that's gui only that constantly needs to run. The problem is that I can't install a full desktop just for this application (my OS is debian and ubuntu cli).

So I was wondering if there is a way to run this application on the server in something like screen or tmux? So that I can just forward X and continue working with it.

  • Yes you can do this. Where are you stuck? It will stop working if it loses contact with the Xserver it is forwarding to, is that suitable? – Paul May 27 '12 at 22:08
  • That's my problem actually, I don't want it to stop when I close my local x session. I want it to keep running so I can just 'resume' it later. The app needs to continue running – Lucas Kauffman May 27 '12 at 22:11
  • You can't forward then, you'd need to run a local xserver and use something like x11vnc to access it via vnc (over ssh for security). You don't need a whole desktop, just x11. – Paul May 27 '12 at 22:13

There are two aspects to this - the first is having the gui process owned by a process that does not terminate. There are any number of ways to achieve this, but having tmux own the process is "good enough" if it is how you currently work.

The second is having the gui output somewhere. If you want the gui output to both go to the screen of the server the process is running on, and also be able to access it remotely, then x11vnc is a good option and is present in most distributions. All you need is an X11 session, so not a full desktop, just enough of X to display the gui, and x11vnc.

This exposes the X session it is run under as a VNC session, so it can be accessed remotely. Ideally you would do this over ssh, as vnc does not provide much in the way of security.


Look into Xpra, which allows to remote X applications and interrupt the connection. It's very much like "tmux for X".



A GUI program, using X Windows, requires to be connected to server (your graphics head). If you disconnect from screen/tmux (keeping the session), the connection to the server may still be disconnected (for example, if you shutdown/sleep/hibernate your local computer. As long as the connection remains to the $DISPLAY server, your app will continue. If you are using SSH and X forwarding, then when the SSH session ends, the connection will end too.

So yes, you can run the application indefinitely from a cli, but it depends on the connection between the server and client remaining up.

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.