microsoft / WSL

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

Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS. #5363

Open liudonghua123 opened 4 years ago

liudonghua123 commented 4 years ago

Environment

C:\Users\Liu.D.H>ver

Microsoft Windows [Version 10.0.19041.264]

C:\Users\Liu.D.H>bcdedit

Windows Boot Manager
--------------------
identifier              {bootmgr}
device                  partition=\Device\HarddiskVolume1
description             Windows Boot Manager
locale                  en-US
inherit                 {globalsettings}
default                 {current}
resumeobject            {8c132511-806f-11e9-8860-f798d1b7a8f1}
displayorder            {current}
                        {89f269f4-cc9f-11e6-8727-64006a16df31}
                        {8c132516-806f-11e9-8860-f798d1b7a8f1}
toolsdisplayorder       {memdiag}
timeout                 5

Windows Boot Loader
-------------------
identifier              {current}
device                  partition=C:
path                    \WINDOWS\system32\winload.exe
description             Windows 10
locale                  en-US
inherit                 {bootloadersettings}
recoverysequence        {8c132514-806f-11e9-8860-f798d1b7a8f1}
displaymessageoverride  Recovery
recoveryenabled         Yes
allowedinmemorysettings 0x15000075
osdevice                partition=C:
systemroot              \WINDOWS
resumeobject            {8c132511-806f-11e9-8860-f798d1b7a8f1}
nx                      OptIn
bootmenupolicy          Legacy
hypervisorlaunchtype    Off

Windows Boot Loader
-------------------
identifier              {89f269f4-cc9f-11e6-8727-64006a16df31}
device                  partition=\Device\HarddiskVolume1
path                    \Windows\system32\winload.exe
description             Windows 7
locale                  zh-CN
inherit                 {bootloadersettings}
osdevice                partition=\Device\HarddiskVolume1
systemroot              \Windows
resumeobject            {89f269f3-cc9f-11e6-8727-64006a16df31}
nx                      OptIn
detecthal               Yes

Windows Boot Loader
-------------------
identifier              {8c132516-806f-11e9-8860-f798d1b7a8f1}
device                  partition=C:
path                    \WINDOWS\system32\winload.exe
description             Windows10 with Hyper-V
locale                  en-US
inherit                 {bootloadersettings}
recoverysequence        {8c132514-806f-11e9-8860-f798d1b7a8f1}
displaymessageoverride  Recovery
recoveryenabled         Yes
allowedinmemorysettings 0x15000075
osdevice                partition=C:
systemroot              \WINDOWS
resumeobject            {8c132511-806f-11e9-8860-f798d1b7a8f1}
nx                      OptIn
bootmenupolicy          Legacy
hypervisorlaunchtype    Auto

C:\Users\Liu.D.H>systeminfo

Host Name:                 DESKTOP-LDH
OS Name:                   Microsoft Windows 10 Education
OS Version:                10.0.19041 N/A Build 19041
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Standalone Workstation
OS Build Type:             Multiprocessor Free
Registered Owner:          Windows User
Registered Organization:
Product ID:                00328-10000-00001-AA635
Original Install Date:     2020-05-11, 22:13:14
System Boot Time:          2020-06-08, 10:12:11
System Manufacturer:       Dell Inc.
System Model:              Vostro 3900
System Type:               x64-based PC
Processor(s):              1 Processor(s) Installed.
                           [01]: Intel64 Family 6 Model 60 Stepping 3 GenuineIntel ~3601 Mhz
BIOS Version:              Dell Inc. A10, 2015-07-30
Windows Directory:         C:\WINDOWS
System Directory:          C:\WINDOWS\system32
Boot Device:               \Device\HarddiskVolume1
System Locale:             zh-cn;Chinese (China)
Input Locale:              zh-cn;Chinese (China)
Time Zone:                 (UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi
Total Physical Memory:     16,301 MB
Available Physical Memory: 9,703 MB
Virtual Memory: Max Size:  33,709 MB
Virtual Memory: Available: 26,300 MB
Virtual Memory: In Use:    7,409 MB
Page File Location(s):     C:\pagefile.sys
Domain:                    WORKGROUP
Logon Server:              \\DESKTOP-LDH
Hotfix(s):                 6 Hotfix(s) Installed.
                           [01]: KB4552925
                           [02]: KB4534170
                           [03]: KB4537759
                           [04]: KB4545706
                           [05]: KB4557968
                           [06]: KB4556803
Network Card(s):           4 NIC(s) Installed.
                           [01]: TAP-Windows Adapter V9
                                 Connection Name: 以太网
                                 Status:          Media disconnected
                           [02]: Realtek PCIe GBE Family Controller
                                 Connection Name: Ethernet_Realtek
                                 DHCP Enabled:    Yes
                                 DHCP Server:     113.55.112.1
                                 IP address(es)
                                 [01]: 113.55.127.140
                                 [02]: fe80::3d0a:ecde:2178:d77c
                                 [03]: 2001:250:2800:cc09:6600:6aff:fe16:df31
                           [03]: Realtek RTL8188CU Wireless LAN 802.11n USB 2.0 Network Adapter
                                 Connection Name: Wi-Fi 2
                                 Status:          Media disconnected
                           [04]: Microsoft KM-TEST Loopback Adapter
                                 Connection Name: Npcap Loopback Adapter
                                 DHCP Enabled:    Yes
                                 DHCP Server:     255.255.255.255
                                 IP address(es)
                                 [01]: 169.254.104.11
                                 [02]: fe80::d8bf:11ab:7b05:680b
Hyper-V Requirements:      VM Monitor Mode Extensions: Yes
                           Virtualization Enabled In Firmware: Yes
                           Second Level Address Translation: Yes
                           Data Execution Prevention Available: Yes

C:\Users\Liu.D.H>

image

Steps to reproduce

Open Ubuntu 18.04 or 20.04.

Expected behavior

Works as expected.

Actual behavior

image

I can confirm that I have enabled Virtual Machine Platform and VT-x. But the errors when I started Ubuntu is confused. And for some reasons I do not want to enable Hyper-V features. From the doc (https://docs.microsoft.com/en-us/windows/wsl/), it is not a requirement for WSL2.

liudonghua123 commented 4 years ago

From the doc https://docs.microsoft.com/en-us/windows/wsl/wsl2-faq, It seems that hyper-v is a requirement when running wsl2.

So I have to enable hyper-v? I will test it and report later.

liudonghua123 commented 4 years ago

Hope to document enable Hyper-V in https://docs.microsoft.com/en-us/windows/wsl/install-win10 when install and run wsl2.

benhillis commented 4 years ago

@liudonghua123 - The Hyper-V feature is not required, but Virtual Machine Platform (which includes the Hyper-V hypervisor) is required.

MrFoxPro commented 4 years ago

I get same error after clean install, Win 10 Home. Tried many times to enable/reenable features and rebooting pc. Virtualization is enabled in bios and shown as active in task manager. With clean install of ubuntu i get error WslRegisterDistribution failed with error: 0x80370102. Really disappointed as it works on laptop but not on desktop....

MrFoxPro commented 4 years ago

image I suspect that hyper-v is somehow enabled on my pc, but i can disable it scince im running with home edition. It appears when i disable virtualization in bios

MrFoxPro commented 4 years ago

suddenly resolved it by resetting bios.

liudonghua123 commented 4 years ago

@benhillis From the doc https://docs.microsoft.com/en-us/windows/wsl/wsl2-faq, It seems that hyper-v is a requirement when running wsl2. If I disabled it, then I got Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS. error message. I have tried many times.

therealkenc commented 4 years ago

The faq says (quoth) "...WSL uses Hyper-V architecture to enable its virtualization. This architecture will be available in the 'Virtual Machine Platform' optional component". That is the checkbox you want, and you look good:

image

You also seem okay as far as Hyper-V requirements go, notably your BIOS, per your systeminfo output in the OP.

Collect detailed logs.

@benhillis there is probably some semi-actionable here, at least in terms of user feedback in the error path. The upcoming wsl --install feature might mitigate some fails for people "doing it wrong", but there is at least some evidence of folks who seem to have their prerequisite ducks in line, and yet wsl.exe still tells them to "Please enable the Virtual Machine Platform". Which is unreasonably confusing when they already have VMP enabled. The WSL stack knows (or can at least determine) whether VMP is enabled and whether Windows thinks the BIOS is okay.

PSzczepanski1996 commented 4 years ago

Seems that NX Pages protection can be issue, enable it if the WSL2 fails to launch.

spennymac commented 4 years ago

I'm having the same issue. i updated my windows system, restarted and keep getting this message.

I have been running wsl2 with no issues and all of a sudden this is now occurring.

kubichris commented 4 years ago

Same problem: After restart my computer for an update, i can not start my wsl2 Ubuntu with same error message.

spennymac commented 4 years ago

I'm having the same issue. i updated my windows system, restarted and keep getting this message.

I have been running wsl2 with no issues and all of a sudden this is now occurring.

I figured out my issue. It broke to do installing CS:GO ESEA client. In order to fix, i had to uninstall and disable and re-enable WSL features.

leooop-al commented 4 years ago

when i took your advice, I fixed unexpectedly. thanks !

I'm having the same issue. i updated my windows system, restarted and keep getting this message. I have been running wsl2 with no issues and all of a sudden this is now occurring.

I figured out my issue. It broke to do installing CS:GO ESEA client. In order to fix, i had to uninstall and disable and re-enable WSL features. when i took your advice, I fixed unexpectedly. thanks !

LucaBernstein commented 4 years ago

I was just glad to see that by enabling the following modules in Turn Windows features on or off, followed by a restart, I was able to convert wsl from v1 to v2 via wsl --set-version Ubuntu 2:

Seems to be kind of like brute force, but at least it works now 😃 Update: Adapted needed features from last test.

0x04 commented 4 years ago

After the update to WSL2 and some reboots later, I had the same issue. Disabling and re-enabling WSL fixed the problem for me.

@spennymac Thanks for figuring that out! 👍

Delta456 commented 4 years ago

When I try to update to WSL 2 I get this as well. Of course I followed all the steps listed here https://docs.microsoft.com/en-us/windows/wsl/install-win10#update-to-wsl-2

PS C:\Users\admin> wsl --set-version Ubuntu-20.04 2
Conversion in progress, this may take a few minutes...
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
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
PS C:\Users\admin>
zhangqijia commented 4 years ago

suffer this problem and still cannot fix it, even though I reinstall WSL and enable the virtualization in BIOS

zhangqijia commented 4 years ago

Hope to document enable Hyper-V in https://docs.microsoft.com/en-us/windows/wsl/install-win10 when install and run wsl2.

  • DISM /Online /Enable-Feature /All /FeatureName:Microsoft-Hyper-V
  • bcdedit /set hypervisorlaunchtype auto

bcdedit /set hypervisorlaunchtype auto this command saved my life, thank you

V1NAY8 commented 3 years ago

I reset my BIOS and

bcdedit /set hypervisorlaunchtype auto

Really worked!

udithishara commented 3 years ago

If anyone else come across this trying to upgrade to WSL2 from 1

Xyverz commented 3 years ago

I'm keeping Hyper-V turned off because I use VMware Workstation Pro on my PC, but your command below fixed the problem for me. Thank you very much!

  • bcdedit /set hypervisorlaunchtype auto
Karlheinzniebuhr commented 3 years ago

I'm keeping Hyper-V turned off because I use VMware Workstation Pro on my PC, but your command below fixed the problem for me. Thank you very much!

  • bcdedit /set hypervisorlaunchtype auto

I have the same situation. Hyper-V off due to VMware but after running this command, rebooting and running again wsl --set-version Ubuntu-20.04 2 solved my issue

TradingIndian commented 3 years ago

I solved this issue in simpler way. Went to BIOS setup, disabled Virtualization in BIOS. Booted Windows. Once properly booted, shutdown and restart in BIOS setup. Enable Virtualization in BIOS et voilà. It works in WSL 2. I had to reinstall Ubuntu though, which was still showing WSL 1 version. But because it was fresh install, I did not have to worry about legacy baggage.

VIIIHenryVIII commented 3 years ago

Hope to document enable Hyper-V in https://docs.microsoft.com/en-us/windows/wsl/install-win10 when install and run wsl2.

  • DISM /Online /Enable-Feature /All /FeatureName:Microsoft-Hyper-V
  • bcdedit /set hypervisorlaunchtype auto

This last bit did it for me after restart.

michaeldrawe commented 3 years ago

I solved my issue the same way that TradianIndian solved his. Disable Virtualization in the bios, rebooted to windows, enabled virtualization and now WSL works for me.

marshall-strong commented 3 years ago

Similar to @TradingIndian and @michaeldrawe, my issue was that virtualization was disabled on my machine. Microsoft's WSL Installation Guide for Windows 10 DOES specify that "Virtual Machine Platform" must be enabled, but I didn't get any sort of error message when I ran the provided PowerShell command, so it took me a while to realize my issue.

You can check whether virtualization is enabled or not by opening the "Turn Windows features on or off" menu -- if virtualization is disabled, the check box next to "Virtual Machine Platform" will be grayed out, and a pop-up will confirm that virtualization is not enabled.

To fix the problem, I followed these instructions to enable virtualization in my UEFI firmware. Once my machine rebooted, I was able to check the box for "Virtual Machine Platform," then rebooted again. Opened PowerShell as an Administrator, then ran all the commands listed in the WSL Installation Guide: dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart wsl --set-version Ubuntu 2 Once conversion completed (took several minutes), I used the following to confirm: wsl --list --verbose

alikhamesy commented 3 years ago

I solved this issue in simpler way. Went to BIOS setup, disabled Virtualization in BIOS. Booted Windows. Once properly booted, shutdown and restart in BIOS setup. Enable Virtualization in BIOS et voilà. It works in WSL 2. I had to reinstall Ubuntu though, which was still showing WSL 1 version. But because it was fresh install, I did not have to worry about legacy baggage.

That worked for me... Gotta love the good ol' turn it off and on again.

dafuloth commented 3 years ago

I solved this issue in simpler way. Went to BIOS setup, disabled Virtualization in BIOS. Booted Windows. Once properly booted, shutdown and restart in BIOS setup. Enable Virtualization in BIOS et voilà.

As absurd as this solution sounds, I too can confirm that turning it off and on again does indeed work.

IIRC I already had WSL2 and everything all set up and working - but today it was giving this silly message Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS.

Maybe some recent Windows update screwed something up.

ben-wing commented 3 years ago

My solution today was to turn Hyper-V feature on, perform wsl --set-version Ubuntu 2 wsl --set-default-version 2 bcdedit /set hypervisorlaunchtype auto

Have since rebooted, and turned off Hypber-V feature, and WSL2 versioned Ubuntu install continues to function just fine. so another version of turn it on and then back off...

Tomiprase3270 commented 3 years ago

i have some issue problem today and i'm solved this problem very simple. i just go to BIOS setting and disable virtualization, then reboot into windows 10. after thet i go to BIOS again and i enable virtualization again. Taraaaaaa, wsl2 ubuntu lts 20.04 woking normally.

rajan-31 commented 3 years ago

Simple restart did the job for me.

DjoleLepi commented 3 years ago

My problem was that I didn't fully enable virtualization in BIOS. I only checked the IOMMU to be enabled. After digging some more I also found the SVM setting.

This is the documented way to enable virtualization, I just wanted to mention it here in case someone made the same mistake as me.

Wyverns010 commented 3 years ago

I solved this issue in simpler way. Went to BIOS setup, disabled Virtualization in BIOS. Booted Windows. Once properly booted, shutdown and restart in BIOS setup. Enable Virtualization in BIOS et voilà. It works in WSL 2. I had to reinstall Ubuntu though, which was still showing WSL 1 version. But because it was fresh install, I did not have to worry about legacy baggage.

The solution @TradingIndian mentioned worked for me, but partially. When I uninstalled the older ubuntu distro(wsl --unregister <DistributionName>) to install a new one, wsl stopped working again, showing server execution failed

I unchecked Windows Subsystem for Linux in Turn Windows features on or off(control panel->Programs->Turn Windows features on or off), rebooted, checked it back again, rebooted, wsl started working!

Before installing a new distro, I manually enabled wsl 2, finally installed the new distro through powerShell. I checked the distro version(wsl --list --verbose) and it was 2!

black2996 commented 2 years ago

It seems messed up, wsl2 works perfectly on my machine with "virtualization platform" feature turned off.

untoreh commented 2 years ago

My problem was that I didn't fully enable virtualization in BIOS. I only checked the IOMMU to be enabled. After digging some more I also found the SVM setting.

This is the documented way to enable virtualization, I just wanted to mention it here in case someone made the same mistake as me.

SVM and NX mode both have to be enable on AMD platforms

ShlomiRex commented 2 years ago

Hope to document enable Hyper-V in https://docs.microsoft.com/en-us/windows/wsl/install-win10 when install and run wsl2.

  • DISM /Online /Enable-Feature /All /FeatureName:Microsoft-Hyper-V
  • bcdedit /set hypervisorlaunchtype auto

Can confirm it works after struggling using WSL for the first time!

jadebujeya commented 2 years ago

I resolved this issue by turning on HP Application Driver in BIOS.

kensykora commented 2 years ago

This happened to me after I installed Visual Studio 2019 with Xamarin and Android SDK. The simulator must mess with the virtualization settings. Running the above commands fixed it.

DISM /Online /Enable-Feature /All /FeatureName:Microsoft-Hyper-V
bcdedit /set hypervisorlaunchtype auto
shinayser commented 2 years ago

My wsl2 stopped working right now on my Windows 11, out of nowhere!!!. And not only WSL2 but also Android's emulator. Says that I need to turn on virtual machine and hipervisor resources on, but they are already on!!! Everything was working fine the past month.

Someone got a clue?

EDIT: The only thing I installed today was updates from Windows Defender. Maybe thats a clue?

one0410 commented 2 years ago

I did everything above, but didn't work. It is 2022-01-12 today. I run WINDOWS UPDATE today, I can do "wsl --set-verion ubuntu 2 " finally.

EhsanKia commented 2 years ago

The opposite for me, I've been using wsl 2 for a long time. Last week I ran windows update, installing 21H2. Also updated apps on Windows Store which may have updated Ubuntu image?

Now I get

Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS.

and

C:\WINDOWS\system32>wsl --list --verbose
  NAME      STATE           VERSION
* Legacy    Running         1
  Ubuntu    Stopped         2

I've tried all the commands in this thread:

C:\WINDOWS\system32>wsl --set-version Ubuntu 2
Conversion in progress, this may take a few minutes...
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
The distribution is already the requested version.

C:\WINDOWS\system32>wsl --set-default-version 2
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
The operation completed successfully.

No dice.

EDIT: One strange thing is, I get a very random exit code:

[process exited with code _4294967295]_

EDIT2: Install Debian and it works fine, seems like my Ubuntu installation is fried.

EDIT3:

Solution

So for me at least, I tried nearly every solution that had to do with BIOS and windows 10 settings / commands, nothing work. If you're the same situation where your distro worked for months and suddenly stops, it's probably just corrupted. Try installing a different distro. If that works, then just unregister your distro and install it again, though afaik you lose any settings you didn't save, and you can't export settings if you can't boot. So i guess remember to regularly export data.

RshStone commented 2 years ago

For me, I installed BlueStacks software which needs me disable Hype-V. On the next morning. I start my ASUS computer. I found the warning that makes us meet here. I tried Turn Windows Features On and Not. Enable Hype-V, restart PC and not work. I open BIOS and found that the Virtualization Technology is enabled. So, I disable it and restart it.
Then I enable it. I found wsl worked! PC: ASUS Processor: Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz 1.80 GHz OS: Windows 10 Pro 20H2

jeff-zone commented 2 years ago

These steps worked for me:

  1. Disabling both virtualization options via the BIOS (Intel CPU)
  2. Reboot back into windows
  3. run wsl --list --verbose
  4. Reboot back into the BIOS and re-enable virtualization
  5. Reboot back into windows
  6. Was then able to convert my WSL1 Distro to WSL 2 with this command: `wsl --set-version Ubuntu 2` (don't freak out, this takes a few minutes unless your unlucky - definitely don't close the window while this conversion is in progress)
  7. Subsequently ran this command: wsl --set-default-version 2 with no err, just an informative message but it seems to have worked.
  8. Was able to verify the changes with: wsl --list -v
paxperscientiam commented 2 years ago

I'm keeping Hyper-V turned off because I use VMware Workstation Pro on my PC, but your command below fixed the problem for me. Thank you very much!

I too am trying to get WSL2 (and docker) working with Hyper-V turned off. I can confirm that this command got my WSL (ubuntu) setup working again; I had been getting the same error message in terminal.

danielhg1285 commented 2 years ago

I got this issue after executing following command: bcdedit /set hypervisorlaunchtype off

After running following the following command was solved: bcdedit /set hypervisorlaunchtype auto

Was suggested to reboot the system and I did it. wsl worked after.

xiangpeng2008 commented 2 years ago

is there any chance to update wsl 1 to wsl 2 without "admin" ?

Biswa96 commented 2 years ago

is there any change to update wsl 1 to wsl 2 without "admin" ?

The conversion process from WSL1 to WSL2 itself does not require admin privilege. But enabling WSL2 features does require admin privilege.

xiangpeng2008 commented 2 years ago

is there any change to update wsl 1 to wsl 2 without "admin" ?

The conversion process from WSL1 to WSL2 itself does not require admin privilege. But enabling WSL2 features does require admin privilege.

So I can't update to wsl2 without admin? It seems admin is needed for "Turn window features on and off"

Biswa96 commented 2 years ago

So I can't update to wsl2 without admin?

It depends if WSL2 feature is enabled or not.

kreshna93 commented 2 years ago

Hope to document enable Hyper-V in https://docs.microsoft.com/en-us/windows/wsl/install-win10 when install and run wsl2.

  • DISM /Online /Enable-Feature /All /FeatureName:Microsoft-Hyper-V
  • bcdedit /set hypervisorlaunchtype auto

THANKS.. IT REALLY WORKED