If you have Ubuntu on Windows installed on your WIN 10 or 11 it is version 1. You can update to version 2 by doing the following.
Pre requiset
Reboot your machine to place wsl in stopped mode.
VM and Hypervosor must be turned on.
(https://user-images.githubusercontent.com/40771084/202699498-611dd9ee-a98a-4a50-af66-aa2ad34a499c.png)
Change to version 2
1. Access the PowerShell or Command Prompt as an administrator.
2. Check the current WSL version for the installed subsystems with:
wsl -l -v
The first column shows installed WSL instance names, while the second shows the WSL version for each instance.
NAME STATE VERSION
* Ubuntu Stopped 1
3. To upgrade an existing instance to WSL 2, run:
(Ubuntu is the default)
wsl --set-version Ubuntu 2
4. Set 2 as the default msl
wsl --set-default-version 2
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
The operation completed successfully.
5. Confirm the change worked. Recheck the WSL version:
wsl -l -v
NAME STATE VERSION
* Ubuntu Stopped 2
6. Restart WSL
wsl --shutdown
7. Open the new wsl version
wsl -d ubuntu
The command prompt is open in Ubuntu.
giles@COFFEE-1:/mnt/c/Users/giles$
8. Check the upgrade with uname
giles@COFFEE-1:/mnt/c/Users/giles$ uname -r
5.15.167.4-microsoft-standard-WSL2
9. I created a link on the taskbar to the program so you get a window that is Ubuntu.
"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\WSL.lnk"
Dingo, what can you do with WSL? Wouldn't you be better off running Linux natively or are there advantages with WSL?
You can run BOINC on it but it is terribly slow and uses more resources, I wouldn't do it.
I have only used it to backup my windows machine and my web server using linux scripts. You can access windows and Linux file systems in the same script which is useful sometimes.
This is from the FAQ.
QuoteWhy would I use WSL rather than Linux in a VM?
WSL requires fewer resources (CPU, memory, and storage) than a full virtual machine. WSL also allows you to run Linux command-line tools and apps alongside your Windows command-line, desktop and store apps, and to access your Windows files from within Linux. This enables you to use Windows apps and Linux command-line tools on the same set of files if you wish.