Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 of 2 tasks
JVsup opened this issue Nov 16, 2023 · 41 comments

Comments

@JVsup
Copy link

JVsup commented Nov 16, 2023

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

Copy link

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:

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

@SpeedyLom
Copy link

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

@MMiller7901
Copy link

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

@aleluis79
Copy link

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

@keesj-riscure
Copy link

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

@SinisterGaze
Copy link

SinisterGaze commented Nov 17, 2023

I got the same issue several times since 2023-11-15. Always the same error when i try to run any wsl command or open my ubuntu distro:

Element not found.
Error code: Wsl/ERROR_NOT_FOUND

I am able to reinstall wsl and ubuntu from scratch and use it for a while but I have been able to reproduce the issue when:

  1. I try to use Docker Desktop (I am using wsl2 backend)
  2. I run "wsl --update" after wsl points out there is a new update to wsl (after the update it crashes)

This is my wsl --version print:

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.3693

@SinisterGaze
Copy link

SinisterGaze commented Nov 17, 2023

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

@mhicks-cfs
Copy link

I am seeing the same error, for me it started after installing the Windows update KB5032189. After rebooting WSL started to behave in the same way as the OP.
Unfortunately @SinisterGaze I do not have the same set of WSL installs as you do, none are 8 KB on my system.

@Ddog800
Copy link

Ddog800 commented Nov 17, 2023

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.

@RobertOstermann
Copy link

I am also seeing this error with WSL version 2.0.9.0 and installed Windows 10 KB5032189 yesterday.

@benhillis
Copy link
Member

Thanks for reporting, I'm not seeing /logs in this thread, could you please collect?

@JVsup
Copy link
Author

JVsup commented Nov 18, 2023

Thanks for reporting, I'm not seeing /logs in this thread, could you please collect?

Here they are, one log for stuff ran as standard user and another with elevated privileges
WslLogs-2023-11-18_07-26-40_user.zip
WslLogs-2023-11-18_07-28-44_admin.zip

@10cheon00
Copy link

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!

@frocentus
Copy link

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.

@ghusta
Copy link

ghusta commented Nov 19, 2023

I have the same problem with WSL 2.

Maybe it's related with this problem I have when I try to start Docker Desktop :

image

@eugenylitvinov
Copy link

The same problem for me, work stopped, docker doesn't work, wsl doesn't work. After removing MS Updale for wsl - wsl starts working but Docker reinstalls this update on installation and everything crashes immediately.

@Alk3m1st
Copy link

Just had this problem today and found this thread. As others reported, uninstalling the update has fixed the issue for me also.

Hopefully a permanent resolution will be sorted soon to allow the updates.

@baiciluigi
Copy link

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..

@mslinn
Copy link

mslinn commented Nov 20, 2023

My problem began after updating the Microsoft Store apps. Windows update shows this:
image

The store shows this:
image

Windows Update shows this:
image

How would I roll back the updated WSL installation?

@mikeputnam
Copy link

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

@mslinn
Copy link

mslinn commented Nov 20, 2023

@mikeputnam Right, VSCode does not update extensions when running as Administrator. This is not a useful solution.

@danielhuang-030
Copy link

The same problem for me, work stopped, docker doesn't work, wsl doesn't work. After removing MS Updale for wsl - wsl starts working but Docker reinstalls this update on installation and everything crashes immediately.

I had the same problem, but I solved it by reinstalling the previous version (4.24.2.0) of docker desktop.

@573
Copy link

573 commented Nov 21, 2023

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!

tl;dr EDITED: Currently I only left the entry with 459 MB still installed. Not a solution as actually running a VM still doesn't work.

Same here, after removing entry in Apps & Features as in picture above the one with tinier tux icon (localised label in the picture) wsl --list -v was running as normal again.
EDITED: In my case there seems to be a problem with the customised kernel I use now surfacing, when I wsl --status:

wsl kernel file not found

EDITED: At least (partial workaround) I was able to run wsl -d Ubuntu again after (making a backup and putting aside .wslconfig) and installing the *.msi from that page: https://learn.microsoft.com/de-de/windows/wsl/install-manual#step-4---download-the-linux-kernel-update-package

EDITED: Reverted everything to the Windows-Store version for now and am back at OP's error:

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

@fabio-r-goncalves
Copy link

Same problem. I tried to roll back the update and install an older version of WSL, and it did not work.
Is someone from Microsoft going to solve this? Most of my work is on WSL...

@Alkarex
Copy link

Alkarex commented Nov 21, 2023

@SinisterGaze 's solution worked for me as well on Windows 10 #10767 (comment)

@fabio-r-goncalves
Copy link

So, it seems that @SinisterGaze's solution works. The problem is that now I cannot use docker desktop. It tries to run wsl --update and fails to do so.

@fabio-r-goncalves
Copy link

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

@FlorianSchaetz
Copy link

FlorianSchaetz commented Nov 21, 2023

Doesn't work for me, since I don't have that 8kb file. Also doing the Kernel Update doesn't help. Tried de-installing everything and re-installing, nothing work. Running Terminal in admin works, but that's not really a solution. Docker Desktop still not functional.
Removing the registry key from the thread @Alkarex mentioned seems promising. (Edit: Worked for me)

@573
Copy link

573 commented Nov 21, 2023

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 #10782 (comment)

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

@aleluis79
Copy link

imagen

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

@Ruansh233
Copy link

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

I have the same 8kB file, but it doesn't work after I delete it. So sad.

@573
Copy link

573 commented Nov 24, 2023

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

I have the same 8kB file, but it doesn't work after I delete it. So sad.

Have you tried commenting / deleting the registry keys for old WSL mentioned further up ?

@Ruansh233
Copy link

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

I have the same 8kB file, but it doesn't work after I delete it. So sad.

Have you tried commenting / deleting the registry keys for old WSL mentioned further up ?

The weird thing is I don't have such registry keys. I have tried all solutions under the issue. But none of them works for my case. I will report later if I find sth.

@craigloewen-msft
Copy link
Member

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!

@o-sdn-o
Copy link

o-sdn-o commented Nov 24, 2023

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).

@Ruansh233
Copy link

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!

excellent!!!!

@dokmaister
Copy link

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

My version of the WSL I had to uninstall was something like 168MB and not 8KB (the one with the "smaller" icon).
The wsl kernel update was needed on my side as well. Thanks for pointing this out!
So both steps were needed to get it back up and running.

@keesj-riscure
Copy link

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!

I had the run the command 3 times (It was stuck the first time, appeared to have worked the second time) but after a reboot the problem remained present. updating a 3rd time did the trick. Thank you
image

@mslinn
Copy link

mslinn commented Nov 28, 2023

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!

@mhicks-cfs
Copy link

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!

@OneBlue
Copy link
Collaborator

OneBlue commented Dec 1, 2023

Fixed in 2.0.11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests