title: Configure Xming display on WSL2
body: <p>I'm trying to configure an Xming display on my WSL2, and after an amount of troubleshooting attempts, I'm quite clueless.</p>
  <p>For details:</p>
  <p><strong>System:</strong>  WSL2 on Windows10Pro<br />
  <strong>Xming:</strong> installed. Some hopefully relevant lines from log:</p>
  <ul>
  <li>Xming :0 -multiwindow -clipboard</li>
  <li>XdmcpRegisterConnection: newAddress 172.27.16.1</li>
  <li>Could not init font path element C:\Program Files (x86)\Xming/fonts/100dpi/, removing from list! (there are a few of these)</li>
  <li>winInitMultiWindowWM - DISPLAY=127.0.0.1:0.0</li>
  <li>winInitMultiWindowWM - XOpenDisplay () returned and successfully opened the display.</li>
  <li>winMultiWindowXMsgProc - XOpenDisplay () returned and successfully opened the display.</li>
  <li>winClipboardProc - XOpenDisplay () returned and successfully opened the display.</li>
  </ul>
  <p><strong>Firewall:</strong><br />
  <a href="https://i.stack.imgur.com/IHbX3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IHbX3.png" alt="enter image description here" /></a></p>
  <p><strong>What I've tried: (on WSL2 terminal)</strong></p>
  <pre><code>export DISPLAY=$(awk '/nameserver / {print $2; exit}' /etc/resolv.conf 2&gt;/dev/null):0
  export LIBGL_ALWAYS_INDIRECT=1
  </code></pre>
  <p>As shown <a href="https://stackoverflow.com/questions/61110603/how-to-set-up-working-x11-forwarding-on-wsl2">here</a></p>
  <pre><code>export DISPLAY=$(grep -m 1 nameserver /etc/resolv.conf | awk '{print $2}'):0.0
  </code></pre>
  <p>As shown ni subsequent link <a href="https://github.com/cascadium/wsl-windows-toolbar-launcher#firewall-rules" rel="nofollow noreferrer">here</a><br />
  <code>export DISPLAY=172.27.16.1 (/:0/:0.0)</code>
  as taken from the Xming log.</p>
  <p><strong>Results so far:</strong> in all cases I get</p>
  <pre><code>No protocol specified
  Error: Can't open display: 172.27.16.1:0
  </code></pre>
  <p>or alike</p>
  <p>Any advice?</p>