microsoft / WSL

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

Error code: Wsl/Service/EnumerateDistros/ERROR_PATH_NOT_FOUND #9349

Open nikkon-dev opened 1 year ago

nikkon-dev commented 1 year ago

Version

WSL version: 1.0.3.0 Kernel version: 5.15.79.1 WSLg version: 1.0.47 MSRDC version: 1.2.3575 Direct3D version: 1.606.4 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.19045.2364

WSL Version

Kernel Version

Linux version 5.15.79.1-microsoft-standard-WSL2 (oe-user@oe-host) (x86_64-msft-linux-gcc (GCC) 9.3.0, GNU ld (GNU Binutils) 2.34.0.20200220) #1 SMP Wed Nov 23 01:01:46 UTC 2022

Distro Version

Ubuntu 22.04

Other Software

No response

Repro Steps

  1. On Windows 10 with standard (not from Store or Github) WSL run wsl -l. Got the result
    Windows Subsystem for Linux Distributions:
    Ubuntu-2204 (Default)
    docker-desktop
    docker-desktop-data
  2. Run wsl --update. Got result
    Installing: Windows Subsystem for Linux
    Windows Subsystem for Linux has been installed.
  3. Run wsl -l again. Got result:
    The system cannot find the path specified.
    Error code: Wsl/Service/EnumerateDistros/ERROR_PATH_NOT_FOUND
  4. Run wsl - able to login into the default ubuntu image.
  5. Uninstall "Windows Subsystem for Linux" from Store and run wsl -l again. Got normal results back.

Expected Behavior

wsl -l continues to work for the versions installed from Windows Store or GitHub releases. This is functionality that, for example, docker desktop depends on.

Actual Behavior

wsl -l returns Error code: Wsl/Service/EnumerateDistros/ERROR_PATH_NOT_FOUND

Diagnostic Logs

WslLogs-2022-12-16_11-58-14.zip

epthewizard commented 1 year ago

I have this same issue and WSL completely broke after I updated. I can run wsl and get it running but then VSCode can't find any distros

abluetuba commented 1 year ago

I had the same error.

In the Registry Editor under \HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss\ I believe there should be a key for each installed distribution. Instead I found one more with no values in it. I deleted it and this fixed it for me.

nikkon-dev commented 1 year ago

I confirm that removing empty keys from the HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss solves the problem.

jishcem commented 1 year ago

I was able to update the WSL using --web-download option. So the command would be like this wsl.exe --update --web-download I think this may work for those who has their windows store disabled.

103488117 commented 1 year ago

Worked out for me. Thanks.

SebinLee commented 1 year ago

@abluetuba Worked for me. Thanks.

zcarlos commented 1 year ago

I was able to update the WSL using --web-download option. So the command would be like this wsl.exe --update --web-download I think this may work for those who has their windows store disabled.

It worked to me to.

aiyou9 commented 1 year ago

I had the same error.

In the Registry Editor under \HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss\ I believe there should be a key for each installed distribution. Instead I found one more with no values in it. I deleted it and this fixed it for me.

when i re-install Ubuntu 20.04 in D://, I STOP it and did not finish install, and then it give me error

Error accessing regedit. path:“\REGISTRY\USER\S-1-5-21-32xxxxxx748-41xxxxxxx705-211xxxxxxx44-1000\Software\Microsoft\Windows\CurrentVersion\Lxss\{59d4xxxxd-ccx2-4xxx3-8e66-459xxxxxx9f9a9}\BasePath”。Error: The system cannot find the specified path
Error code: Wsl/Service/EnumerateDistros/ERROR_PATH_NOT_FOUND

and then i delect {59d4xxxxd-ccx2-4xxx3-8e66-459xxxxxx9f9a9} folder in registry

and then re-install my wsl in D:// it work

jezreel-findmyoptions commented 7 months ago

I had the same error.

In the Registry Editor under \HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss\ I believe there should be a key for each installed distribution. Instead I found one more with no values in it. I deleted it and this fixed it for me.

worked thanks!