[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Using remote apps on local X server



On Tue, Jul 04, 2006 at 11:35:53PM -0500, Damon L. Chesser wrote:
> Bob Smither wrote:
> >This must be a FAQ, but I could not stumble upon a solution.  With other
> >Linux boxen, I can ssh -X into them, then run X apps on the remote with
> >local display.  On a newly installed Sarge Debian box, doing this
> >results in the following error:
> >
> >  Gtk-WARNING **: cannot open display:
> >
> >Any suggestions as to why I can't run the remote app and see it locally?
> >
> >Thanks!
> >  
> 
> You will need to set the DISPLAY variable and export it.  I don't know 
> what you set it to, but I do know you will have to export DISPLAY 
> serverx: X,X    X here = display and serverx=name or ipaddress of the 
> desired server (such as 192.168.2.4:  0,0.  I have just exhausted my 
> knowledge of the matter as I don't play with exporting displays, but I 
> hope that helps, and at the  very least, get you on the right track.

This would be correct for traditional X sessions without ssh,
but I don't think you quite understand the mechanics of port forwarding
with ssh as specified by the original poster. The traditional method is
OK on local LANs, but on the Internet is insecure and usually foiled
by NAT and/or firewalls.

With port forwardign the ssh daemon creates a port on the remote host
and forwards all traffic to and from that port back via the client to
the local X display.

The DISPLAY environment variable should be created automatically, and
be configured to point to a unique display number on the remote host,
so the real IP address of the X server is not required.

For the original poster, I would suggest you check that DISPLAY has
been setup correctly, and use 'netstat -a' for the existance of the
associated port.

For example, I just executed
	ssh -X voyager2
and got a shell giving me
    digbyt@voyager2:/home/digbyt> echo $DISPLAY   
    voyager2:10.0

The display number '10' means that the port number will be 6010 (ie 
the port number 6000 + n), and netstat shows:
    tcp        0      0 *:6010                  *:*                     LISTEN

If things don't look right, and you are sure the port forwarding is
enabled in your config files, then check the sshd logs for indications
of what is going wrong.

If it looks ok, try running 'xdpyinfo' to check communication with the
server, just in case it is an application compatability issue.

Regards,
DigbyT
-- 
Digby R. S. Tarvin                                          digbyt(at)digbyt.com
http://www.digbyt.com



Reply to: