It’s never been easier to set up WSL2 on Windows, here’s how
Microsoft dropped plenty of jaws when it launched the Windows Subsystem for Linux, a way to run actual Linux inside Windows 10 without the need to set up a virtual machine. The project has seen a ton of support, and WSL2 is the latest and greatest.
It takes things a little further and adds yet more awesomeness to the Linux experience on Windows 10. If you haven’t yet checked it out, here’s how to get started.
Simplifed setup of WSL2 on Windows 10
Source: Windows Central
Once this is in place, open up PowerShell and enter this command:
wsl --install
That’s it. The setup process will begin and you can relax until it’s finished.
If you don’t have the necessary version of Windows 10 installed to follow the simplified setup, the existing, much longer method still works.
How to enable Windows Subsystem for Linux
Before you can get WSL2, you need to have WSL. That may sound slightly strange, but the methods of enabling the first iteration and the second are quite different. But to have the newest version, you first need to have the first. There’s no direct path to just installing WSL2.
We have a full guide on getting set up with the Windows Subsystem for Linux, which you should check out for a full primer on getting started, but if you’re looking for the quickest route, there’s a single line of code to enable it on your machine.
Open PowerShell as administrator and enter this command:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
Eventually, you will need to reboot your PC, but you can leave it until later if you’re going straight to installing WSL2.
How to install WSL2 on Windows 10
Source: Windows Central
There are also a couple of pre-requisites for using WSL2 on Windows 10. You need to be on the following versions:
- For x64 systems: Version 1903 or higher, with Build 18362 or higher.
- For ARM64 systems: Version 2004 or higher, with Build 19041 or higher.
If you have anything lower, you’ll need to run Windows Update before going any further.
Assuming that’s all good, the rest is straightforward.
Enabling Virtual Machine
If you don’t already have this enabled, you’ll need to turn it on before installing WSL2. As already stated, WSL2 is a tiny virtual machine, so Windows 10 needs to be prepared for that. If you have this enabled already, skip and go straight to rebooting your PC to make sure you’re ready to install.
The quickest way to do it is in PowerShell. Open PowerShell as administrator and enter this command:
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Now reboot your PC and move to the next section.
Downloading and installing WSL2
The next part takes only a couple of steps.
- Download the WSL2 Kernel update.
- Run the installer.
- When prompted for elevated permissions, click yes.
Once the installer has done its thing, you’ll now have WSL2 successfully installed on your PC.
Setting WSL2 for your Linux distros
The good thing about WSL2 is that it doesn’t replace WSL. It just runs alongside it. This means you can run Linux installs with a combination of different versions. You’re able to set either as default as well as setting a version specifically to each Linux distro you have on your PC.
Let’s break down some of the key commands to use in PowerShell that you’ll need to know.
Setting WSL2 as default
Source: Windows Central
wsl --set-default-version 2
Listing installed Linux distros and their WSL version
Source: Windows Central
wsl --list --verbose
Using the verbose flag will give you the breakdown of which version of WSL is attached to which Linux installation. Without it, you’ll simply get a list of the versions of Linux you have installed.
Changing the version of WSL per Linux installation
Source: Windows Central
wsl --set-version <distribution name> <versionNumber>
So, as an example, if you have a Debian installation on WSL that you need to convert to WSL2, you’d enter wsl --set-version debian 2
.
Launch specific Linux installations in PowerShell
Source: Windows Central
wsl
in PowerShell will launch you into the associated bash shell. But if you have multiple, you can launch a specific distro with this command.
wsl -d <distribution name>
Once you’re done, typing exit
will take you back into PowerShell.
It’s also worth grabbing the Windows Terminal app from the Microsoft Store if you’re using WSL. While you can just use the standard terminal installed with each or launch through PowerShell as shown above, Windows Terminal has a neat tabbed interface that lets you run multiple shells at once. Have PowerShell, Linux, Azure Cloud Shell, even Command Prompt, all open together side-by-side in one window.
We may earn a commission for purchases using our links. Learn more.
Go sim racing in style with any one of these great cockpits
Sim racing has experienced a boom in 2021 and that’s led to some serious interest in getting a good cockpit. Whether you’re new to the scene or more experienced and looking to up your game, one of these cockpits will give you comfort and support while you race all day and night.