How to Install WSL2 (Windows Subsystem for Linux 2) on Windows 10?
WSL2 or Windows Subsystem for Linux 2 is a newer and better version of WSL. It is a great way to use Linux distro on your Windows OS. The WSL2 was released as a replacement for WSL and is a light weighted window that works like any other VM (virtual machine) on your Windows.
As compared to other traditional VM, WSL2 is light-weighted, has great integration between Windows and Linux with low resource requirements. WSL2 has a full system called compatibly and is a great way to perform dual booting without long installation processes. Here is how to install WSL2 on Windows 10 and Windows 11.
Table of Contents
How to Install WSL2 (Windows Subsystem for Linux 2) on Windows?
Here you can use the procedures to install WSL2 on Windows 10 or Windows 11. During or after the installation, all the problems the user experiences are also given. There is also a separate section for installing WSL2 on Windows 10 v1909 or earlier.
Note: For installing WSL2 on ARM64 systems, you will need to use Windows 10 version 2004 or higher with Build 19041.
Enable Windows Subsystem for Linux
This will be the first step to the installation of WSL2. Begin by the going to Start menu and opening Turn Windows Features ON or OFF. There you will navigate and find Windows Subsystem for Linux and check the box. Once the option is checked, click on OK.
You can also use the DISM option on CMD or PowerShell to enable Windows Subsystem for Linux. Open CMD or PowerShell as administrator and use the command below:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
Enable Virtualization Option
Then you will enable your virtualization features on your system. for the operation, you will enable the feature on BIOS first then you will enable it on Windows OS. Here is “How to install or enable Hyper-V on Windows 10?” which enables the features from BIOS first then will enable it from Windows settings later.
Or if you have already enabled the feature from BIOS then this will help you “How to Enable Virtualization on Windows 10?”.
Install WSL2 on Windows10 v2004 or later
Exactly the same procedure can be used to install WSL2 on Windows 11 too. There are no differences while performing the installation on both Windows 11 and Windows 10 (v2004 or later).
Start the procedure by opening the Start menu and running CMD (command prompt) as administrator.
Inside the CMD, you will use the command given below:
wsl –install
the command given above will install WSL on your system. give your system a restart and once your system runs again, you will continue with the Linux Distro setup. Don’t forget to use the “apt update && apt upgrade” command to perform the reset of upgrading automatically.
Install WSL2 on Earlier versions of Windows 10
If you are using Windows 10 v1909 or older then you will need to enable WSL1 first. Then enable the virtualization feature which will be used for converting existing distros then you will configure the WSL2 as default.
Make WSL2 as Default on Windows
To make the WSL2 as default, you will need to type the command below on CMD (as administrator). The command is applicable on both Windows 10 and Windows 11 (if you have also installed WSL).
wsl --set-default-version 2
if you want to change back to WSL then you can use the same command given above. However; you will change the command’s version to 1 which will look something like this:
wsl --set-default-version 1
Install specific distro of Linux on Windows Subsystem
For users who want to install a specific distro of Linux on Windows Subsystem then they will use this method. You can use either Microsoft Store and search for a specific distro of Linux. Then you will download it and perform the installation.
Or you will open CMD as administrator and use the command below:
wsl --list –online
the command above will list all the distros available to you. Then you will select the distribution that you desire from the list which will be: Ubuntu, Debian, Kali, openSUSE, or SUSE Linux Enterprise Server. Now use the command below to install the distribution.
wsl --install -d *distro name*
Note: don’t forget to change the *distro name* with the exact distro name on your screen. There will be some who will copy and will straight forward paste the command on their system.
Download Linux distro for Windows Subsystem
It might be useless for some as you have already reached here. Still, for those who want to download Linux distro, they can either use Microsoft Store or one of the commands given below:
Invoke-WebRequest -Uri https://aka.ms/wslubuntu2004 -OutFile Ubuntu.appx –UseBasicParsing
Or
curl.exe -L -o ubuntu-2004.appx https://aka.ms/wsl-ubuntu-2004
Note: as you can see in the commands above, we have requested Ubuntu version 2004 from Invoke server. If you desire to change the Linux distro, then you will replace the Ubuntu and the version with the distribution that you desire.
Related Topic: How to download Linux Subsystem for Windows?
Update WSL Kernel on Windows
If you want to update your WSL Kernel, then you can either use “wsl –update” on CMD or PowerShell as administrator or you can go to Settings > Update & Security > Windows Update > Advanced options. There you will turn on the Receive updates for other Microsoft products when you update the Windows toggle button.
Related Topic: How to install WSL2 on Windows Server?