Select Start menu Type cmd.exe in Search Right-click & select “Run as Administrator

wsl.exe --install

Installs the Ubuntu distribution and WSL on the device.

Remember you must also install Hyper-V Service (WSL.exe doesn’t do it)

In the same elevated (as Administrator) Cmd prompt:

DISM /Online /Enable-Feature /All /FeatureName:Microsoft-Hyper-V

Or the same can be done in an Elevated PowerShell session:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All

REMINDER: You must also have the following enabled in your computer’s BIOS:

  • Enable Hardware Virtualization.
  • Enable Nested Virtualization.
  • Turn on Virtual Machine Platform

Once all of the above is down, we’re ready to proceed!

Now it is time to install a Linux Distro (WSL2 tries to install Ubuntu default)

wsl --list --online

lists all available Linux distributions that you may install using the wsl command. Currently, these are:

SyntaxDescription
UbuntuUbuntu
DebianDebian GNU/Linux
kali-linuxKali Linux Rollin
openSUSE-42openSUSE Leap 42
SLES-12 SUSELinux Enterprise Server v12
Ubuntu-16.04Ubuntu 16.04 LTS
Ubuntu-18.04Ubuntu 18.04 LTS
Ubuntu-20.04Ubuntu 20.04 LTS

wsl --install -d <DistroName>

installs the selected distribution. Replace with the name of the distribution. Can be used to install additional distributions as well.

wsl --update

updates the WSL Linux kernel manually.

wsl --update rollback

Rolls back to the previous WSL kernel version.

wsl --status

Displays general information about the status of the Windows Subsystem for Linux installation.

wsl --help

Displays the list of command parameters.

List installed Distros:

wsl -l -v

Type the following command to set a distro as the new default and press Enter:

wsl --unregister DISTRO-NAME

wsl --unregister Ubuntu

Remove a Distro

winget uninstall --id "DISTRO-ID-NAME"

For example, this command removes the Ubuntu distro:

winget uninstall --id Canonical.Ubuntu