microsoft / WSL

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

WSL2 won't launch even after troubleshooting with Hyper-V #11775

Closed KerimKAintHere closed 4 weeks ago

KerimKAintHere commented 1 month ago

WSL version: 2.2.4.0 Kernel version: 5.15.153.1-2 WSLg version: 1.0.61 MSRDC version: 1.2.5326 Direct3D version: 1.611.1-81528511 DXCore version: 10.0.26091.1-240325-1447.ge-release Windows version: 10.0.22631.3880

Expected Behavior -WSL should install and work after fixing Hyper-V

Actual Behavior -WSL2 thinks HyperV is not installed

I'm using WSL2

the Error: WSL2 is not supported with your current machine configuration. Please enable the "Virtual Machine Platform" optional component and ensure virtualization is enabled in the BIOS. Enable "Virtual Machine Platform" by running: wsl.exe --install --no-distribution For information please visit https://aka.ms/enablevirtualization Error code: Wsl/Service/CreateInstance/CreateVm/HCS/HCS_E_HYPERV_NOT_INSTALLED

All the components i turned on are:

"Virtual Machine Platform" "Windows Subsystem for Linux" "Hyper-V" and "WIndows Hypervision Platform"

I accidentally ran some weird looking .exe file that disabled Hyper-V and i had to get Hyper-V back, but even after Re-installing it, WSL2 won't launch I even have Virtualization Enabled in my BIOS

and here are the logs: WslLogs-2024-07-12_13-39-53.zip

does anyone know what i can do to fix this?

github-actions[bot] commented 1 month ago

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs Download and execute [collect-wsl-logs.ps1](https://github.com/Microsoft/WSL/blob/master/diagnostics/collect-wsl-logs.ps1) in an **administrative powershell prompt**: ``` Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1 Set-ExecutionPolicy Bypass -Scope Process -Force .\collect-wsl-logs.ps1 ``` The scipt will output the path of the log file once done. Once completed please upload the output files to this Github issue. [Click here for more info on logging](https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#8-collect-wsl-logs-recommended-method) If you choose to email these logs instead of attaching to the bug, please send them to wsl-gh-logs@microsoft.com with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.

View similar issues

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

github-actions[bot] commented 1 month ago
Diagnostic information ``` Detected appx version: 2.2.4.0 Detected user visible error: Wsl/Service/CreateInstance/CreateVm/HCS/HCS_E_HYPERV_NOT_INSTALLED Detected user visible error: Wsl/Service/CreateInstance/CreateVm/HCS/HCS_E_HYPERV_NOT_INSTALLED Detected user visible error: Wsl/Service/CreateInstance/CreateVm/HCS/HCS_E_HYPERV_NOT_INSTALLED ```
github-actions[bot] commented 1 month ago
Diagnostic information ``` Issue was edited and new log file was found: https://github.com/user-attachments/files/16193374/WslLogs-2024-07-12_13-39-53.zip Detected appx version: 2.2.4.0 Detected user visible error: Wsl/Service/CreateInstance/CreateVm/HCS/HCS_E_HYPERV_NOT_INSTALLED Detected user visible error: Wsl/Service/CreateInstance/CreateVm/HCS/HCS_E_HYPERV_NOT_INSTALLED Detected user visible error: Wsl/Service/CreateInstance/CreateVm/HCS/HCS_E_HYPERV_NOT_INSTALLED ```
snowcrashcode commented 1 month ago

Hey,

Just faced the same problem. My issue was resolved by going into BIOS and enabling SVM mode.

  1. Enter the BIOS setup screen on startup
  2. Access the "Advanced CPU Core Settings" menu
  3. Enable "SVM Mode"

Perhaps give this a go. As a sidenote, my WSL2 faced this error immediately after I updated my Windows. I had tried other solutions (including restarting "Virtual Machine Platform", "HyperV", etc..), but none seemed to work except this one.

OneBlue commented 1 month ago

@KerimKAintHere: Looking at the logs, I can see that the BCD doesn't boot with hypervisr:

hypervisorlaunchtype    Off

Can you try running (elevated command prompt):

bcdedit /set hypervisorlaunchtype auto

And reboot to see if that solves the issue ?

ashish111333 commented 1 month ago

.

what is svm ?

snowcrashcode commented 1 month ago

.

what is svm ?

SVM refers to "Secure Virtualization Mode". Basically, enabling that option will enable virtualization, which WSL2 depends on.

microsoft-github-policy-service[bot] commented 4 weeks ago

This issue has been automatically closed since it has not had any author activity for the past 7 days. If you're still experiencing this issue please re-file it as a new issue.

Thank you!