6

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?

migrated from serverfault.com May 26 '14 at 16:46

This question came from our site for system and network administrators.

4

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
0

The only method that I'm aware of where you can resume a GUI application in this manner is to launch the application on the remote server's desktop and then use an application such as VNC to remotely connect to the remote system's desktop. You can then break this connection and resume it as needed.

I'm unaware of any method where you can resume a GUI application, where the application is remotely displayed to your local desktop.

For console applications you can use console managers such as screen or tmux to resume these connections, or have them persist when the SSH connection used to initiate them is broken, and then re-established later on.

0

You can't. "ssh -X" uses ssh channel to forward X11 protocol. If you terminate the ssh connection application can't connect to server anymore.

That you can do with ssh and X11, is that if your network is local and secure, is to launch X server on your machine in tcp listening mode (there is and option in many display managers, either in gui or in text configs you should remove -nolisten tcp). After than if you do:

mydesktop$ xhost +myserver
mydesktop$ ssh myserver
myserver$ export DISPLAY=mydesktop:0
myserver$ xterm & disown
ctrl-C
mydesktop$

Your xterm will continue to work, started by ssh but xterm will be connected over TCP without ssh.

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.