Open liudonghua123 opened 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.
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
@liudonghua123 - The Hyper-V feature is not required, but Virtual Machine Platform (which includes the Hyper-V hypervisor) is required.
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....
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
suddenly resolved it by resetting bios.
@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.
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:
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.
Seems that NX Pages protection can be issue, enable it if the WSL2 fails to launch.
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.
Same problem: After restart my computer for an update, i can not start my wsl2 Ubuntu with same error message.
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 !
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 !
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.
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! 👍
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>
suffer this problem and still cannot fix it, even though I reinstall WSL and enable the virtualization in BIOS
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
I reset my BIOS and
bcdedit /set hypervisorlaunchtype auto
Really worked!
If anyone else come across this trying to upgrade to WSL2 from 1
DISM /Online /Enable-Feature /All /FeatureName:Microsoft-Hyper-V
& bcdedit /set hypervisorlaunchtype auto
(Credit: @liudonghua123)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'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
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.
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.
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.
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
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.
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.
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...
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.
Simple restart did the job for me.
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.
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!
It seems messed up, wsl2 works perfectly on my machine with "virtualization platform" feature turned off.
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
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!
I resolved this issue by turning on HP Application Driver in BIOS.
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
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?
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.
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:
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.
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
wsl --list --verbose
wsl --set-default-version 2
with no err, just an informative message but it seems to have worked.wsl --list -v
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.
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.
is there any chance to update wsl 1 to wsl 2 without "admin" ?
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.
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"
So I can't update to wsl2 without admin?
It depends if WSL2 feature is enabled or not.
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
Environment
Steps to reproduce
Open Ubuntu 18.04 or 20.04.
Expected behavior
Works as expected.
Actual behavior
I can confirm that I have enabled
Virtual Machine Platform
andVT-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.