## Links Microsoft: [about WSL](https://docs.microsoft.com/en-us/windows/wsl/about) [install WSL](https://learn.microsoft.com/en-us/windows/wsl/install) [Ubuntu](https://ubuntu.com/wsl) [Wikipedia](https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux) [Installing multiple instances of Ubuntu](https://cloudbytes.dev/snippets/how-to-install-multiple-instances-of-ubuntu-in-wsl2)([summarised](InstallingMultipleInstances)) ## Wsl Versions To set version 2 (Hyper-V): ```powershell 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) ``` ### Renaming a Wsl instance This currently needs to be done via the registry. See [this superuser question](https://superuser.com/questions/1507237/how-to-change-the-name-of-a-wsl-distro-to-reflect-the-actual-distro). In short: load `regedit`, and go to `HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss` where you will find each Wsl instance named by its GUID -- e.g. ``` HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss\{f31d4ad5-1271-4c2c-8c29-59c825e087e2} ``` And in this key you will find `DistributionName` which you can edit. Note that you need to ensure that all Wsl instances are not running when you do this. ## X11 server **Now with Ubuntu 22.04 under Windows 11, graphics works out of the box.** I use Vcxsrv (presumably short for Visual C++ X Server) You need to run the following script inside the Linux VM ```bash 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. ## Ssh SshServerWsl