XMing "can't open display" error
Solution 1
Try to set the display location to localhost:0.0
instead of localhost:0
.
If this wont work, at /etc/ssh/sshd_config
check for LogLevel variable to be set to LogLevel INFO
.
Now you could retry your connection and do the following for more log information:
sudo cat /var/log/* | grep DISPLAY
or
sudo cat /var/log/* | grep ssh
or
sudo cat /var/log/* | grep sshd
etc.
Solution 2
I had to put in /etc/ssh/sshd_config
the following:
X11UseLocalhost no
Otherwise the display variable wouldn't get set. Now it works for me.
Solution 3
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 address 10.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. The export 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
.
Related videos on Youtube
David
Updated on September 18, 2022Comments
-
David almost 2 years
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 theDISPLAY
variable on the remote host. But after logging in through Putty, I do anecho $DISPLAY
and it shows nothing. Shouldn't it returnlocalhost:0
?What tools or logs or other approach could I use to figure out what's wrong?
-
AlexD almost 3 yearsAnd where would in Xming, such setup be hiding ? Tks.