Dropped ssh/X session, how to pickup where left off?

9

2

I am VPN from a Linux box to another. I log in to the other box with ssh -X. I open an X window/program in an attempt to do a software installation. The painful truth is that this software cannot be installed from the shell. Anyway, all is well but slow. However, the VPN session will periodically drop and the installation is frozen.

Does anyone have any suggestions for how after I re-login to VPN could I restore that ssh/X session? Or, is that impossible?

ssh -X user@192.168.0.1
./setup.sh &
[1] 1084

Continue work by X application. VPN drops.

Charlie Wilson

Posted 2011-10-18T17:35:06.673

Reputation: 501

Answers

5

You cannot reconnect to a session you already lost. You can only kill its processes.

But if you are preparing for future, you can use tmux or screen for terminal-based programs and xpra (this fork) for X11 ones.

tmux
tmux ls
tmux attach

xpra start :100 --start=xterm
xpra attach :100

user1686

Posted 2011-10-18T17:35:06.673

Reputation: 283 655

If it's not finished immediately, never run it outside screen. Should be in the motd on all systems. – Daniel Beck – 2011-10-18T17:54:49.757

Because all users read the motd, yes. – user1686 – 2011-10-18T18:12:42.573

Probably not, but seeing it upon every login might still have an effect -- at least for command-line access. I see the MOTDs of several systems every day. – Daniel Beck – 2011-10-18T18:16:05.020

0

You could also use nomachine NX or Freenx if ist available for your distro. Its also much faster than ssh +X forwarding. Another option is teamviewer or vnc.

Tim Haegele

Posted 2011-10-18T17:35:06.673

Reputation: 247