Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'X Login via XDMCP over an SSH tunnel' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
X Login via XDMCP over an SSH tunnel
Authored by: joshewah on Nov 19, '04 01:27:45PM
You can also run specific apps as needed like xterm or firefox etcl. that reside on the host machine instead of running the entire X session by using those commands instead of Xnest.

One snag I have run into is if you echo $DISPLAY from Terminal.app it returns nothing even if you set $DISPLAY to :0.0 like it should be. You will get something like "xterm Xt error: Can't open display: " from the remote machine. You can get around this one of two ways.

1. Add `DISPLAY=:0.0` before the ssh command. Example: DISPLAY=:0.0 ssh somehost.com

2. Run ssh from within X11's xterm.

If somebody could fill me in on the difference between how Terminal.app and X11's xterm starts up environment wise that explains why this is happening that would be great :)

[ Reply to This | # ]
X Login via XDMCP over an SSH tunnel
Authored by: EddEdmondson on Nov 19, '04 07:07:11PM
Only children of X11.app will get the DISPLAY variable passed down to it. Terminal.app won't because it isn't a descendent of the X11.app.

Two solutions:
1) Use X11.app to open the terminal process - either using 'open -a Terminal' from an xterm or perhaps from the menu. Then it will correctly inherit the DISPLAY setting. Terminal.app must not be running already when you do this however.
2) Use a suitable script to determine the DISPLAY variable correctly.

Do not set DISPLAY to :0.0 manually or in a script. There is no guarantee that that is the correct value. It can be higher if there is already a lower-numbered X-server running on the machine. Example: start X11.app then fast-user-switch to another user and start X11.app there too. The second user will have DISPLAY of :1.0 instead.

[ Reply to This | # ]