Quantcast
Channel: Active questions tagged windows-subsystem-for-linux - Ask Ubuntu
Viewing all articles
Browse latest Browse all 2810

WSL2 seems to change network configuration or DISPLAY variable on start-up. Where can I see what happens?

$
0
0

I'm using WSL2 with Ubuntu 20.04, and I have a problem trying to run Qt apps, currently discussed in this question. The gist of it is that Qt calls a plugin, xcb, that tries to connect to a display. When I launch WSL2 from Windows GUI, this display changes.

From what I understand, WSL2 changes network parameters on startup, and I would like to know precisely what happens. Is there a config file I can find?

Specifically, this is what happens:

  • From Windows cmd, I run wsl ~ -e bash --norc --noprofile
  • Ubuntu Bash opens in CMD window, I run $ xeyes. Xeyes opens, works well
  • I start Ubuntu in a new window from a shortcut on my Desktop, to have the session on which I usuallly work
  • $ xeyes returns Error: Can't open display: :0
  • From Windows cmd, I close WSL2 with wsl.exe --shutdown
  • From Windows cmd again, I restart WSL2: wsl ~ -e bash --norc --noprofile
  • Ubuntu Bash opens in CMD window, I run $ xeyes
  • $ xeyes returns Error: Can't open display: :0

My conclusion from this is that a value was changed somewhere when I started WSL2 from the GUI. For instance, the DISPLAY variable, but if I print it before and after starting WSL2, it always prints $DISPLAY: :0.


Viewing all articles
Browse latest Browse all 2810

Trending Articles