running x server on minimal distribution
Normally with ssh and X11 forwarding I do not need to set the DISPLAY variable or anything, it just happens automagically.
On the linode, when I try and launch xterm, I get
/usr/X11R6/bin/xterm Xt error: Can't open display:
Not sure how to proceed from here. Does some X daemon need to be started up? I wouldn't know how to go about setting a DISPLAY var because the X client I am using is behind a NAT'd firewall. As I say, normally with X forwarding this is not a problem and I don't have to set
the DISPLAY variable, so I suspect it's a configuration problem.
At first I though X needed to be running on the server, but now am not so sure. On one of my boxes here on the LAN, I can launch X apps from the server even if I take the server down to runlevel 3 and X is not running on the server end as revealed by a ps aux|grep X.
I have read elsewhere that X does not need to be running to server X apps. Is this correct?
Any ideas for me?
Thanks,
JDH
5 Replies
You might be interested in your sshd_conf file – look for "X11Forwarding no". That might have something to do with accessing not from a login shell.
Try that….
-Chris
(none):~# grep X /etc/ssh/sshd_config
X11Forwarding yes
X11DisplayOffset 10
(none):~# grep X /etc/ssh/ssh_config
ForwardX11 yes
The X11DisplayOffset 10 rang a bell, so I set
setenv DISPLAY localhost:10.0
but got the same error. On another remote linux box I have ssh access to, this is the value of DISPLAY and X11 forwarding is working so I think it's right. Unfortunately, I can't set the DISPLAY to my actual IP because I am behind a NAT'd firewall here. I've also disabled host control on the client with xhost +.
This link
Thanks,
JDH
I'm probably way off here, but lots of things complain without hostname being set.
-Chris
ssh -X -v [username]@[hostname]
(Not sure if there is an equivalent on windows SSH clients?)
Also, when connected, does DISPLAY actually get set to anything:
echo $DISPLAY
(I can't try it at the moment but if I remeber correctly sshd normally sets this to the forwarded display on connection)
Last thing (the long shot) are you overriding the DISPLAY variable by setting it to anything manually in .bashrc/.profile/.bash_profile/whatever (that's the sort of thing I do and forget I did it
When I did ssh -X -v user@ip I saw the message
debug1: Remote: No xauth program; cannot forward with spoofing.'
so the problem was that xauth wasn't in the minimal distribution. This was an easy fix
apt-get install xbase-clients
After that, the DISPLAY var was automatically and correctly set by ssh to 'localhost:10.0', but then I got a new error when I tried to launch an X app
_X11TransSocketINETConnect: Can't get address for localhost
/usr/X11R6/bin/xterm Xt error: Can't open display: localhost:10.0
This rang a bell with caker's suggestion to make sure the host info was right, and I checked /etc/hosts and it was empty. Adding
127.0.0.1 localhost.localdomain localhost
to that file fixed my problems.
Perhaps the minimal debian distribution should have localhost in /etc/hosts by default?
Thanks all,
John Hunter