Table of Contents
WSL Windows Subsystem for Linux
In some cases, you got this error when open a Linux distribution in WSL. It says you have no installed distributions even you’ve installed them in Microsoft Store.
As you can see in the below screenshot. We’ve installed some Linux instances from the Microsoft Store. But the instances are not shown in the WSL in command line.
Before you move forward, let’s check Windows Machine Platform is installed. If it’s not enabled, let’s turn it on from Turn Windows features on or off.
Alternatively, you can try to re-enable Virtual Machine Platform and Windows Subsystem for Linux using PowerShell. Let’s open PowerShell (elevated mode) then run the below commands then restart your computer.
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
Install WSL Linux kernel update package
Once the computer restarted, we need to do one more step to install the Linux kernel update package for WSL. This package with the new kernel update and is required for WSL 2.
1️⃣ Download then install the Linux kernel update package from this link https://aka.ms/wsl2kernel. Or you can download then install the package from this direct download link.
2️⃣ Restart your computer then reinstall any Linux distribution to verify it works.
3️⃣ Get the list of available distributions using the command wsl -l -o.
PS C:\Users\admin> wsl -l -o
The following is a list of valid distributions that can be installed.
Install using 'wsl.exe --install <Distro>'.
NAME FRIENDLY NAME
Ubuntu Ubuntu
Debian Debian GNU/Linux
kali-linux Kali Linux Rolling
SLES-12 SUSE Linux Enterprise Server v12
SLES-15 SUSE Linux Enterprise Server v15
Ubuntu-18.04 Ubuntu 18.04 LTS
Ubuntu-20.04 Ubuntu 20.04 LTS
OracleLinux_8_5 Oracle Linux 8.5
OracleLinux_7_9 Oracle Linux 7.9
4️⃣ Reinstall the Linux distribution with the command wsl –install <distribution>.
PS C:\Users\admin> wsl --install ubuntu
Ubuntu is already installed.
Launching Ubuntu...
5️⃣ The first time you launch a newly installed Linux distribution, a console window will open, and you’ll be asked to wait for a minute or two for files to de-compress and be stored on your PC.
You will then need to create a user account and password for your new Linux distribution.
Get the list of installed distributions and running state:
PS C:\Users\admin> wsl -l -v
NAME STATE VERSION
* Ubuntu Running 2
Not a reader? Watch this related video tutorial: