WSL: wsl: WSL installation seems to be corrupted (error code: Wsl/CallMsi/Install/REGDB_E_CLASSNOTREG).

Windows Version

Microsoft Windows [Version 10.0.26100.3194]

WSL Version

0.0.0.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

No response

Distro Version

No response

Other Software

No response

Repro Steps

1. Environment

I have downloaded wsl in the Microsoft Store. Here are the files in C:\Program Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForLinux_2.4.11.0_x64__8wekyb3d8bbwe

Image

Here is my registry.

Image

I don’t have these.

  • 计算机\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Drive\shell\WSL

  • 计算机\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\WSL

And I refer to DS’s advice and proceed as follows

  1. Modify the registry
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\Background\shell\WSL]
@="Open WSL Here"
"Icon"="C:\\Windows\\System32\\wsl.exe"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\Background\shell\WSL\command]
@="wsl.exe --cd \"%V\""
  1. The following commands were entered in PowerShell
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
sfc /scannow
DISM /Online /Cleanup-Image /RestoreHealth

And restart my PC

  1. I have cleaned up %windir%\System32\lxss folder manually and removed WSL-related packages (e.g. CanonicalGroupLimited.Ubuntu*) from %USERPROFILE%\AppData\Local\Packages.

Expected Behavior

After inputting wsl in PowerShell, it won’t appear as below.

Image

Actual Behavior

Three attempts

  1. In PowerShell After inputting wsl in PowerShell, it appears as below.

Image

  1. In msi

Image

Image

  1. Reference to an issue

Image

Diagnostic Logs

This log shows me typing wsl into powershell 7.0 until I get the result shown in the image below.

Image

WslLogs-2025-02-23_14-08-28.zip

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 17

Most upvoted comments

我也是REGDB_E_CLASSNOTREG,刚刚瞎折腾了好多操作,比如Disable-WindowsOptionalFeature Enable-WindowsOptionalFeature,反复重启,安装可选更新(可能不相关因为不是wsl有关的可选更新),停止火绒防护甚至干脆把火绒删了,再运行wsl --version让它按任意键修复 WSL,就修好了。也许可以试试看先把火绒卸载掉?我怀疑这个可能有用。

It’s been a week and I still can’t solve this problem, programming is a long way off!