Could we help you? Please click the banners. We are young and desperately need the money
In this guide, we'll cover enabling WSL, installing WSL 2 (optional), getting a Linux Distribution, and changing the WSL version a Distribution uses.
WSL stands for Windows Subsystem for Linux. It's a convenient solution for running a Linux environment directly on your Windows machine without use of a conventional Virtual Machine or dual-booting.
WSL 2 is an overhaul of WSL that has better performance and more features and runs on an actual Virtual Machine.
For a detailed comparison of the two, see Microsoft's Comparing WSL 1 and WSL 2.
To enable WSL, open up PowerShell as an Administrator, and run the following command:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
If you do not wish to install WSL 2, you can now restart your computer, and then move on to getting a Distribution.
WSL 2 requires the Virtual Machine Platform feature to be enabled. In PowerShell (Administrator), run the following command:
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Restart your computer, then install the Linux kernel update package that corresponds to your processor architecture:
Once the installation is complete, you can optionally set your default WSL version to 2. That way, Linux Distributions installed in the future will automatically use WSL 2. In PowerShell, run the following command:
wsl --set-default-version 2
Find your favourite Linux Distribution on the Microsoft Store. The following are available:
In PowerShell, run the following command to view all installed Distributions and their WSL version:
wsl --list --verbose
To change a Distribution's WSL version, run this command (be sure to insert the correct Distribution name and desired WSL version):
wsl --set-version <distribution> <version>
For example, changing Ubuntu 22.04 to use WSL 2 would look like this:
wsl --set-version Ubuntu-22.04 2