microsoft / WSL

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

WSL broken with "Class not registered" code 4294967295 (0xffffffff) #8268

Open cmmata opened 2 years ago

cmmata commented 2 years ago

Version

Microsoft Windows [Version 10.0.22581.200]

WSL Version

Kernel Version

No response

Distro Version

Ubuntu 20

Other Software

Docker desktop when the issue appeared, now uninstalled

Repro Steps

Just trying to execute WSL in any way... opening the Windows Terminal or executing wsl from PowerShell

Expected Behavior

The Linux prompt should appear, as it did earlier this morning. Or when executing wsl -l, it should list the operating systems installed (currently only Ubuntu)

Actual Behavior

When I open the terminal, I see

Class not registered

[process exited with code 4294967295 (0xffffffff)]

If I execute wsl --status from PowerShell, I only see

Class not registered

Diagnostic Logs

No response

cmmata commented 2 years ago

I tried most of the possible fixes from #5092 without any success. What I finally did is:

At the moment it looks like it's working. Or at least I could save all the important work files. Let's see if this continues to work when I reinstall Docker desktop and after rebooting the machine.

ghost commented 2 years ago

If this occurs again, please capture logs! I'll close for now.

https://github.com/Microsoft/WSL/blob/master/CONTRIBUTING.md#8-collect-wsl-logs

mao commented 2 years ago

I have same problem when I run wsl in cmd with "Class not registered" error: image

cmd version: Microsoft Windows [Version 10.0.22000.708] (c) Microsoft Corporation. All rights reserved.

aquino-mael commented 2 years ago

To fix "Class not registered" error, I only repair WSL on "Settings > Applications > Instaled Applications > Windows Subsystem for Linux > Advanced Options > Repair". After do that, my WSL command returned to work.

jeremy-smith-maco commented 2 years ago

To fix "Class not registered" error, I only repair WSL on "Settings > Applications > Instaled Applications > Windows Subsystem for Linux > Advanced Options > Repair". After do that, my WSL command returned to work.

I got the same error today after updating WSL. This fixed it for me too. Thanks a lot.

anubhavashok commented 2 years ago

Ran into this error, what worked was to do the following as the above commenter suggested: "Settings > Applications > Instaled Applications > Windows Subsystem for Linux > Advanced Options > Repair"

However, you need to select the distro (e.g. Ubuntu) in the installed apps, not Windows Subsystem for Linux Preview. Hope that helps

mjohnsonengr commented 2 years ago

I ended up here; the Repair didn't work but I happened to notice https://learn.microsoft.com/en-us/windows/wsl/troubleshooting#error-0x80040154-after-windows-update so I'm going to try that after backing up my ext4.vhdx file from %UserProfile%\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState

Edit resetting/uninstalling didn't do anything bad to my data, possibly because I had "upgraded" a WSL 2 instance from previous to the store version after upgrading to Windows 11 so my data was already detached from the Store install?

Resetting didn't work but uninstall/reinstall did.

JaBrDo commented 2 years ago

Same issue here. I wanted to follow the instructions from @cmmata

What I ended up doing was:

And for now everything is working like before.

goodlux commented 1 year ago

wow this really sucks. I'm just using windows 11, after about a decade of not using it. It crashes constantly. WSL seemed to stop working after I disabled the terminal from starting automatically at startup. It kept automatically starting whenever I would start the machine.

I tried the above "repair" suggestion by [anubhavashok] above ... this didn't work.

Is completely uninstalling Linux then reinstalling the only answer? For the people who backed up their current install, were they able to later restore it?

I feel like I'm spending a lot of time on windows just managing the software to keep it from crashing all the time.

aki-k commented 1 year ago

I had this happen today after reinstalling WSL 1.2.5 and https://github.com/microsoft/WSL/issues/8268#issuecomment-1181802550 fixed it

Dreynor commented 1 year ago

For those still hitting this, and particularly for a new hits, please use FeedbackHub to get the logs we would need.

Here is a good set of instructions for using FeedbackHub (One note... please use the SubCategory "App deployment" instead of "Windows Subsystem For Linux"): https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#9-collect-wsl-logs-with-feedback-hub

Overdozed commented 1 year ago

wsl --update --pre-release saved my live today having same troubles.

solstice333 commented 11 months ago

To fix "Class not registered" error, I only repair WSL on "Settings > Applications > Instaled Applications > Windows Subsystem for Linux > Advanced Options > Repair". After do that, my WSL command returned to work.

I ended up having to uninstall Windows Subsystem for Linux from here, disable the windows feature (start menu > Turn windows features on or off), reboot, then re-enable it

Eliav2 commented 10 months ago

DO NOT update to latest wsl version (as of 20.12.23) (in my case this happens after a fresh install of windows)

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

Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows

PS C:\Users\lousk> wsl
╭─ /mnt/c/Users/lousk ··············································································· ✔  22:11:02 ─╮
╰─ exit                                                                                                              ─╯
PS C:\Users\lousk> wsl.exe --update
Installing: Windows Subsystem for Linux
Windows Subsystem for Linux has been installed.
PS C:\Users\lousk> wsl --shutdown
Class not registered
Error code: Wsl/CallMsi/REGDB_E_CLASSNOTREG
PS C:\Users\lousk> wsl --shutdown
image

you can see wsl works but after updating stop working.

if so, do as @aquino-mael suggested:

To fix "Class not registered" error, I only repair WSL on "Settings > Applications > Instaled Applications > Windows Subsystem for Linux > Advanced Options > Repair". After do that, my WSL command returned to work.

A FIX

managed to solve it:

raymond2330 commented 10 months ago

Hello, @Eliav2. Can you please give a detailed steps how to do that?

Eliav2 commented 10 months ago

@pmartincic reopen this issue. This is issue is clearly ongoing problem.

@raymond2330 just download the wsl msi from the link I've provided and install it manually

pj185095 commented 10 months ago

how do you uninstall wsl and reinstall it manually. wsl --uninstall is giving the same error

aki-k commented 10 months ago

@pj185095 I don't know if this applies to your issue with the error message, but here's how I update WSL 2 from an Administrator Powershell after first installing WSL 2 with "wsl --install" from a CMD prompt.

PS > Get-AppxPackage -allusers | findstr /i "Linux"
PackageFullName        : MicrosoftCorporationII.WindowsSubsystemForLinux_2.0.4.0_x64__8wekyb3d8bbwe
PS > Remove-AppxPackage -package MicrosoftCorporationII.WindowsSubsystemForLinux_2.0.4.0_x64__8wekyb3d8bbwe -allusers
PS > dism.exe /online /Add-ProvisionedAppxPackage /packagepath:Microsoft.WSL_2.0.15.0_x64_ARM64.msixbundle /skiplicense

Restart Windows

josewalter commented 9 months ago

In my case, this step by step didn't work and I had to uninstall WSL and Ubuntu.

aki-k commented 9 months ago

@josewalter I fixed my earlier comment about updating WSL 2 from Administrator Powershell.

FerJeffQ commented 8 months ago

@Eliav2 Thanks ! It only has to be installed manually and it is fixed seriously, thank you

rvforte8 commented 8 months ago

Spent a whole day trying to fix this issue until I found this answer. Thanks! @Eliav2

moonhuntercode commented 6 months ago

I repaired this problem by installing directly the latest stable version of wsl ,así de fácil lo reparé jeje, solo instala el latest version https://github.com/microsoft/WSL/releases/

osias-espindola commented 2 months ago

I had a similar problem and the solution was to install the support this I did the wsl --status and everything was ok

omesh845 commented 2 months ago

I repaired this problem by installing directly the latest stable version of wsl ,así de fácil lo reparé jeje, solo instala el latest version https://github.com/microsoft/WSL/releases/

This worked like a charm

RobertDiebels commented 1 month ago

DO NOT update to latest wsl version (as of 20.12.23) (in my case this happens after a fresh install of windows)

@Eliav2 Holy shit.. Thank you so much! The WSL install on my PC bricked after I upgraded to Windows 11 a few months ago. Doing this finally fixed it.

mha2002mad commented 21 hours ago

hi, just remove wsl fully on your machine then download it via here: https://objects.githubusercontent.com/github-production-release-asset-2e65be/55626935/ad5a76b7-b2f2-49e7-9b6d-c9d16b171156?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20241107%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241107T103928Z&X-Amz-Expires=300&X-Amz-Signature=f3128bdb31a5094eeb387b56b5981f53adcf5fb4b4e423bba8e32e638284062c&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3Dwsl.2.3.24.0.x64.msi&response-content-type=application%2Foctet-stream

then voila it works