After installing ubuntu-desktop on my server I can start a program with gui that runs on my server and forward the Screen to my local pc. I therefore use:
someuser@localhost:~$ ssh -X someuser@somehost
someuser@somehost:~$ gedit
I can also run, detach and attach command line based programs e.g. via tmux or screen. But how do I combine both, in case I want to run a GUI based program for a longer period of time on the server?
In that case I would like to have the graphical output of my program first on my local screen, start some process, than detach the graphical output from my local screen, logout from the server, let the program run, login to the server again and finally attach the graphical output to my local screen again.
Is that possible?
Running GUI and text mode applications.
If you want to run several applications including a GUI application and a text mode application, I think you can do it like this,
on the console (the monitor connected to the server) you run
remotely you run
ssh -X
andssh
via separate terminal emulator windows in the client computer.
You cannot reconnect to a process with graphics (actively running graphics) like you describe in the question, but you can run a process in the background, and let it continue. You can test with the following command line. It will survive if you log out and and you will find it running when you log in again.
Check with
Security
Finally, if the server can be connected via the internet, or otherwise by several people via a LAN, please consider the security aspects with GUI connections raised by @Panther.
No, this is not really possible, as the way X11 functions does not permit disconnecting and reconnecting to the server, within a running app, in this way.
You can use something like RDP/VNC to run a full session on the server, where you can connect and disconnect to the RDP/VNC server from the client, leaving applications open and running on the remote server, which is actually more like how tmux/screen work than how ssh -X works.