Ssh – Linux ssh launching GUI application and leaving it running

sshx11

I have ssh access to my own server with Ubuntu 13.10 on it installed.

Via ssh I can launch GUI applications using this approach:

$ ssh -X my_login@address_of_sever

After that I can start any application by name, e.g.
gedit, firefox, google-chrome, and it will be opened on my client machine (just the window, actually application works on the remote machine – i.e. on server).

This is all fine.

But when I close the GUI application on the client machine it gets closed on the server too (it seems to be legit).

I can launch console applications using commands such as:

$ nohup php somefile.php &  

and it will continue working after closing the connection.

I wonder, is it possible to do the same with GUI application?

Ideally it would be if it were possible to move opened window to server and take it back to client when it's necessary to see what is happening there, some kind of switching perhaps?

Best Answer

Yes, you can do this with xpra. From their homepage:

"To start an application (a simple xterm in this example) on a remote system and display it your local machine, simply run:

xpra start ssh:SERVERHOSTNAME:100 --start-child=xterm

This is similar to ssh -X, except it is faster and you can disconnect and re-connect to the session as many times as you like. (obviously xpra must be installed on your server host) To re-connect or to connect to this session from another machine, use the attach command (you can also use the xpra_launcher GUI):

xpra attach ssh:serverhostname:100
Related Question