Table of Contents
Windows Subsystem for Linux WSL
You can list your installed Linux distributions and check the version of WSL each is set to by entering the command:
PS C:\> wsl -l -v
NAME STATE VERSION
Ubuntu Running 1
When you run this command, if you need enable virtual machine platform, it means you’ve WSL 1.
PS C:\> wsl --status
Default Distribution: Ubuntu
Default Version: 2
Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled.
For information please visit https://aka.ms/wsl2-install
Upgrade WSL 1 to WSL 2
To upgrade WSL 1 to WSL 2, you need enable Virtual Machine Platform feature then install the Linux kernel update package.
1. First, open Windows PowerShell admin then enable Virtual Machine Platform feature using the following command:
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all
2. Download then install the Linux kernel update package https://aka.ms/wsl2kernel
3. To set the default version to WSL 1 or WSL 2 when a new Linux distribution is installed, use the command:
PS C:\> wsl --set-default-version 2
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
The operation completed successfully.
4. Get the list of available distributions then install a new Linux distribution.
PS C:\> wsl -l -o
The following is a list of valid distributions that can be installed.
The default distribution is denoted by '*'.
Install using 'wsl --install -d <Distro>'.
NAME FRIENDLY NAME
* Ubuntu Ubuntu
Debian Debian GNU/Linux
kali-linux Kali Linux Rolling
openSUSE-42 openSUSE Leap 42
SLES-12 SUSE Linux Enterprise Server v12
Ubuntu-16.04 Ubuntu 16.04 LTS
Ubuntu-18.04 Ubuntu 18.04 LTS
Ubuntu-20.04 Ubuntu 20.04 LTS
PS C:\> wsl --install -d debian
Downloading: Debian GNU/Linux
Installing: Debian GNU/Linux
Debian GNU/Linux has been installed.
Launching Debian GNU/Linux...
PS C:\> wsl -l -v
NAME STATE VERSION
Ubuntu Stopped 1
Debian Running 2
5. Finally, you can update previously installed Linux distributions from WSL 1 to WSL 2 as well.
PS C:\> wsl --set-version ubuntu 2
Conversion in progress, this may take a few minutes...
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
Conversion complete.
PS C:\> wsl -l -v
NAME STATE VERSION
Ubuntu Stopped 2
Debian Running 2