microsoft / WSL

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

wsl.exe hangs or terminates when starting WSL session: Wsl/Service/CreateInstance/CreateVm/ConfigureGpu/HCS/ERROR_PATH_NOT_FOUND #10918

Open coldacid opened 10 months ago

coldacid commented 10 months ago

Windows Version

Microsoft Windows [Version 10.0.19045.3803]

WSL Version

2.0.9.0, 2.0.14.0

Are you using WSL 1 or WSL 2?

Kernel Version

5.15.133.1-1

Distro Version

Arch

Other Software

N/A

Repro Steps

  1. Open Windows Terminal
  2. Try any or all of these commands:
    • wsl -d Arch
    • wsl
    • wsl --system
      1. In all cases, wsl.exe will terminate with error message and code "The system cannot find the path specified." and "Error code: Wsl/Service/CreateInstance/CreateVm/ConfigureGpu/HCS/ERROR_PATH_NOT_FOUND" to the terminal, usually after acting hung for up to a minute. (Prior to reboot when first reporting the problem, the error message and code were "Server execution failed" and Wsl/0x80080005, and occurred with wsl --status and wsl --list as well.)

Expected Behavior

Actual Behavior

Diagnostic Logs

WslLogs-2023-12-13_23-17-45.zip

github-actions[bot] commented 10 months ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

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. Thank you!

Open similar issues:

Closed similar issues:

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

coldacid commented 10 months ago

After rebooting the computer, the error message and code have now changed to "The system cannot find the path specified." and Wsl/Service/CreateInstance/CreateVm/ConfigureGpu/HCS/ERROR_PATH_NOT_FOUND instead. wsl --list and wsl --status work properly, but any attempt to start an actual WSL session continues to fail. New logs attached.

WslLogs-2023-12-13_23-47-32.zip

coldacid commented 10 months ago

Problem persists after upgrade to WSL 2.0.14.0

coldacid commented 10 months ago

I enabled the Virtual Machine Platform feature for Windows and rebooted in case that would help (since it is required with some builds of Windows 10), no change.

OneBlue commented 10 months ago

Thank you @coldacid. Looking at the logs, looks like this is the issue:

379 True    Microsoft.Windows.Lxss.Manager  Error   0   12-13-2023 20:48:16.888 "   "   "code:  
failurecount:   1
file:   D:\a\1\s\src\windows\common\hcs.cpp
function:   
hr:     0x80070003
linenumber:     231
message:    ""HcsWaitForOperationResult for HcsModifyComputeSystem failed ({""""ResourcePath"""":""""VirtualMachine/Devices/Plan9/Shares"""",""""RequestType"""":""""Add"""",""""Settings"""":{""""Name"""":""""drivers"""",""""AccessName"""":""""drivers"""",""""Path"""":""""C:\\WINDOWS\\System32\\DriverStore\\FileRepository"""",""""Port"""":50001,""""Flags"""":33}} - error string: (null))""
threadid:   13012
type:   0
wslVersion:     2.0.9.0"    D:\a\1\s\src\windows\common\hcs.cpp         14624   13012   2       00000000-0000-0000-0000-000000000000        

Can you confirm if the C:\WINDOWS\System32\DriverStore\FileRepository folder exists on your machine ?

coldacid commented 10 months ago

@OneBlue it does exist, and well populated to boot.

coldacid commented 10 months ago

Attaching directory list for C:\WINDOWS\System32\DriverStore\FileRepository and an updated diagnostics zip reflecting the updated WSL version and Windows feature changes. WslLogs-2023-12-15_18-51-53.zip FileRepository.dir.txt

coldacid commented 9 months ago

@OneBlue any other possibilities?

joshglens commented 9 months ago

I didn't have the exact same error, but found that disabling Hyper-V in Turn Windows features on or off worked for hanging WSL. Based on what I've seen, in some cases it only worked after turning it back on. To thoroughly test this, I would recommend trying the following:

  1. Try running WSL
  2. Restart computer
  3. Disable Hyper-V in Windows features
  4. Restart
  5. Try running WSL
  6. Enable Hyper-V in Windows features
  7. Restart
  8. Try running WSL
  9. See if there are any optional Updates for windows available
  10. Restart
  11. Try running WSL

Best of luck! WSL is unfortunately still very finnicky.

coldacid commented 9 months ago

@joshglens thanks but it didn't make a difference.

OneBlue commented 9 months ago

Thank you @coldacid. I'm added more logging to our logging script to help root cause. Could you please run (elevated powershell):

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 -LogProfile storage

[reproduce the issue in another terminal while log collection is running]
[stop log collection]

And share the resulting zip file ?

coldacid commented 9 months ago

@OneBlue sorry for the delay, didn't see that you had replied.

WslLogs-2024-01-15_22-32-48.zip

god-jester commented 9 months ago

@coldacid an in-place reinstall fixed it for me (ISO for 22621 generated with uupdump). Your issue is the only Google result for Wsl/Service/CreateInstance/CreateVm/ConfigureGpu/HCS/ERROR_PATH_NOT_FOUND - and this was the only fix that worked.

coldacid commented 8 months ago

@OneBlue anything come up with that last log dump?