Skip to content

Instantly share code, notes, and snippets.

@afmiguez
Last active February 18, 2021 18:07
Show Gist options
  • Save afmiguez/4e3873b8e6c12b0e6d7f54c79183cb02 to your computer and use it in GitHub Desktop.
Save afmiguez/4e3873b8e6c12b0e6d7f54c79183cb02 to your computer and use it in GitHub Desktop.
WSL2 gui apps
Follow the instructions on the links
https://gist.github.com/tdcosta100/385636cbae39fc8cd0937139e87b1c74 (Specially for installing a desktop environment)
https://github.com/cascadium/wsl-windows-toolbar-launcher
https://gist.github.com/Ta180m/e1471413f62e3ed94e72001d42e77e22
git clone https://github.com/DamionGans/ubuntu-wsl2-systemd-script.git
cd ubuntu-wsl2-systemd-script/
bash ubuntu-wsl2-systemd-script.sh
Install Vcxsrv program
Firewall rule to allow traffic from WSL2 (should be used on powershell in Administrator mode)
```
New-NetFirewallRule -DisplayName "WSL" -Direction Inbound -InterfaceAlias "vEthernet (WSL)" -Action Allow
```
Vcxsrv should run using theses parameters
Multiple windows and display number = 0 -> Start no client -> Check Disable access control
You could save the configuration in order to run Vcxsrv on startup
Set DISPLAY variable to point to Windows 10 Host X11-Server
```
echo export DISPLAY=$(grep -m 1 nameserver /etc/resolv.conf | awk '{print $2}'):0.0 >> ~/.bashrc
echo export LIBGL_ALWAYS_INDIRECT=1 >> ~/.bashrc
```
https://www.thewindowsclub.com/startup-folder-in-windows-8#:~:text=The%20All%20Users%20Windows%2010,common%20startup%20and%20hit%20Enter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment