hubisan / emacs-wsl

Install and run Emacs with the Windows Subsystem for Linux (WSL 2) in Windows 10 or 11.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:

  1. Launch windows.
  2. Run wsl-2_2-firewall-rule.bat (this just runs the PS script which actually runs wsl to get the IPs)
  3. Run wsl-2_3-vcxsrv.bat
  4. Launch Ubuntu 20.04
  5. Run the following commands export DISPLAY=$(ip route | awk '/^default/{print $3; exit}'):0.0 and export LIBGL_ALWAYS_INDIRECT=1
  6. Run xeyes to see if I can display a GUI.
  7. 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.