XMing "can't open display" error

83,745

Solution 1

Try to set the display location to localhost:0.0 instead of localhost:0.

enter image description here

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.

Share:
83,745

Related videos on Youtube

David
Author by

David

Updated on September 18, 2022

Comments

  • David
    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 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?

  • AlexD
    AlexD almost 3 years
    And where would in Xming, such setup be hiding ? Tks.