ssh X11 forwarding issue

Posted by bbuser on Super User See other posts from Super User or by bbuser
Published on 2009-11-13T12:55:29Z Indexed on 2010/05/03 3:49 UTC
Read the original article Hit count: 526

Filed under:
|
|
|
|

I have put ForwardX11 in my ~/.ssh/config and then I start a X11 application like this:

ssh -f user@host 'someapp; sleep 1'

This works fine.

The application someapp has a button which opens a viewer application via a shell script viewer.sh. When I press the button the viewer comes up.

This is all good and as expected, but if I do

ssh -2 -f user@host 'someapp; sleep 1'

there's trouble. someapp starts very well, but if I click the button the viewer doesn't show up.

As the viewer is called via a shell script, I replaced the call with xclock and the situation was exactly the same - I think the viewer is not to blame. The situation is the same on Linux and AIX.

The reason I need -2 is that I finally want to use connection multiplexing and this does only work with version 2. The reason for the sleep 1 is that it didn't work otherwise;-)

To add more confusion, with

ssh -2 -f user@host 'xterm &; app; sleep 1'

the viewer works as long as the xterm is open. When I close xterm ssh -v outputs the following

debug1: channel 1: FORCE input drain
debug1: channel 0: free: client-session, nchannels 3
debug1: channel 1: free: x11, nchannels 2

and from that moment the viewer doesn't show when I press the button.

I also replaced the viewer application with a script that writes the $DISPLAY variable to a file. The variable is always set correctly.

© Super User or respective owner

Related posts about x-windows

Related posts about x11