XMing "can't open display" error

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.


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.


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.