2

I'm trying to configure an Xming display on my WSL2, and after an amount of troubleshooting attempts, I'm quite clueless.

For details:

System: WSL2 on Windows10Pro
Xming: installed. Some hopefully relevant lines from log:

  • Xming :0 -multiwindow -clipboard
  • XdmcpRegisterConnection: newAddress 172.27.16.1
  • Could not init font path element C:\Program Files (x86)\Xming/fonts/100dpi/, removing from list! (there are a few of these)
  • winInitMultiWindowWM - DISPLAY=127.0.0.1:0.0
  • winInitMultiWindowWM - XOpenDisplay () returned and successfully opened the display.
  • winMultiWindowXMsgProc - XOpenDisplay () returned and successfully opened the display.
  • winClipboardProc - XOpenDisplay () returned and successfully opened the display.

Firewall:
enter image description here

What I've tried: (on WSL2 terminal)

export DISPLAY=$(awk '/nameserver / {print $2; exit}' /etc/resolv.conf 2>/dev/null):0
export LIBGL_ALWAYS_INDIRECT=1

As shown here

export DISPLAY=$(grep -m 1 nameserver /etc/resolv.conf | awk '{print $2}'):0.0

As shown ni subsequent link here
export DISPLAY=172.27.16.1 (/:0/:0.0) as taken from the Xming log.

Results so far: in all cases I get

No protocol specified
Error: Can't open display: 172.27.16.1:0

or alike

Any advice?

Ori5678
  • 499
  • 2
  • 5
  • 15

5 Answers5

12

Finally, a friend found a solution that worked for me. In short:

  • use putty to open a WSL terminal and export DISPLAY variable as WORKSTATION_IP:0.0
  • in Xlaunch, check the "No Access Control" box.

I've put this as instructions in layman's terms in this short doc

Ori5678
  • 499
  • 2
  • 5
  • 15
  • Excellent. Reading the short doc instructions, it worked for me too. – Maverick Oct 02 '20 at 18:14
  • After reading dozens of other solutions this is the only thing that worked for me, though I did have to run *sudo ssh-keygen -A* prior to step 1.2 since I had no hostkeys available. Thank you! – Patrick Miles Mar 08 '21 at 19:16
  • Checking checkbox "No Access Control" helped me. Thank you! – Jeidoz May 07 '22 at 22:13
8

I had success using

export DISPLAY=$(grep -m 1 nameserver /etc/resolv.conf | awk '{print $2}'):0.0

with Xming allowed through the Windows firewall for both private and public networks as you did (note for other users there are a couple of entries in the firewall settings for Xming). I then launched Xming using "Xlaunch" (Start > Xming > Xlaunch), selected Multiple Windows and then checked "No Access Control" on the "Specify Parameter Settings" screen. This last step appears to be the key one I was missing. Launching Xming.exe with the -ac option should achieve the same effect.

3

Add the IP address in the X0.hosts file (find it in the Xming installation directory). This file defines which hosts it will allow connections from. Other option is to use the -ac option, however this will disable all access control restrictions...

King Sumo
  • 131
  • 1
  • 3
0

U can use VcxSrv xLaunch use this settings enter image description here

0

In my my case, I had to add XLaunch.exe to the Windows Firewall exceptions. I had Xming.exe added to the firewall when I installed it but not Xlaunch.exe.

To test quickly, just turn-off windows firewall then try running any linux gui app. Of course, you gotta do the export Display command first.

j.e.
  • 69
  • 3