WSL: Object not found error / Error code: Wsl/ERROR_NOT_FOUND - wsl can be run and used only with elevated privileges ("run as admin")

Windows Version

Microsoft Windows [Version 10.0.19045.3570]

WSL Version

2.0.9.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

Linux version 5.15.133.1-microsoft-standard-WSL2 (root@1c602f52c2e4) (gcc (GCC) 11.2.0, GNU ld (GNU Binutils) 2.37) #1 SMP Thu Oct 5 21:02:42 UTC 2023

Distro Version

Debian 11.8

Other Software

No response

Repro Steps

Today wsl stopped working, I cannot acces it - all i am getting is error that object doesnt exist no matter what i do. Error messages are completely unhelpful.

From standart powershell, i cant do anything, but if I run it with elevated privileges as admin, suddenly i can see the distro, run in, use it, etc.

same goes for windows terminal, launching linux apps, and so on. I need to run them as admin, or nothing works.

I have no clue what caused this deranged behavior, because until today I did not need to run anything wsl related as admin…

Expected Behavior

I should be able to use wsl with standard user privileges, not only as admin.

Actual Behavior

standart powershell (run with normal user permisions)

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\Users\janva> wsl -l -v
Prvek nebyl nalezen.
Error code: Wsl/ERROR_NOT_FOUND
PS C:\Users\janva> wsl --install
Ubuntu je již nainstalovaný.
Spouští se Ubuntu…
Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x80070490
Error: 0x80070490 Prvek nebyl nalezen.

Press any key to continue...
Operace byla dokončena úspěšně.
PS C:\Users\janva> wsl
Prvek nebyl nalezen.
Error code: Wsl/ERROR_NOT_FOUND
PS C:\Users\janva> wsl.exe
Prvek nebyl nalezen.
Error code: Wsl/ERROR_NOT_FOUND
PS C:\Users\janva> wsl --version
Verze WSL: 2.0.9.0
Verze jádra: 5.15.133.1-1
Verze WSLg: 1.0.59
Verze MSRDC: 1.2.4677
Verze Direct3D: 1.611.1-81528511
Verze DXCore: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Verze Windows: 10.0.19045.3570
PS C:\Users\janva> wsl --status
Prvek nebyl nalezen.
Error code: Wsl/ERROR_NOT_FOUND


powreshell with elevated privileges

PS C:\> wsl -l -v
  NAME      STATE           VERSION
* Debian    Running         2
PS C:\> wsl --status
Výchozí distribuce: Debian
Výchozí verze: 2
PS C:\> wsl --version
Verze WSL: 2.0.9.0
Verze jádra: 5.15.133.1-1
Verze WSLg: 1.0.59
Verze MSRDC: 1.2.4677
Verze Direct3D: 1.611.1-81528511
Verze DXCore: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Verze Windows: 10.0.19045.3570

Diagnostic Logs

No response

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 31
  • Comments: 41 (2 by maintainers)

Most upvoted comments

Update:

I now managed to reproduce and fix my issue by uninstalling the last file (8kB) in the list below from apps & features. I got that file from running “wsl --update”. My wsl doesn’t crash anymore as long as I avoid running “wsl --update”.

image

Update:

I now managed to reproduce and fix my issue by uninstalling the last file (8kB) in the list below from apps & features. I got that file from running “wsl --update”. My wsl doesn’t crash anymore as long as I avoid running “wsl --update”.

image

This is works for me. Just uninstall latest app. Great!

Hey folks if you’re seeing this error can you please try upgrading to version 2.0.11 which should have a fix! You can do this by running wsl --update --pre-release from a command window with admin privileges, and you can check your version with wsl --version.

Please let us know if that fixed this issue, thank you!

Just in case it helps someone: The steps I took where re-installing the Windows-Store version (so basically getting all three icons above in the famous screen above) after I took this exact measure:

Thank you @pahar0. This confirms our theory: There is an old WSL installation that’s conflicting with the latest package.

Can you try to:

* Delete: `HKEY_LOCAL_MACHINE\SOFTWARE\Classes\PackagedCom\ClassIndex\{A9B7A1B9-0671-405C-95F1-E0612CB4CE7E}`

* See if that solves the issue

(You can use the .reg you just captured as backup if needed)

_Originally posted by @OneBlue in https://github.com/microsoft/WSL/issues/10782#issuecomment-1820066209_

Then all seems back to normal:

wsl -v WSL-Version: 2.0.9.0 Kernelversion: 5.15.133.1-1 WSLg-Version: 1.0.59 MSRDC-Version: 1.2.4677 Direct3D-Version: 1.611.1-81528511 DXCore-Version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows-Version: 10.0.19045.3570

wsl -d ubuntu – uname -sr Linux 5.15.133.1-microsoft-standard-WSL2

Update: I now managed to reproduce and fix my issue by uninstalling the last file (8kB) in the list below from apps & features. I got that file from running “wsl --update”. My wsl doesn’t crash anymore as long as I avoid running “wsl --update”. image

This is works for me. Just uninstall latest app. Great!

This worked for me also, altough mine had not 8 KByte but around 160 MByte. But after removing it, WSL2 started to work again.

imagen

I added a dash to the old keys. That worked for me.

Similar issue here (and X11 window corruption)

Admin

C:\Users\ME>wsl -l -v
  NAME      STATE           VERSION
* Ubuntu    Running         2

User

C:\Users\ME>wsl -l -v
Element not found.
Error code: Wsl/ERROR_NOT_FOUND

Fixed in 2.0.11

Hey folks if you’re seeing this error can you please try upgrading to version 2.0.11 which should have a fix! You can do this by running wsl --update --pre-release from a command window with admin privileges, and you can check your version with wsl --version.

Please let us know if that fixed this issue, thank you!

This worked for me, thanks!

I had given up, and attempted to remove and reinstall the WSL feature. The removal hit a snag partway through and stopped. I rebooted the system, re-enabled the WSL feature, attempted a re-installation, then ran the magic incantation:

wsl --update --pre-release

To my total amazement, it worked!

Thank you! wsl --update --pre-release fixed my wsl setup (10.0.19045.3693, no need to run it elevated, UAC automatically asks for elevating).

Ok, so I think I can have everything working. So, follow @SinisterGaze’s instructions and remove the update. Then, if needed, install wsl kernel update from https://www.catalog.update.microsoft.com/Search.aspx?q=wsl

Running a Terminal as Administrator seems to work. This is problematic for the terminal in VSCode however.

Same issue, can only run wsl with admin rights, everything else fails. Have to manually run it on admin. Docker Desktop fails, but when launched with admin rights, succeeds aswell. For now I can work like this but it needs to be fixed…

I just noticed this today as well. Looks like WSL updated yesterday from the MS store (reporting version 2.0.9.0). Also installed Windows 10 KB5032189 yesterday as well.

Edit: Confirmed that it will open fine if I launch Terminal as administrator.

Same issue here, after yesterday’s Windows 10 Update (2023-11-15).

Also having similar issues since yesterday (2023-11-15) wsl has completely quit responding to commands and just hangs PowerShell

<3>WSL (82) ERROR: CreateProcessEntryCommon:502: execvpe /bin/bash failed 5

I’m having this exact issue since yesterday (2023-11-15).