In case you hadn't heard, Microsoft loves Linux. That phrase draws its skeptics but then we saw Windows Subsystem for Linux (WSL) and started to see the truth in it. WSL 2 allows you to install a Linux environment running a full Linux kernel inside Windows 11, or 10 if you're still using that, with fairly tight integration between the two. The first version of WSL didn't have a kernel and didn't perform nearly as well. WSL is still a virtual machine at heart, but one with deep ties to its Windows host.
For developers, WSL means seamless access to both Windows and Linux without the need to use traditional virtual machines. You don't have to be a developer, though, it's a solid tool for anyone to use whether they're an old hand or just starting out with Linux. Microsoft has done a lot of work in the onboarding experience, too, with WSL 2 now easier than ever to get up and running. Here's how to do it.
What you need to run WSL 2 on Windows 10 and 11
You don't need a mega-powerful PC to run WSL 2 nor do you need the "Pro" version of Windows as you traditionally do to use the Hyper-V VM tool. WSL 2 does utilize the Hyper-V architecture but you don't need to pay extra for it. WSL 2 also supports both x64 and ARM processors. If you're using it on an ARM-based machine, however, you will need to use a version of Linux that has an ARM release, such as Ubuntu.
WSL 2 can also be run on Windows inside a virtual machine as long as the VM software you use has support for nested virtualization and this is enabled.
How to install WSL 2 on Windows 10 and 11
The installation process for WSL 2 is now so straightforward you're up and running in minutes. The only pre-requisite is that you're on Windows 10 version 2004 and above (and you really should be by now) with the KB5004296 patch applied.
There are two options to choose from: Use the Microsoft Store or use PowerShell.
For the first method, simply open up the Microsoft Store and download the "Windows Subsystem for Linux Preview" application. Long term this is expected to be the place to get WSL from as it allows the team to update it without needing to go through Windows Update.
Alternatively, open up PowerShell on your PC and enter this command:
Sit back and wait for it to do its thing, reboot your PC when signaled to, and voila! WSL 2 is now set up on your PC. The default distribution (distro) is Ubuntu, but you're free to use any others available in the Microsoft Store or from third-party sources such as Github or directly from distro makers.
If you're using Windows 11 then the Windows Terminal app will be pre-installed and it's the best way to use WSL on your PC. You can launch a distro through PowerShell using the command "wsl -d" command followed by the name, but with Windows Terminal you can access each that you have installed from a dropdown menu.