Attempting to run XMing, the remote host is Ubuntu, going through Putty. Have spent hours carefully double-checking all settings, reviewing XMing's troubleshooting guide, etc. Rather than continuing this path, I want to use a tracing tool or sshd
logging to somehow identify exactly why I'm getting the "can't open display" error. This occurs when I test by runningxclock
or firefox.
I've turned off firewalls on each computer.
One thing that bothers me: in Putty I'm setting the X display location to localhost:0
, which they say sets the DISPLAY
variable on the remote host. But after logging in through Putty, I do an echo $DISPLAY
and it shows nothing. Shouldn't it return localhost:0
?
What tools or logs or other approach could I use to figure out what's wrong?
I had to put in
/etc/ssh/sshd_config
the following:Otherwise the display variable wouldn't get set. Now it works for me.
Try to set the display location to
localhost:0.0
instead oflocalhost:0
.If this wont work, at
/etc/ssh/sshd_config
check for LogLevel variable to be set toLogLevel INFO
.Now you could retry your connection and do the following for more log information:
sudo cat /var/log/* | grep DISPLAY
orsudo cat /var/log/* | grep ssh
orsudo cat /var/log/* | grep sshd
etc.If you set
localhost:0
as "X display location" option in Putty, you should also check that Xming is running on display:0
. Xming and Putty display option must have the same value.Once connected on the Ubuntu, you should run
export DISPLAY=10.0.0.1:0
, assuming that your client has the address10.0.0.1
and Xming is running on display:0
.Also, if that does not solve the problem, you can try to launch Xming with the option
-ac
. To do so on Windows, either launch it from command line, or by making a shortcut in which you append "-ac" in its "target" property. Be careful though, this will allow anyone to use your X server, so do this on trusted networks only. Theexport DISPLAY
command should also be ran on the Ubuntu.If the option
-ac
solves the problem, I must say I don't know how to configure Xming or whatever that prevents you to have the same result without-ac
.I'm using ArchLinux as my server and I didn't have xauth installed. I did
pacman -S xorg-xauth
to have xauth installed and then it worker.