microsoft / WSL

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

WSL2 not starting despite Hyper-V and virtualization being enabled #4930

Open WalshyDev opened 4 years ago

WalshyDev commented 4 years ago

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:

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](https://blobs.are-pretty.sexy/9dAiVLg.png) Services: ![Image of services](https://blobs.are-pretty.sexy/88iyzya.png) Task Manager showing Virtualization enabled: ![Task Manager showing Virtualization enabled](https://blobs.are-pretty.sexy/TnAQdJQ.png)
ghost commented 4 years ago

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

image
ad-on-is commented 4 years ago

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.

WalshyDev commented 4 years ago

@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
ad-on-is commented 4 years ago

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

WalshyDev commented 4 years ago

@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 :/

Gareth001 commented 4 years ago

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

Hambugers commented 4 years ago

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

onomatopellan commented 4 years ago

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.

singhdharmveer311 commented 4 years ago

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?

benhillis commented 4 years ago

@moriarity9211 - VMware Workstation 15.5 supports it.

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

ravesonly commented 4 years ago

@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!

soccerdude288 commented 4 years ago

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!

singhdharmveer311 commented 4 years ago

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.

benhillis commented 4 years ago

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.

johannfenech commented 4 years ago

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 !

kubichris commented 4 years ago

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

parikshit90900 commented 4 years ago

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

ZayenJS commented 3 years ago

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 !

mrivard commented 3 years ago

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

feland207 commented 3 years ago

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 ?

yiqiangjizhang commented 3 years ago

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!

zhangxj19 commented 3 years ago

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.

yiqiangjizhang commented 3 years ago

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

Soromeister commented 3 years ago

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.

geekyshubham commented 3 years ago

bcdedit /set hypervisorlaunchtype auto

oops i did something similar. Thanks It worked.

Kenttleton commented 2 years ago

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.

ElCosmoXD commented 2 years ago

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

husniadil commented 2 years ago

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:

Nothing worked for me.

fellipec commented 2 years ago

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.

husniadil commented 2 years ago

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.

fellipec commented 2 years ago

I got so frustrated today that I did the same. I'm in the process of reinstall the things. But before I choose to format the PC, , I was suspecting spacedesk too, but I just disabled it, and did not restart too, and dismissed because it worked before.

I'll not install that again.

ElCosmoXD commented 2 years ago

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.

I also installed spacedesk before the error but at the same time I uninstalled it and I installed Duet Display so I don't know which program was the culprit.

digitalcora commented 2 years ago

I'm also having this issue seemingly as a result of installing Spacedesk. Trying to start, export, or change the version of an existing WSL2 distro gives the "Please enable the Virtual Machine Platform Windows feature" error message. I've tried every fix suggested here and in this thread but with no success. Thankfully WSL1 still works, after I reinstalled the distro.

Martin-SF commented 2 years ago

Finally it fixed it for me by doing an update installation "keep my personal files and programs" through the MediaCreationTool. Wsl (and Windows sandbox) is finally working again.

One tip for anyone wondering about the output of the Intel® Processor Identification Utility. It still shows for me an X (for not enabled) for Intel Virtualisation Technology and EPT/SLAT support. But my wsl2 and Windows sandbox is working fine. (i5-10600k)

daniel-iroka commented 2 years ago

I got so frustrated today that I did the same. I'm in the process of reinstall the things. But before I choose to format the PC, , I was suspecting spacedesk too, but I just disabled it, and did not restart too, and dismissed because it worked before.

I'll not install that again.

Wow! Yes! I also had this issue after installing spacedesk! But even after deleting spacedesk it still didn't work. Please what else can I do apart from reinstalling windows?? Or will reinstalling wsl2 help? or maybe updating windows??

daniel-iroka commented 2 years ago

I got so frustrated today that I did the same. I'm in the process of reinstall the things. But before I choose to format the PC, , I was suspecting spacedesk too, but I just disabled it, and did not restart too, and dismissed because it worked before.

I'll not install that again.

wait, when you said you "disabled spacedesk", did you mean you uninstalled it and did not restart because I uninstalled it and restarted my pc but it is still not working.

Martin-SF commented 2 years ago

I got so frustrated today that I did the same. I'm in the process of reinstall the things. But before I choose to format the PC, , I was suspecting spacedesk too, but I just disabled it, and did not restart too, and dismissed because it worked before. I'll not install that again.

wait, when you said you "disabled spacedesk", did you mean you uninstalled it and did not restart because I uninstalled it and restarted my pc but it is still not working.

I read that about Spacedesk just now. I updated it recently beside a bunch of other programs, then wsl2 stopped working. I uninstalled it aswell but it didnt fixed it for me. I guess thats an important clue, Spacedesk is intefering with WSL / virtualisation on Windows.

@daniel-iroka I would suggest you the update installation with "Keep my personal files" settings with the MediaCreationTool. It reinstalled windows and after 30 min my previously set up ubuntu distro ran again....

fellipec commented 2 years ago

I got so frustrated today that I did the same. I'm in the process of reinstall the things. But before I choose to format the PC, , I was suspecting spacedesk too, but I just disabled it, and did not restart too, and dismissed because it worked before. I'll not install that again.

wait, when you said you "disabled spacedesk", did you mean you uninstalled it and did not restart because I uninstalled it and restarted my pc but it is still not working.

No, I just disabled the driver in the main window. I have no screenshots and I'll not install it again to do one, sorry. If you fully uninstalled, reboot and sfc /scannow it don't fix the issue, MAYBE it have a rootkit-like behavior of some sorts. As far as I know what we have in common here is having installed Spacedesk before our WSL2/Hypervisor gone corrupted. Also, I couldn't use VMWare too before formatting my machine.

daniel-iroka commented 2 years ago

I got so frustrated today that I did the same. I'm in the process of reinstall the things. But before I choose to format the PC, , I was suspecting spacedesk too, but I just disabled it, and did not restart too, and dismissed because it worked before. I'll not install that again.

wait, when you said you "disabled spacedesk", did you mean you uninstalled it and did not restart because I uninstalled it and restarted my pc but it is still not working.

I read that about spacedesk just now. i updated it recently and then wsl2 stopped working. I updated like 10 programs in the same time so I didnt really suspeted that spacedesk maybe have something to do with wsl failing. But I guess thats an important clue, spacedesk is intefering with wsl / virtualisation on windows.

@daniel-iroka I would suggest you the update installation with the MediaCreationTool. It reinstalled windows and after 30 min my ubuntu distro ran again.... iam so happy, but also sad about 2 days of lost time, because of such an ackward bug

I have few more questions please. What about the normal settings update as well? Will that also work and will I also loose data if i update through the media tool?? Also, how will I know what media tool link to follow can you help me with a link please. My OS buid is 19043

husniadil commented 2 years ago

Re-installing Windows with "Keep my personal files" settings worked for me.

I you uninstall spacedesk using spacedesk installer before re-installing Windows, the driver will not be brought back to your new Windows installation.

But if you don't uninstall spacedesk, Windows will still bring spacedesk over your new Windows installation, BUT somehow they work together (WSL and spacedesk), then again don't use the spacedesk installer to install it again.

daniel-iroka commented 2 years ago

Re-installing Windows with "Keep my personal files" settings worked for me.

I you uninstall spacedesk using spacedesk installer before re-installing Windows, the driver will not be brought back to your new Windows installation.

But if you don't uninstall spacedesk, Windows will still bring spacedesk over your new Windows installation, BUT somehow they work together (WSL and spacedesk), then again don't use the spacedesk installer to install it again.

Okay. Thank you

yangmeishu commented 2 years ago

Finally it fixed it for me by doing an update installation "keep my personal files and programs" through the MediaCreationTool. Wsl (and Windows sandbox) is finally working again.

One tip for anyone wondering about the output of the Intel® Processor Identification Utility. It still shows for me an X (for not enabled) for Intel Virtualisation Technology and EPT/SLAT support. But my wsl2 and Windows sandbox is working fine. (i5-10600k)

This problem bothers me too much time and energy. Before I saw this post, I had no reason to connect the two software wsl and spacedesk. Similarly, I also installed spacedesk on my computer, and it was updated recently. Finally see your operation. The problem is solved

daniel-iroka commented 2 years ago

Finally it fixed it for me by doing an update installation "keep my personal files and programs" through the MediaCreationTool. Wsl (and Windows sandbox) is finally working again. One tip for anyone wondering about the output of the Intel® Processor Identification Utility. It still shows for me an X (for not enabled) for Intel Virtualisation Technology and EPT/SLAT support. But my wsl2 and Windows sandbox is working fine. (i5-10600k)

This problem bothers me too much time and energy. Before I saw this post, I had no reason to connect the two software wsl and spacedesk. Similarly, I also installed spacedesk on my computer, and it was updated recently. Finally see your operation. The problem is solved

wait, so you mean that spacedesk is now working well with wsl??

yangmeishu commented 2 years ago

No, if spacedesk is installed, wsl cannot be started. It can be repaired according to your method. After reinstalling the system, wsl and spacedesk coexist

daniel-iroka commented 2 years ago

No, if spacedesk is installed, wsl cannot be started. It can be repaired according to your method. After reinstalling the system, wsl and spacedesk coexist

Oh that's nice. I uninstalled spacedesk though because I was told wsl won't still work if I reinstall it with windows

yangmeishu commented 2 years ago

l

Without uninstalling spacedesk, after reinstalling windows, it can be used normally. But I think it would be better to use a lower version of spacedesk

grzegorztomasiak commented 2 years ago

+1 I am also looking for a solution. After installing spacedesk, wsl stopped working and re-enabling it does not do anything.

Nachtalb commented 2 years ago

There is a thread open over at the spacedesk forum referencing this thread here so for cross reference sake: https://www.spacedesk.net/de/forums/topic/wsl2-not-starting-after-spacedesk-installation/

If any of you have more information about this that could help the spacedesk guys, please tell them :)

DamienGdn commented 2 years ago

I found this. Wsl is not started because Hyper V service is not started and I can't started manually this. I Try to install an old version but Wsl don't start.

Lyndonpett commented 2 years ago

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

The software school I go to was troubleshooting a student's issue with virtualization saying it was disabled when trying to run Ubuntu on WSL and would fail saying virtualization was not enabled, even though it was showing in task manager and other ways we verified it was enabled. When we ran bcdedit we found that hypervisionlaunchtype was set to off by default. We solved the issue by setting it to auto and restarting. This is the answer!