Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error 0x80370102 #4120

Closed
sieja opened this issue Jun 13, 2019 · 84 comments
Closed

Error 0x80370102 #4120

sieja opened this issue Jun 13, 2019 · 84 comments
Labels
wsl2 Issue/feature applies to WSL 2

Comments

@sieja
Copy link

sieja commented Jun 13, 2019

git
git1

i Reinstalled wsl and virtual machine in Windows features

@benhillis
Copy link
Member

@sieja - Could you make sure that virtualization is enabled via your BIOS?

@sieja
Copy link
Author

sieja commented Jun 13, 2019

yes, before updating used wsl 1

@benhillis benhillis added the wsl2 Issue/feature applies to WSL 2 label Jun 13, 2019
@benhillis
Copy link
Member

Can you ensure both these are enabled?

  1. Hardware Virtualization Assists* in the form of:
    Intel VT-x
    AMD AMD-V

  2. Hyper-V requires Hardware Data Execution Prevention:
    Intel refers to it as Execute Disable (XD). This feature must be enabled in the system BIOS.
    AMD refers to it as No Execute (NX). This feature must be enabled in the system BIOS.

@heliomeiralins
Copy link

hi @benhillis .
Enabling Virtualization in the BIOS solved it for me. i know it is kind of obvious but maybe this could be added to the docs.
Thanks.

@ghost
Copy link

ghost commented Jun 15, 2019

Yeah, hm. I guess this means if you're running a Windows VM you're stuck with WSL 1, yeah? (Unless Generation 1 Hyper-V can have VMs within VMs)

@benhillis
Copy link
Member

@Aidolii hyper-v supports nested Virtualization so this is not an issue.

@ghost
Copy link

ghost commented Jun 15, 2019

I only mentioned it because I already tried. I made sure to run the Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform command of course. It gave me the error listed above when I attempted to initialize Debian, 80370102.

@onomatopellan
Copy link

onomatopellan commented Jun 15, 2019

Make sure it says "Virtualization: Enabled" on Task Manager -> Performance tab -> CPU

Also you can run systeminfo on an elevated Powershell and at the bottom it will tell you if you have Hyper-v support enabled.

@ghost
Copy link

ghost commented Jun 15, 2019

@onomatopellan @benhillis
image

Also, when I run systeminfo, it tells me: Hyper-V Requirements: A hypervisor has been detected. Features required for Hyper-V will not be displayed.

Microsoft's documentation says that is the expected response for a working nested Hyper-V environment: https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/reference/hyper-v-requirements

@onomatopellan
Copy link

onomatopellan commented Jun 15, 2019

@Aidolii So the host OS is Linux? I think that is an important detail.
Did you try Windows Sandbox feature to see if it works? It could be that QEMU/KVM needs a patch for running WSL2 in nested virtualization inside KVM.

@ghost
Copy link

ghost commented Jun 15, 2019

uh, what? no, the host OS is Windows. I don't know where you got the idea the host OS is Linux.

@onomatopellan
Copy link

onomatopellan commented Jun 15, 2019

Sorry, I was confused because of this: https://stackoverflow.com/questions/51364707/how-does-windows-10-task-manager-detect-a-virtual-machine

In my case I'm running WSL2 inside a Hyper-V VM with Win10 v1903 as host and Task Manager says "Logical processors" and "Virtualization". Which CPU are you running, BTW?

About Windows Sandbox feature, it utilizes a lighweight VM too so if you can run it at least we can discard nested virtualization problems.

@ghost
Copy link

ghost commented Jun 15, 2019

It says virtual processors because it's a Generation 2 VM with NUMA spanning enabled. Either of those two things could be an issue.

I forget what processor it is off the top of my head, I'll have to check when I get home.

@ghost
Copy link

ghost commented Jun 17, 2019

@onomatopellan The host machine is on an i5-6500 (non-K unfortunately). Windows Sandbox is grayed out and says the processor does not have the necessary virtualization capabilities.

Hyper-V Hypervisor does too, interestingly.

@onomatopellan
Copy link

@Aidolii Thanks. Intel CPU shouldn't be an issue with nested virtualization.
I managed to break my install while disabling and enabling windows features so if you can't enable any hyper-v feature anymore it's probably because of a broken install. Only a refresh/clean install fixed it for me.

@ghost
Copy link

ghost commented Jun 25, 2019

@onomatopellan Sorry it took me so long to reply. I was using a modified installation so I wanted to come back with an unmodified install, which took me a while to get around to.

Unfortunately, even with a completely vanilla install of 18917 in a Hyper-V VM, I hit the same roadblocks as before. Bear in mind, Hyper-V Hypervisor is the only Hyper-V Windows feature that is grayed out, Hyper-V Services and Hyper-V Management Tools are still available.

If this is not supposed to happen, please let me know.

@benhillis
Copy link
Member

If the hypervisor feature is greyed out, likely virtualization is disabled in your BIOS.

@ghost
Copy link

ghost commented Jun 25, 2019

If the hypervisor feature is greyed out, likely virtualization is disabled in your BIOS.

It's grayed out within the Hyper-V VM. It's obviously not grayed out on the host machine, given virtualization needs to be enabled to run a Hyper-V VM.

@ghost
Copy link

ghost commented Jun 25, 2019

Ok, I discovered the issue. Nested virtualization is not enabled on new Hyper-V VMs by default because it disables the Dynamic Memory feature for that VM. You have to enable it after the fact with a command on the host machine (make sure the target is powered off):

Set-VMProcessor <VMName> -ExposeVirtualizationExtensions $true

Alternatively, this command will enable it on every existing VM that is currently powered off (does not affect future VMs):

Get-VM | ? State -eq 'Off' | Set-VMProcessor -ExposeVirtualizationExtensions $true

@melophat
Copy link

melophat commented Jul 25, 2019

Ok, I discovered the issue. Nested virtualization is not enabled on new Hyper-V VMs by default because it disables the Dynamic Memory feature for that VM. You have to enable it after the fact with a command on the host machine (make sure the target is powered off):

Set-VMProcessor <VMName> -ExposeVirtualizationExtensions $true

Alternatively, this command will enable it on every existing VM that is currently powered off (does not affect future VMs):

Get-VM | ? State -eq 'Off' | Set-VMProcessor -ExposeVirtualizationExtensions $true

** if this is off-topic, or belongs somewhere else, please let me know and I'll move it. Also, if I read the thread correctly, this is regarding trying to enable WSL2 in a Windows 10 vm running on a linux host, but the errors that I'm seeing are basically the same **

Will running these commands on a Windows 10 host allow other hypervisors (particularly Virtualbox) to run with WSL2 enabled on the host also? I've found that enabling the VirtualMachinePlatform functionality for WSL2 on my host machine (specs below) gives me an error in both VMWare Workstation 12.5.6 and VirtualBox 6.0.8 r130520 (Qt5.6.2) that virtualization is not enabled in the bios even though it is. if i disable VirtualMachinePlatform and reboot, VMWare and VirtualBox both work again. I do not have Hyper-V installed on my machine. I'd love to take advantage of the benefits of WSL2, but for my docker development setup on my work machine, I need to be able to use at least VirtualBox, so this is a killer for me..

Machine Specs:
Dell xps 8900
32GB RAM
i7-8700 quad core with HyperThreading, all Virtualization enabled in the bios, XD Enabled in bios
Windows 10 Enterprise 1903 build 18362.10006
all latest updates for firmware/bios are installed, as are all the latest windows updates. Currently on the Slow Ring of the Windows Insider Program

Thanks!

@ghost
Copy link

ghost commented Jul 30, 2019

this is regarding trying to enable WSL2 in a Windows 10 vm running on a linux host

No, that was someone's incorrect assumption.

Will running these commands on a Windows 10 host allow other hypervisors (particularly Virtualbox) to run with WSL2 enabled on the host also?

Afraid not.

if i disable VirtualMachinePlatform and reboot, VMWare and VirtualBox both work again. I do not have Hyper-V installed on my machine

VMWare and VirtualBox have to publish updates that make themselves compatible, just like they did with Hyper-V. The technology is similar so it shouldn't take much of their time whenever they get around to it.

@1001QAdotNET
Copy link

1001QAdotNET commented Nov 27, 2019

Hi guys

I am having a hard time to make WSL2 work
I am on Win10 Fastring, OS Build 19013.1122
System information is reporting these:
Processor Intel(R) Core(TM)2 Quad CPU Q9400 @ 2.66GHz, 2667 Mhz, 4 Core(s), 4 Logical Processor(s)

Hyper-V - VM Monitor Mode Extensions Yes
Hyper-V - Second Level Address Translation Extensions No
Hyper-V - Virtualization Enabled in Firmware Yes
Hyper-V - Data Execution Protection Yes
Here are my settings:
settings
And here is the famous error, how do I solve this ?
error

@melophat
Copy link

this is regarding trying to enable WSL2 in a Windows 10 vm running on a linux host

No, that was someone's incorrect assumption.

Will running these commands on a Windows 10 host allow other hypervisors (particularly Virtualbox) to run with WSL2 enabled on the host also?

Afraid not.

if i disable VirtualMachinePlatform and reboot, VMWare and VirtualBox both work again. I do not have Hyper-V installed on my machine

VMWare and VirtualBox have to publish updates that make themselves compatible, just like they did with Hyper-V. The technology is similar so it shouldn't take much of their time whenever they get around to it.

Thanks for the clarification, Ghost. Hopefully they'll get these wrinkles ironed out soon.

@transientuser
Copy link

I have a Windows 10 Pro PC (not VM) running build 19041. I had WSL2 working. I am not sure when it broke but it might have been after I got VMWare Workstation working again. Nothing has changed in my BIOS (all virtualization options are on). Now I am seeing the following:

When I try my original ubuntu shell I get.

image

So I tried loading the ubuntu 20.04 just for yucks and see this:

image

Suggestions?

@onomatopellan
Copy link

@transientuser From that Windows Features window untick "Virtual Machine Platform" and restart Windows. Then tick it again and restart Windows.

This is from the May 2020 release notes:

We are aware of an issue where using the DISM (Deployment Image Servicing and Management) tool to repair corruption on systems running the May 2020 Update does not always report the correct status. This will be fixed in an upcoming servicing release.

It looks like Dism never knows when a feature is really enabled so you need to try several times until it works.

@transientuser
Copy link

You really had my hopes up but it did not work. I tried uncheck / reboot / recheck / reboot a couple of times, then tried going through the whole wsl2 install process. Then I tried uninstalling ubuntu / reinstalling. And I also tried installing SUSE.

Same results each time. And now that I have uninstalled ubuntu and reinstalled it and SUSE I see this:

image

@transientuser
Copy link

image

@onomatopellan
Copy link

onomatopellan commented May 21, 2020

If you want to uninstall that Legacy distro you can with wsl.exe --unregister Legacy.

You can also try to enable "Windows Sandbox". If it works at least you will know you have everything needed (containers, virtualization) for running WSL2.

Edit: I just remembered some users had a similar problem and they fixed it configuring Windows Defender. Follow these steps #4626 (comment)

@transientuser
Copy link

Ok. I unistalled everything. Virtual platform, WSL, ubuntu. Rebooted. Followed the install steps, loaded the kernel update, installed ubuntu, bounced lxxsmanager (a couple of times) and it finally worked. So I am good now.

Now if only I could get past windows update hanging at 61% for 2004 on my other computer I would be golden

@FabioCiribeli
Copy link

hi @benhillis.

I'd like to share the same thing, but in my case I am using Windows Virtual Machine by VMware and I tried to use WSL with ubuntu and the error code 0x80370102 happened even doing all steps for WSL installation. Then It works when I have Enabled Virtualization in the VM Ware settings

VM-setting

Thanks.

@mvanotti
Copy link

mvanotti commented Apr 1, 2021

I have this same problem, but so far I had no luck figuring out how to fix it.

in msinfo, I get:

OS Name Microsoft Windows 10 Home
Version 10.0.19042 Build 19042
System Manufacturer Microsoft Corporation
System Model Surface 3
System Type x64-based PC
System SKU Surface_3
Processor Intel(R) Atom(TM) x7-Z8700 CPU @ 1.60GHz, 1601 Mhz, 4 Core(s), 4 Logical Processor(s)
BIOS Version/Date American Megatrends Inc. 1.51116.238, 3/9/2015
SMBIOS Version 2.8
Embedded Controller Version 255.255
BIOS ode UEFI
Installed Physical Memory (RAM) 4.00 GB
Hyper-V - VM Monitor Mode Extensions Yes
Hyper-V - Second Level Address Translation Extensions Yes
Hyper-V - Virtualization Enabled in Firmware Yes
Hyper-V - Data Execution Protection Yes

Note that VirtualBox and VmWare Player seem to work without issues.
I tried using Windows 10 Pro, but had the same issue.

I opened WinDBG and looked at the IA32_FEATURE_CONTROL MSR (0x3A) and it reports value 0x5 (Locked + VMX Enabled)


Edit: Forgot to mention the things I tried:

I did the bcdedit /set hypervisorlaunchtype auto, but that didn't work. I also removed and added both WSL and VirtualMachinePlatform from windows features (altogether and each one separatedly).

@mvanotti
Copy link

mvanotti commented Apr 1, 2021

I went ahead and installed Windows Pro + Hyper-V, launching Hyper-V VMs would fail saying that the hypervisor is not running, even though the services were running.

Looking at the event log, I found the following message:

Hyper-V launch failed; the Hyper-V boot loader was unable to allocate sufficient resources to perform the launch.

It seems like 4GiB of ram might not be enough to run Hyper-V (maybe it is because some of the ram goes to the onboard video card memory?)

@Davidxdh0
Copy link

Davidxdh0 commented Apr 14, 2021

Found a solution. @mvanotti
Found this https://blog.johannfenech.com/fix-wslregisterdistribution-failed-with-error-0x80370102/
Had to change my WSL setting to 1 instead of 2.
Didn't change the bios setting yet, might do it in the future.

@VadneyK
Copy link

VadneyK commented Jun 3, 2021

@Davidxdh0 your link seems to be hyper linked to
https://github.com/microsoft/WSL/issues/url
for some reason as I am taken there when I click the link. copy pasting the link into the browser seems to works tho. However your link fix doesn't work for users who have Legacy BIOS instead of UEFI BIOS meaning the BIOS is uneditable ;(

Hello I am trying to install WSL2 on Ubuntu 20.04. my BIOS is Legacy. Does this actually mean I cannot change the virtualization settings as stated here?

I ran through all of the steps in many official documentations but I cant turn Virtualization on:
Capture

More settings info:
Capture

systeminfo32 tells me I have legacy:
Capture

off topic but I'm using this old windows bc my new mac M1 isnt compatible with a bunch of things I need to code but even this backup is having issues and I am big sad ;{

@VadneyK
Copy link

VadneyK commented Jun 3, 2021

temporary fix: use ws1 instead of ws2:
wsl --set-default-version 1
then just run the ubuntu from the startup

@Mtdominic
Copy link

If you're using HyperV, shutdown the VM and use this script in PowerShell:

set-vmprocessor nameofyourvm -ExposeVirtualizationExtensions $true

Next, disable dynamic RAM (HyperV) and start the VM.

@AdityaBiswas321
Copy link

I was able to fix it by enabling virtualization in the bios, and enabling Hyper V after, if virtualization is not enabled in the bios the dropdown in Hyper V will have a greyed-out option.

@jzcusst
Copy link

jzcusst commented Jul 19, 2021

temporary fix: use ws1 instead of ws2:
wsl --set-default-version 1
then just run the ubuntu from the startup

good solutions ,it works.

@rediffusion
Copy link

VadneyK

You're a life saver!

@Amondale
Copy link

WSLg will it run inside a VM running Beta Windows 11??

@rin67630
Copy link

rin67630 commented Aug 11, 2021

I had tested pretty much everything: Virtualization was enabled in the Bios but did not show up in the task manager.
Intel VT-d was enabled too.
Finally disabling Intel TXT in the bios solved the issue: Virtualization showed up an everything came like is should.

@xmh0511
Copy link

xmh0511 commented Aug 25, 2021

This tutorial works for me.

@sesm
Copy link

sesm commented Aug 26, 2021

In my case I didn't have vritualization enabled in BIOS. After I enabled it the error went away.

@aslisubhash
Copy link

When I tryed to install current version Ubuntu it's faild with

WslRegisterDistribution failed with error: 0x80370102

solution that helped me:

  1. wsl --set-default-version 2 command actually doesn't work for me
  2. that's why I have set default wsl version to 1 wsl --set-default-version 1
  3. after that I could install Ubuntu without any error
    Image 1
  4. then set wsl 2 manually for current Ubuntu wsl --set-version Ubuntu 2
    Image 3
  5. Done.

All thanks to the author of this post

Thanks

@AIWintermuteAI
Copy link

On Surface 3, Windows 10 Home, 21H1, 19043.1237.
After trying

  • cdedit /set hypervisorlaunchtype auto
  • turning off and on Virtual Machine Platform, Windows Hypervisor Platform, Windows Subsystem for Linux in Turn Windows features on and off
  • starting Virtual Machine in Oracle VirtualBox, I have Virtualization enabled
    image

I can install Ubuntu version 1, but when I try to convert it to 2 with wsl --set-version Ubuntu 2 I get conversion error. Installing it directly with wsl --set-default-version 2 gives me the above error 0x80370102.

@jackchammons any hope of running wsl 2 for this case or at least understanding which feature is missing?

@funkel1989
Copy link

sorry for reviving this issue here, but figured i'd post since its still open. I'm having the exact same error described here. I'm on windows 11 21H2 OS build 22000.527. I've tried everything listed in this issue since its creation except doing a clean install yet the issue persists. I've validated my hardware supports this and can run hyper v vms and vm's with other systems.

Has anyone encountered this on windows 11 and know if the solution to make it work is any different. wsl1 does work but i'm stubborn and want wsl 2

@comiker91
Copy link

I fixed this problem with the 21H2 Update for win 10 (10.0.19044.1586)

Maybe it help somebody else

@dancebunny98
Copy link

wsl --set-default-version 1 - fix my problem

win 10 x64 21h2 19044.1706
xeon 2678 v3

@Saeeed-B
Copy link

wsl --set-default-version 1 - fix my problem

win 10 x64 21h2 19044.1706 xeon 2678 v3

also for me

@JamesGalt69
Copy link

wsl --set-default-version 1 - fix my problem

win 10 x64 21h2 19044.1706 xeon 2678 v3

Fixed the issue for me - and really quick too! Hours of frustration solved by a single line of code. Love it.

@aurorapar
Copy link

Can enabling NX please be added to documentation? This would severely reduce the amount of time trying to solve the issue of not being able to install a distro on WSL.

@s-taylor
Copy link

s-taylor commented Jan 6, 2023

I only mentioned it because I already tried. I made sure to run the Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform command of course. It gave me the error listed above when I attempted to initialize Debian, 80370102.

Thankyou, this fixed it for me.

@JOduMonT
Copy link

JOduMonT commented Mar 6, 2024

Today, while I reinstated Windows 11, I ran into that issue, which was ode because it was working right before.

With only Windows Subsystem for Linux features activated, no need Hyper-V...

I resolved it by doing an update: wsl --update

@Naties29
Copy link

wsl --set-default-version 1

Thank you so much! This solved my issue as well. I was stuck on this for a while on this one! Thank you again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wsl2 Issue/feature applies to WSL 2
Projects
None yet
Development

No branches or pull requests