Introduction
The Windows Subsystem for Linux (WSL) is a feature in Windows 10/11 and Windows Server that allows users to run a Linux environment directly on top of the Windows operating system. It enables users to run Linux command-line tools, utilities, and applications directly on their Windows machine without the need for a virtual machine or a separate Linux installation. WSL also provides better compatibility with Linux software than traditional virtual machines, as it runs Linux binaries natively on the Windows kernel. Is great for testing and coding, however, it may not be suitable for all use cases. Depending on your needs, you may want to consider using a full virtual machine or a dual-boot setup instead.
There are two different versions of WSL, but in this guide though, we're not going to install WSL1, but we're going to focus install WSL 2. If you really want to know the difference, please check here.
Note: Before we begin we will need to enable virtualization in the computer BIOS to install WLS2.
If you are unsure if you have virtual services enabled or not, use the following PowerShell command:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property 'HypervisorPresent'
Install WSL2 on Windows 10/11 (Newer versions)
01. Prerequisites:
Running on Windows 10 version 2004 and higher (Build 19041 and higher) or Windows 11 to use the commands below.
02. Install WSL command:
Open PowerShell and Run as administrator
By default, Windows will install the Linux Ubuntu distribution. This can be changed using the -d flag. To see the option: wsl --list --online or wsl -l -o , To install additional Linux distributions after the initial install, you may also use the command: wsl --install -d <Distribution Name>, for example:
wsl --install -d Debian
Restart your computer after finishing the WSL installation on Windows 10.
Restart-Computer
The default setting for new Linux installations created with the wsl --install the command is WSL 2.
The wsl --set-version the command can be used to update previously installed Linux distributions from WSL 1 to WSL 2 or to downgrade from WSL 2 to WSL 1.
Use the command: wsl -l -v to check whether your Linux distribution is set to WSL 1 or WSL 2.
Use the command wsl --set-version <distro name> 2 to change versions or you want to upgrade. For instance, wsl --set-version Ubuntu-22.04 2 will instruct your installation of Ubuntu 22.04 to utilize WSL 2.
03. Update WSL kernel command:
wsl --update
After you finish the necessary actions, the device will automatically download and install any available updates.
Install WSL2 on Windows 10 (older versions)
We normally advocate using wsl --install to install Windows Subsystem for Linux for convenience, although this may not be supported if you're using an earlier release of Windows. The manual installation instructions are provided below.
01. Requirements:
In order to upgrade to WSL 2, your operating system must be Windows 10. It's important to note that builds prior to 18362 do not have WSL 2 support. For x64 systems, you need to have version 1903 or later, with build 18362 or later. If you have an ARM64 system, you must have version 2004 or later, with build 19041 or later.
02. Enable the Windows Subsystem for Linux:
Open PowerShell as Administrator and then run:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
03. Turn on the Virtual Machine functionality:
You must activate the Virtual Machine Platform optional feature before installing WSL 2. This functionality will require virtualization capability on your PC.
Run the following commands in PowerShell as Administrator:
Dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Restart your computer by using Restart-Computer command to finish the WSL installation and update to WSL 2.
04. Get the Linux kernel update package:
Download the latest package:
Execute the update package that you downloaded in the previous step. (Double-click to execute; you will be requested for elevated rights; choose 'yes' to accept this installation.)
When the installation is finished, go to and following step, which is to make WSL 2 your default version when installing new Linux distributions. (Skip this step if your new Linux installations will be configured to WSL 1 or going to).
05. Set WSL 2 as your default version:
Open PowerShell as administrator and run this command to set WSL 2 as the default version when installing a new Linux distribution:
wsl --set-default-version 2
(Optional) You can also enter the following command to convert the distro from WSL to WSL 2. Change “Debian” for the distro’s name that you may want to convert
wsl --set-version Debian 2
06. Install your preferred Linux distribution:
Navigate to the Microsoft Store and choose your preferred Linux distribution.
07. Confirmation:
Enter the following command to verify the distribution's name and WSL version:
wsl --list --verbose


Comments 3 comments
If Tab key for auto completion is not working, please try to: sudo apt install bash-completion.
Or you can install Zsh shell
Systemd support is now available in WSL!:
https://devblogs.microsoft.com/commandline/systemd-support-is-now-available-in-wsl/
Advanced settings configuration in WSL
https://learn.microsoft.com/en-us/windows/wsl/wsl-config