Score:3

WSL Ubuntu installation fails with the error: "Please restart WSL with the following command..."

ma flag

I am trying to run a Linux program on my laptop for the first time. My machine is running Windows 11. I've followed online guides for installing Ubuntu on WSL such as the ones here:

https://learn.microsoft.com/en-us/windows/wsl/install

https://learn.microsoft.com/en-us/windows/wsl/install-manual

https://learn.microsoft.com/en-us/windows/wsl/setup/environment

But when I install Ubuntu I get the error in the picture below:

error message

Here are the commands I've been running to try to resolve.

Confirming WSL is installed:

PS C:\Users\User> wsl --install

Windows Subsystem for Linux is already installed.
The following is a list of valid distributions that can be installed.
Install using 'wsl --install -d <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

PS C:\Users\User> wsl -l -v
Windows Subsystem for Linux has no installed distributions.
Distributions can be installed by visiting the Microsoft Store:
https://aka.ms/wslstore

Install Ubuntu, launch, get the error message in the attached image. Follow the command instructions in that error message:

PS C:\Users\User> wsl --shutdown
PS C:\Users\User> wsl --unregister Ubuntu
Unregistering...
There is no distribution with the supplied name.

Uninstall Ubuntu manually:

PS C:\Users\User> wsl --install -d Ubuntu
Installing: Ubuntu
Ubuntu has been installed.
Launching Ubuntu...

In a separate Ubuntu shell:

Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x80370102
Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS.
For information please visit https://aka.ms/enablevirtualization
Press any key to continue...

I've already enabled virtualization, confirmed with systeminfo.exe:

PS C:\Users\User> systeminfo.exe
...
Hyper-V Requirements:      VM Monitor Mode Extensions: Yes
                           Virtualization Enabled In Firmware: Yes
                           Second Level Address Translation: Yes
                           Data Execution Prevention Available: Yes
blitz1259 avatar
ma flag
Yep followed those instructions (obviously) but get the same error
ChanganAuto avatar
us flag
Make sure your Windows is fully updated, WSL enabled, etc. This basically is a Windows question.
ChanganAuto avatar
us flag
Please [edit] the question to add those details as requested.
ChanganAuto avatar
us flag
And, of course, **Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS** <- This seems to be the problem. Please check UEFI ("BIOS") settings.
blitz1259 avatar
ma flag
I think I've enabled it, I run the systeminfe.exe command and can see "Virtualization Enabled In Firmware: Yes" under the Hyper-V requirements. Is there another step after that's enabled?
Score:4
vn flag

Yes, you do seem to have virtualized enabled in the firmware, as you indicate:

Hyper-V Requirements:      VM Monitor Mode Extensions: Yes
                           Virtualization Enabled In Firmware: Yes

But you don't appear to have the Virtual Machine Platform (VMP) enabled. It should have been enabled during the initial wsl --install, but it looks like something went wrong.

On a Windows 11 system with the VMP (or Hyper-V) enabled, you'd see something slightly different in the systeminfo.exe results:

Hyper-V Requirements:      A hypervisor has been detected. Features required for Hyper-V will not be displayed.

While this next suggestion is unlikely to fix the problem (but we can hope), it may at least give us a clue as to why the VMP isn't enabled.

From an Administrative PowerShell, run:

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

From Manual Installation - Step 3 - Enable Virtual Machine feature

Then restart the machine.

Watch closely during the reboot for any error messages that might appear. If things look normal during the reboot, then from a non-admin PowerShell, try:

wsl --set-default-version 2

Followed by the wsl --install -d Ubuntu again.

blitz1259 avatar
ma flag
That did the trick, thanks so much for your help!
mathandlogic avatar
et flag
Could you tell me how to undo this: ´´´´dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart´´´´ My Laptop is keeps go on after I click shutdown after I did this change
NotTheDr01ds avatar
vn flag
@mathandlogic Should be pretty much the opposite -- `dism.exe /online /disable-feature /featurename:VirtualMachinePlatform /all`. Also see [here](https://www.itechtics.com/enable-disable-windows-features/) for additional options. If your system is having issues, you may need to restart in Safe Mode to disable it.
NotTheDr01ds avatar
vn flag
@mathandlogic You should probably post a new question rather than trying to debug a separate problem in the comments :-).
mathandlogic avatar
et flag
Hehe I solved the problem by leaving out the all optiin
Score:0
jo flag

For me this was caused by the location Ubuntu was attempting to unpack from(%AppData%/Local/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc) had compress contents to save disk space enabled by default for some reason. I disabled that in the folders advanced options, and tried the installation again, and it succeeded.

I followed some of the directions found here: https://www.thewindowsclub.com/wslregisterdistribution-failed-with-error-0xc03a001a-2

Screenshot of file settings

Score:0
fi flag

I had the same problem. Please visit the following site and follow the instructions. I did and my problem was solved. https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps

David avatar
cn flag
This is just a link not an answer. If there is important info at that link it needs to be in the answer written here.
Score:0
lb flag

Try This..

wsl and kali installation instructions step-by-step for windows server 2022

for earlier distributions of windows you may need to install RSAT Tools to enable VirtualMachinePlatform and Microsoft-Windows-Subsystem-Linux

for windows 10 https://www.microsoft.com/download/details.aspx?id=45520

lets start

Enable developer options from windows settings

Download the Linux kernel update package to your desktop folder # https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi

Download the kali linux wsl to your desktop folder # https://aka.ms/wsl-kali-linux-new

Open PowerShell as administrator and execute

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Restart

Open PowerShell as administrator and execute

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

Restart

Open PowerShell as administrator and execute

cd desktop

./wsl_update_x64.msi

Add-AppxPackage .\KaliLinux_1.13.1.0.AppxBundle

wsl --set-default-version 2

kali # set your new unix username and password

$exit

wsl --set-version kali-linux 2

start kali # welcome to Kali

$sudo apt update

$exit

explorer \\wsl.localhost

congrats you got the wsl 2 installed on your machine

if you are looking for the full functionality of kali linux you may execute the following commands

that would consume around 25 GB of C drive and 1 to 3 hours to complete the download and installation

start kali

$sudo apt install -y kali-win-kex

select your language then press tab then ok

$sudo apt install -y kali-linux-large

macchanger select to automate the macchanger process every time you connect to new network ethernet cable or reenable wifi

kismet select run kismet as sudo so you don't need to type sudo when using kismet

select Inted for sslh to reduce resource consuming

Win-KeX provides a Kali Desktop Experience for Windows Subsystem for Linux (WSL 2)

start kali

$kex --esm --ip -s

Enabling network connectivity in WSL 2

ipconfig

Ethernet adapter vEthernet (WSL):

IPv4 Address. : 172.22.64.1

Subnet Mask . : 255.255.240.0

$sudo ifconfig eth0 172.22.64.5 netmask 255.255.240.0

$sudo route add default gw 172.22.64.1

netsh interface portproxy add v4tov4 listenport=3390 listenaddress=0.0.0.0 connectport=3000 connectaddress=172.22.64.5

also open port 3000 from windows firewall

happy work!

Mahmoud avatar
lb flag
It works for me and the installation done
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.