microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.18k stars 806 forks source link

WslRegisterDistribution failed with error: 0x80370102 #9656

Open rnertney opened 1 year ago

rnertney commented 1 year ago

Version

Microsoft Windows [Version 10.0.22621.1265]

WSL Version

Kernel Version

2

Distro Version

Ubuntu 22.04

Other Software

No response

Repro Steps

In Windows Features:

In task manager, virutalization is fully enabled in my BIOS, confirmed via systeminfo, too:


Hyper-V Requirements:      VM Monitor Mode Extensions: Yes
                           Virtualization Enabled In Firmware: Yes
                           Second Level Address Translation: Yes
                           Data Execution Prevention Available: Yes
PS C:\WINDOWS\system32> ubuntu
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...
PS C:\WINDOWS\system32> bcdedit /set hypervisorlaunchtype auto start
The operation completed successfully.

All of the online documentation takes me in loops or tells me to roll back to WSL 1.

The BIOS says I have virtualization enabled, the task manager says it....

I've disabled and re-enabled all of these checkboxes and rebooted, and I still cannot get WSL2 working on my Windows 11 box

Expected Behavior

I would expect ubuntu to load

Actual Behavior

PS C:\WINDOWS\system32> ubuntu
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...
PS C:\WINDOWS\system32>
image image

Diagnostic Logs

No response

SirDarwin commented 1 year ago

I've made a little bit of progress, I think?

I found there was an install of Kali Linux in my WSL and I have no idea how long it was there. I uninstalled it and installed Ubuntu, but now running the wsl command results in this message:

`Windows Subsystem for Linux has no installed distributions.

Use 'wsl.exe --list --online' to list available distributions and 'wsl.exe --install ' to install.

Distributions can also be installed by visiting the Microsoft Store: https://aka.ms/wslstore Error code: Wsl/Service/CreateInstance/GetDefaultDistro/WSL_E_DEFAULT_DISTRO_NOT_FOUND`

I've tried reinstalling Ubuntu, from both the Microsoft store and by using wsl --install but I'm still getting the same result. Opening the Ubuntu app in my Start Menu I get this:

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...

and Docker, which is what I'm ultimately trying to set up here, throws these errors:

Docker.Core.HttpBadResponseException: {"message":"2 errors occurred:\n\t provisioning docker WSL distros: deploying \"docker-desktop\": importing WSL distro \"docker-desktop\": deploying WSL distro \"docker-desktop\" (\"C:\\Program Files\\Docker\\Docker\\resources\\wsl\\wsl-bootstrap.tar\" -\u003e \"C:\\Users\\SirDarwin\\AppData\\Local\\Docker\\wsl\\distro\"): exit status 0xffffffff\n\t checking if isocache exists: CreateFile \\wsl$\docker-desktop-data\isocache\: The network name cannot be found.\n\n"}

at Docker.Core.GoBackend.GoBackendClient.d19.MoveNext() in C:\workspaces\4.16.x\src\github.com\docker\pinata\win\src\Docker.Core\GoBackend\GoBackendClient.cs:line 226 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Docker.Engines.WSL2.LinuxWSL2Engine.d11.MoveNext() in C:\workspaces\4.16.x\src\github.com\docker\pinata\win\src\Docker.Engines\WSL2\LinuxWSL2Engine.cs:line 54 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Docker.ApiServices.StateMachines.TaskExtensions.d0.MoveNext() in C:\workspaces\4.16.x\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\TaskExtensions.cs:line 29 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Docker.ApiServices.StateMachines.StartTransition.d6.MoveNext() in C:\workspaces\4.16.x\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 91 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Docker.ApiServices.StateMachines.StartTransition.d6.MoveNext() in C:\workspaces\4.16.x\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 118 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Docker.ApiServices.StateMachines.EngineStateMachine.d15.MoveNext() in C:\workspaces\4.16.x\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\EngineStateMachine.cs:line 72 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Docker.Engines.Engines.d__23.MoveNext() in C:\workspaces\4.16.x\src\github.com\docker\pinata\win\src\Docker.Engines\Engines.cs:line 109

I've been talking with a few people about this and apparently this means it can't find an install of WSL. So with all in this in mind, it seems WSL is still not working for me.

Another way to run Docker would be in a virtual machine, but not even those are working for me anymore. I have tried both Hyper-V and VMWare.

If I were unable to find a solution here or anywhere else, my only option would be to reinstall Windows which I'm avoiding at all costs.

It may be a good idea for you to check your installed distros if you haven't already, with wsl --list or --list --verbose, uninstall any you find and see how WSL behaves afterwards.

Edit: Also, I can't seem to tell if I'm on WSL 1 or 2. I tried setting the default version to 1 just to try, then disabling and re-enabling WSL in my Windows features, but I decided to go back to 2, did the same thing, and this is my version info:

WSL version: 1.0.3.0 Kernel version: 5.15.79.1 WSLg version: 1.0.47 MSRDC version: 1.2.3575 Direct3D version: 1.606.4 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.19045.2604

LLP2333 commented 1 year ago

I also have the same issue. When this problem occurred, both my Windows Sandbox and WSL2 stopped working properly. Then I found an article about fixing the Sandbox and resolved the issue by following these steps:

Uninstall Windows Sandbox.

Restart your computer.

Open Command Prompt (Run as administrator) and execute the following command:

bcdedit /set hypervisorlaunchtype Auto

Uninstall Hyper-V.

Restart your computer.

Install Hyper-V.

Restart your computer and verify that Hyper-V is working.

Install Windows Sandbox.

Restart your computer and verify that Sandbox is functioning properly.

The link: https://answers.microsoft.com/zh-hans/windows/forum/all/windows-10-%E6%89%93%E5%BC%80windows/286f8a35-6a74-433c-b00f-bcd03812d180 I'm not sure why this solution is effective, but it did resolve the issue with my WSL2 not functioning properly.

LLP2333 commented 1 year ago

Additional information: The issue with my WSL2 occurred after I installed an Android emulator called Mumu.

NeroSH commented 7 months ago

I also have the same issue. When this problem occurred, both my Windows Sandbox and WSL2 stopped working properly. Then I found an article about fixing the Sandbox and resolved the issue by following these steps:

Uninstall Windows Sandbox.

Restart your computer.

Open Command Prompt (Run as administrator) and execute the following command:

bcdedit /set hypervisorlaunchtype Auto

Uninstall Hyper-V.

Restart your computer.

Install Hyper-V.

Restart your computer and verify that Hyper-V is working.

Install Windows Sandbox.

Restart your computer and verify that Sandbox is functioning properly.

The link: https://answers.microsoft.com/zh-hans/windows/forum/all/windows-10-%E6%89%93%E5%BC%80windows/286f8a35-6a74-433c-b00f-bcd03812d180 I'm not sure why this solution is effective, but it did resolve the issue with my WSL2 not functioning properly.

Thanks for your answer. I was really stuck on that error. Following first 6 steps helped me to install sucessfully Ubuntu and run docker server on my Winddoows 11 machine

shokurov commented 4 months ago

I'm experiencing absolutely the same problem. Tried all solutions listed, nothing really helps.

LLP2333 commented 4 months ago

@shokurov Please try to open window's terminal as administrator, enter bcdedit command and check if the value of hypervisorlaunchtype is Auto. then check if the Windows Subsystem for Linux software from Microsoft Store is the latest version. You can check as above, if all these are fine, I don't know anymore.

joseignaciostassi commented 2 months ago

I also have the same issue. When this problem occurred, both my Windows Sandbox and WSL2 stopped working properly. Then I found an article about fixing the Sandbox and resolved the issue by following these steps:

Uninstall Windows Sandbox.

Restart your computer.

Open Command Prompt (Run as administrator) and execute the following command:

bcdedit /set hypervisorlaunchtype Auto

Uninstall Hyper-V.

Restart your computer.

Install Hyper-V.

Restart your computer and verify that Hyper-V is working.

Install Windows Sandbox.

Restart your computer and verify that Sandbox is functioning properly.

The link: https://answers.microsoft.com/zh-hans/windows/forum/all/windows-10-%E6%89%93%E5%BC%80windows/286f8a35-6a74-433c-b00f-bcd03812d180 I'm not sure why this solution is effective, but it did resolve the issue with my WSL2 not functioning properly.

You saved my day, i've spent 4 hours figuring this out, i did everything related to wsl, docker and BIOS stufff to enable virtualization, this was the answer.