WSL icon indicating copy to clipboard operation
WSL copied to clipboard

WSL2 not starting despite Hyper-V and virtualization being enabled

Open WalshyDev opened this issue 5 years ago • 67 comments

Background: I used to run WSL1 & WSL2 perfectly fine, I had to disable Hyper-V along with WSL a little bit ago. Ever since I disabled them in the past I haven't been able to enable everything properly again. Hyper-V features on enabled and services running, Virtualization is enabled in BIOS but yet... I cannot start WSL.

No hardware changes or anything else significant between the last time it worked and now.

Please fill out the below information:

  • Microsoft Windows [Version 10.0.19025.1051]

  • What you're doing and what's happening:

C:\WINDOWS\system32>wsl
Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS.
For information please visit https://aka.ms/wsl2-install
  • What's wrong / what should be happening instead: It should just go into my WSL2 VM, it is instead just spitting out: Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS.

wsl -l -v output:

C:\Users\Walshy\wsl-report>wsl -l -v
  NAME      STATE           VERSION
* Ubuntu    Stopped         2
  Debian    Stopped         1
Images of features, services and virtualization in task manager

Features: Image of Windows features

Services: Image of services

Task Manager showing Virtualization enabled: Task Manager showing Virtualization enabled

  • Strace of the failing command, if applicable:
C:\Users\Walshy\wsl-report>strace wsl -d Ubuntu
--- Process 12808 created
--- Process 12808 loaded C:\Windows\System32\ntdll.dll at 00007ffa89ab0000
--- Process 12808 loaded C:\Windows\System32\kernel32.dll at 00007ffa88b80000
--- Process 12808 loaded C:\Windows\System32\KernelBase.dll at 00007ffa87610000
--- Process 12808 loaded C:\Windows\System32\ucrtbase.dll at 00007ffa878e0000
--- Process 12808 thread 14612 created
--- Process 12808 loaded C:\Windows\System32\SHCore.dll at 00007ffa88cc0000
--- Process 12808 loaded C:\Windows\System32\msvcrt.dll at 00007ffa88d80000
--- Process 12808 loaded C:\Windows\System32\combase.dll at 00007ffa87b30000
--- Process 12808 loaded C:\Windows\System32\rpcrt4.dll at 00007ffa88330000
--- Process 12808 thread 13688 created
--- Process 12808 loaded C:\Windows\System32\ws2_32.dll at 00007ffa89840000
--- Process 12808 loaded C:\Windows\System32\kernel.appcore.dll at 00007ffa85b40000
--- Process 12808 loaded C:\Windows\System32\bcryptprimitives.dll at 00007ffa87380000
--- Process 12808 loaded C:\Windows\System32\sechost.dll at 00007ffa899d0000
--- Process 12808 loaded C:\Windows\System32\clbcatq.dll at 00007ffa89550000
--- Process 12808 thread 4416 created
--- Process 12808 thread 4616 created
--- Process 12808 thread 17776 created
--- Process 12808 loaded C:\Windows\System32\lxss\LxssManagerProxyStub.dll at 00007ffa7a100000
--- Process 12808, exception e06d7363 at 00007ffa87645a29
--- Process 12808 unloaded DLL at 00007ffa7a100000
--- Process 12808, exception e06d7363 at 00007ffa87645a29
Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS.
For information please visit https://aka.ms/wsl2-install
--- Process 12808 thread 14612 exited with status 0xffffffff
--- Process 12808 thread 13688 exited with status 0xffffffff
--- Process 12808 thread 4416 exited with status 0xffffffff
--- Process 12808 thread 4616 exited with status 0xffffffff
--- Process 12808 thread 17776 exited with status 0xffffffff
--- Process 12808 exited with status 0xffffffff
  • I have attached the logman details (Started before running wsl and stopped after it failed): wsl-report.zip

WalshyDev avatar Feb 26 '20 00:02 WalshyDev

Just to be sure, you do have the feature "Virtual Machine Platform" enabled, as in this picture?

image

ghost avatar Feb 26 '20 15:02 ghost

Did you try bcdedit /set hypervisorlaunchtype auto

I disabled hyper-v with bcdedit /set hypervisorlaunchtype off to do some work in VMWare, and ebabled it with auto successfully back again.

ad-on-is avatar Feb 26 '20 15:02 ad-on-is

@DropNib Yep, check the summary under wsl -l -v output and above the strace output.

@ad-on-is Yep, already tried with no success.

Windows Boot Manager
--------------------
identifier              {bootmgr}
device                  partition=\Device\HarddiskVolume5
path                    \EFI\Microsoft\Boot\bootmgfw.efi
description             Windows Boot Manager
locale                  en-GB
inherit                 {globalsettings}
flightsigning           Yes
default                 {current}
resumeobject            {fa62a036-d7e2-11e9-8624-8aedbab3624a}
displayorder            {current}
toolsdisplayorder       {memdiag}
timeout                 0

Windows Boot Loader
-------------------
identifier              {current}
device                  partition=C:
path                    \WINDOWS\system32\winload.efi
description             Windows 10
locale                  en-GB
inherit                 {bootloadersettings}
recoverysequence        {3f7b4696-0c00-11ea-b600-ebdd96078e40}
displaymessageoverride  Recovery
recoveryenabled         Yes
isolatedcontext         Yes
flightsigning           Yes
allowedinmemorysettings 0x15000075
osdevice                partition=C:
systemroot              \WINDOWS
resumeobject            {fa62a036-d7e2-11e9-8624-8aedbab3624a}
nx                      OptIn
bootmenupolicy          Standard
hypervisorlaunchtype    Auto

WalshyDev avatar Feb 26 '20 15:02 WalshyDev

Stupid question, but, did you reboot Windows after enabling everything? 😅

ad-on-is avatar Feb 26 '20 15:02 ad-on-is

@ad-on-is Oh yes. There's been many many reboots during the process of trying to fix this over the last month. Even rebooted since last night when I posted this but yeah... nothing :/

WalshyDev avatar Feb 26 '20 16:02 WalshyDev

I was having this same problem. I disabled AMD SVM, booted, then re-enabled AMD SVM and it worked again. Hope this helps

Gareth001 avatar Apr 19 '20 01:04 Gareth001

I got the same problem,now I can only use wsl1.

Hambugers avatar Apr 23 '20 13:04 Hambugers

First of all, if you are in Windows 10 Pro try to run an hyper-v VM or launch Windows Sandbox. If those don't work either then the problem is in hyper-v.

onomatopellan avatar Apr 23 '20 18:04 onomatopellan

Did you try bcdedit /set hypervisorlaunchtype auto

I disabled hyper-v with bcdedit /set hypervisorlaunchtype off to do some work in VMWare, and ebabled it with auto successfully back again.

So, It is not possible to use VM and WSL2 at same time?

singhdharmveer311 avatar Jun 03 '20 23:06 singhdharmveer311

@moriarity9211 - VMware Workstation 15.5 supports it.

https://blogs.vmware.com/workstation/2020/05/vmware-workstation-now-supports-hyper-v-mode.html

benhillis avatar Jun 04 '20 00:06 benhillis

@benhillis How it's going to help on original issue, did anyone solved this original issue in Win 10 home edition successfully? Can you please elaborate valid steps? Thanks in advance!

ravesonly avatar Jun 09 '20 06:06 ravesonly

Did you try bcdedit /set hypervisorlaunchtype auto

I disabled hyper-v with bcdedit /set hypervisorlaunchtype off to do some work in VMWare, and ebabled it with auto successfully back again.

Mine was working fine till I started up an Android Studio Emulator last week. Since then I've been fighting to try and get wsl2 working again. BIOS was good, features were turned on, but no dice.

Finally tried the command above with a reboot and it worked!

soccerdude288 avatar Jun 09 '20 14:06 soccerdude288

It works for me after update. I tried both bcdebit /set hypervisorlaunchtype auto & off it works but i have to restart my pc every time to update setting. After update it is working fine.

singhdharmveer311 avatar Jun 09 '20 15:06 singhdharmveer311

VMWare Workstation 15.5.5 Pro supports using the Microsoft Hypervisor Platform APIS. You will need to be running that version or later.

WSL2 requires the "Virtual Machine Platform" optional component which is available on all SKUs.

benhillis avatar Jun 09 '20 16:06 benhillis

This fixed it for me https://blog.johannfenech.com/fix-wslregisterdistribution-failed-with-error-0x80370102/

It took me days and two formats to figure out !

johannfenech avatar Jun 27 '20 15:06 johannfenech

Did you try bcdedit /set hypervisorlaunchtype auto I disabled hyper-v with bcdedit /set hypervisorlaunchtype off to do some work in VMWare, and ebabled it with auto successfully back again.

Mine was working fine till I started up an Android Studio Emulator last week. Since then I've been fighting to try and get wsl2 working again. BIOS was good, features were turned on, but no dice.

Finally tried the command above with a reboot and it worked!

Yes, it work for wsl, but doesn't good for VirtualBox.

WSL : bcdedit /set hypervisorlaunchtype auto + RESTART VirtualBox: bcdedit /set hypervisorlaunchtype off + RESTART

kubichris avatar Jul 17 '20 08:07 kubichris

Did you try bcdedit /set hypervisorlaunchtype auto

I disabled hyper-v with bcdedit /set hypervisorlaunchtype off to do some work in VMWare, and ebabled it with auto successfully back again.

Mine worked after this command

wsl doesn't work with other software using virtualization I installed Andy Android Emulator and then this error code '0x80370102' appeared maybe some VMs changes the windows features and wsl don't work after that

parikshit90900 avatar Jul 22 '20 08:07 parikshit90900

Did you try bcdedit /set hypervisorlaunchtype auto

I disabled hyper-v with bcdedit /set hypervisorlaunchtype off to do some work in VMWare, and ebabled it with auto successfully back again.

I was having the same problem, this worked great, thanks a lot !

ZayenJS avatar Dec 13 '20 12:12 ZayenJS

@WalshyDev, at 2:58 in, this YouTuber says to not enable Windows Hypervisor Platform when adding WSL2. He doesn't say why, though.

mrivard avatar Dec 13 '20 15:12 mrivard

Did you try bcdedit /set hypervisorlaunchtype auto I disabled hyper-v with bcdedit /set hypervisorlaunchtype off to do some work in VMWare, and ebabled it with auto successfully back again.

So, It is not possible to use VM and WSL2 at same time?

I quote this question. Is any way to have both WSL2 and VM ?

feland207 avatar May 03 '21 19:05 feland207

Did you try bcdedit /set hypervisorlaunchtype auto I disabled hyper-v with bcdedit /set hypervisorlaunchtype off to do some work in VMWare, and ebabled it with auto successfully back again.

So, It is not possible to use VM and WSL2 at same time?

I quote this question. Is any way to have both WSL2 and VM ?

I quote this reply as well, I want to have both WSL and VM working, is this possible? Thanks to all community for helping out!

yiqiangjizhang avatar May 16 '21 21:05 yiqiangjizhang

Did you try bcdedit /set hypervisorlaunchtype auto

I disabled hyper-v with bcdedit /set hypervisorlaunchtype off to do some work in VMWare, and ebabled it with auto successfully back again.

It really works if you ever tried android emulator.

zhangxj19 avatar Jun 04 '21 16:06 zhangxj19

Did you try bcdedit /set hypervisorlaunchtype auto I disabled hyper-v with bcdedit /set hypervisorlaunchtype off to do some work in VMWare, and ebabled it with auto successfully back again. It really works if you ever tried android emulator.

Yeah it worked finally!

I used:

Activate VirtualBox (Disable Hyper-V):
bcdedit /set hypervisorlaunchtype off

Activate WSL (Enable Hyper-V):
bcdedit /set hypervisorlaunchtype auto

to enable and disable Hyper V so I can run WSL or VM. However, the PC needs restart

yiqiangjizhang avatar Jun 05 '21 06:06 yiqiangjizhang

I have Hyper-V, Virtual Machine Platform and all the required features enabled, but this still doesn't work for me even after setting the bcd entry to auto.

Soromeister avatar Aug 19 '21 11:08 Soromeister

bcdedit /set hypervisorlaunchtype auto

oops i did something similar. Thanks It worked.

geekyshubham avatar Sep 07 '21 10:09 geekyshubham

I had a similar issue after an upgrade on the dev channel to Windows 10.0.22000 (Windows 11) Pro. Having the Windows features Windows Subsystem for Linux and Virtual Machine Platform checked and Hyper-V unchecked allowed me to run VirtualBox and WSL2 at the same time. I also needed to bcdedit /set hypervisorlaunchtype auto as this was set to off during the upgrade likely causing my issue.

Kenttleton avatar Oct 29 '21 03:10 Kenttleton

I have the same issue, I have all the required features enabled (with the virtualization enabled in the BIOS). I don't have any emulator like the Android simulator, VMware, VirtualBox or anything like that. I tried everything but nothing solves this issue. image

ElCosmoXD avatar Dec 20 '21 00:12 ElCosmoXD

Had no problem last week. But this is now happening to me. I didn't touch anything about the VirtualMachinePlatform. I didn't touch any BIOS settings. I'm relying on WSL2 for my work and now suddenly not working

I tried:

  • reinstall WSL via Turn on/off features
  • run dism thingy to disable and enable WSL2 and Virtual Machine Platform
  • disable + re-enable the VT-d and Intel Vietualization Technology
  • run bcedit thingy to auto, and off as well
  • enable / disable hypervisor
  • uninstall docker desktop
  • uninstall windows subsystem for android
  • reset network adapters
  • reset winsock
  • restart the computer many times
  • check windows event viewer: no error related to wsl
  • subscribe to beta channel

Nothing worked for me.

husniadil avatar Dec 26 '21 05:12 husniadil

Had no problem last week. But this is now happening to me. I didn't touch anything about the VirtualMachinePlatform. I didn't touch any BIOS settings. I'm relying on WSL2 for my work and now suddenly not working

I tried:

  • reinstall WSL via Turn on/off features
  • run dism thingy to disable and enable WSL2 and Virtual Machine Platform
  • disable + re-enable the VT-d and Intel Vietualization Technology
  • run bcedit thingy to auto, and off as well
  • enable / disable hypervisor
  • uninstall docker desktop
  • uninstall windows subsystem for android
  • reset network adapters
  • reset winsock
  • restart the computer many times
  • check windows event viewer: no error related to wsl
  • subscribe to beta channel

Nothing worked for me.

Same thing as you.

fellipec avatar Dec 27 '21 18:12 fellipec

I ended up re-installing Windows and tried to reinstall all programs one by one that were previously installed in my system. Took several hours for me (re-installed Windows multiple times) until I figured out which program did ruin the WSL.

Turned out that the culprit was spacedesk. So, my solution was to not install spacedesk after re-installing Windows.

husniadil avatar Dec 28 '21 01:12 husniadil