Script doesn't work if it was run before WSL2 is launched
archiif opened this issue · comments
If I run the PowerShell script that adds the firewall rule before launching WSL2 for the first time in the current session, X11 applications would fail to communicate with VcXsrv. But if I run the script again after WSL2 is launched, X11 applications works as expected.
Is there a reason why this happens?
Finally got the time to test this.
Can't reproduce it. Was able to communicate with VcXsrv even though I added the rule before launching WSL2 with the following steps:
- Launch windows.
- Run
wsl-2_2-firewall-rule.bat
(this just runs the PS script which actually runswsl
to get the IPs) - Run
wsl-2_3-vcxsrv.bat
- Launch Ubuntu 20.04
- Run the following commands
export DISPLAY=$(ip route | awk '/^default/{print $3; exit}'):0.0
andexport LIBGL_ALWAYS_INDIRECT=1
- Run
xeyes
to see if I can display a GUI. - The xeyes window is launched and working.
Did you have VcXsrv running before adding the firewall rule? If so you have to restart VcXsrv.
Can you let me know the steps to reproduce the behaviour?
- Did you try the above steps (for xeyes you have to install a package
sudo apt install x11-apps
)? - Is it still not working?
- Can you let me know the steps to reproduce this?
Closing this for now as I got no update.
Please comment if it needs to be reopened.