You are not logged in.

#1 2008-01-08 09:30:32

john_schaf
Member
From: France
Registered: 2007-02-24
Posts: 104

ssh X forwarding and screen

Hello everybody,

I'm using screen on a distant server, but when I disconnect and come back later, type "screen -r", everything comes back but the X forwarding of the ssh connection has been lost. Is there a way to reconnect it ?

Offline

#2 2008-01-08 11:18:23

dr_te_z
Member
From: Zoetermeer, the Netherlands
Registered: 2006-12-06
Posts: 154

Re: ssh X forwarding and screen

Use screen on your local destop, then build the connection to the remote server. When you disconnect your local screen, the connection should be maintained. This only works if you local machine runs linux or bsd which is capable of running screen.


Somewhere between "too small" and "too large" lies the size that is just right.
- Scott Hayes

Offline

#3 2008-01-08 13:58:17

john_schaf
Member
From: France
Registered: 2007-02-24
Posts: 104

Re: ssh X forwarding and screen

thank you for your answers.
This works but then I have to keep my local screen running, and so I cannot turn off my computer ...
any other idea ?

Offline

#4 2008-01-08 21:14:29

dr_te_z
Member
From: Zoetermeer, the Netherlands
Registered: 2006-12-06
Posts: 154

Re: ssh X forwarding and screen

No. when you want to sustain a connections between 2 computers, you cannot power 1 of them off... with or without gnu-screen.


Somewhere between "too small" and "too large" lies the size that is just right.
- Scott Hayes

Offline

#5 2008-01-08 21:33:30

gothmog.todi
Member
From: Austria
Registered: 2007-07-18
Posts: 120

Re: ssh X forwarding and screen

Maybe xmove works in this situation.
Take a look here: http://wiki.archlinux.org/index.php/All … ter_logoff

Another way would be using vnc... I think with tightvnc it is possible to not connect to a whole desktop but to a single application.

Offline

#6 2008-01-09 14:29:49

john_schaf
Member
From: France
Registered: 2007-02-24
Posts: 104

Re: ssh X forwarding and screen

dr_te_z wrote:

No. when you want to sustain a connections between 2 computers, you cannot power 1 of them off... with or without gnu-screen.

I don't want to sustain the connection, I just want to reconnect when I come back smile

xmove may do the trick, I'll try that, thanks.

Offline

#7 2009-01-03 04:00:30

print
Member
Registered: 2007-02-27
Posts: 174

Re: ssh X forwarding and screen

xmove seems overkill to me.  According to Skerit at ubuntu forums (http://ubuntuforums.org/archive/index.php/t-252258.html)

[X] uses ["localhost:10"] to forward applications over SSH by default.

Additionally, I found some other code that detects whether GNU/screen is active here (http://www.jukie.net/~bart/conf/zsh.d/S51_screen).

In relevant part:

# WINDOW is set when we are in a screen session
if [ -n "$WINDOW" ] ; then 
. . .

Adding those together on the remote machine (where I'm running GNU/Screen) I get this, which just works:

if [ -n $WINDOW ] ; then # we're in screen
  export DISPLAY=localhost:10
fi

% whereis whatis whence which whoami whois who

Offline

#8 2009-09-28 20:07:10

b100dian
Member
Registered: 2007-06-09
Posts: 19

Re: ssh X forwarding and screen

Wow. Just reading this.

You mean you're connecting through SSH + X forwarding and launching the applications you would want to be persistent with "screen"? and they automagically connect to the xmove server?

I think I would find this useful too, but how do you start xmove, from an /etc/rc.d or .xsession stuff? how do you prevent more from running (one from the local computer and one from the remote x session)?

Thanks.

Offline

#9 2009-09-28 20:42:51

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,600
Website

Re: ssh X forwarding and screen

tightvnc rocks in this regard.  You can start a tightvnc server on your remote PC and depending on your connect speed, interact with it in near real-time (non-graphically intense applications).  See the wiki page for more:

http://wiki.archlinux.org/index.php/Tightvnc


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#10 2009-09-28 21:38:26

b100dian
Member
Registered: 2007-06-09
Posts: 19

Re: ssh X forwarding and screen

Thanks graysky I know of this option. But I love having just the XFCE panel on top of my Windows machine from work;)

Offline

#11 2009-10-01 12:56:35

japetto
Member
From: Chicago, IL US
Registered: 2006-07-02
Posts: 183

Re: ssh X forwarding and screen

How about you just install Arch and XFCE on your work computer?  wink

Offline

Board footer

Powered by FluxBB