Wsl Versions
To set version 2 (Hyper-V):
PS> wsl --list Ubuntu-20.04 (Default) PS> wsl --set-default-version 2 (may tell you to update kernel version) PS> wsl --set-version Ubuntu-20.04 2 (may take some time to convert)
X11 server
I use Vcxsrv (presumably short for Visual C++ X Server)
You need to run the following script inside the Linux VM
export DISPLAY=$(awk '/nameserver / {print $2; exit}' /etc/resolv.conf 2>/dev/null):0 export LIBGL_ALWAYS_INDIRECT=1
Then with Vcxsrv you need to disable access control.
Then you need to create a hole in the Windows firewall.
- Open Control Panel -> System and Security -> Windows Defender Firewall
- Select Advanced Settings
- Select Inbound Rules in the left pane
- Find the VcXsrv windows xserver entries (hint: sort by name)
- Enable access for public networks
If you are on a home network, this is fine. If you are somewhere where being this permissive security-wise is risky, take care.