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

Can't Install WSL due to 0x80040302 error #12595

Open
1 of 2 tasks
ColderCube opened this issue Feb 17, 2025 · 9 comments
Open
1 of 2 tasks

Can't Install WSL due to 0x80040302 error #12595

ColderCube opened this issue Feb 17, 2025 · 9 comments
Assignees

Comments

@ColderCube
Copy link

Windows Version

Microsoft Windows [Version 10.0.26100.3194]

WSL Version

2.4.11.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

No response

Distro Version

Debian

Other Software

No response

Repro Steps

wsl --install -d Debian or wsl --install -d Debian --no-launch
It happens with Ubuntu, Ubuntu-22.04, Ubuntu-24.04, ArchWSL.

Expected Behavior

It should have installed the Debian Distro.

Actual Behavior

Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x80040302
Error: 0x80040302 (null)
Press any key to continue...

Diagnostic Logs

WslLogs-2025-02-17_19-03-30.zip

Copy link

View similar issues

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!

Closed similar issues:

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

Diagnostic information
Detected appx version: 2.4.11.0
Detected user visible error: Wsl/Service/CreateInstance/ReadDistroConfig/WSL_E_DISTRO_NOT_FOUND

@ColderCube
Copy link
Author

The solution mentioned in those issues didn't work.

@liongeng
Copy link

liongeng commented Feb 18, 2025

I'm from China, and the same problem occurred to me as well. win10 19045.5487 install ubuntu20.04
Image

@OneBlue OneBlue self-assigned this Feb 18, 2025
@OneBlue
Copy link
Collaborator

OneBlue commented Feb 18, 2025

Thank you for reporting this @ColderCube. This is an interesting bug, but I can't reproduce the issue unfortunately.

Let's a capture a TDD trace of wslservice so I can see what's happening in there.

Can you please:

@muzea
Copy link

muzea commented Feb 19, 2025

My wsl2 is broken too. Using wsl --update has no effect and only keeps giving me the same error message.
This all happened after I installed KB5051974.

I downloaded and installed it manually from https://github.com/microsoft/WSL/releases/tag/2.4.11, and wsl can be used normally (There will be error messages during installation, just click ignore).

@marc-byte
Copy link

marc-byte commented Feb 19, 2025

I tried upgrading my working Ubuntu 20.04 to 24.04 and broke the distro. Uninstalled, reinstalled Ubuntu 24.04 LTS (from Microsoft Store) to start with a fresh copy. Always ends up in the same error upon initial start:

Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x80040302
Error: 0x80040302 (null)
Press any key to continue...

Installing Ubuntu with --install command fails differently after downloading and installing 100%:

wsl --install Ubuntu-24.04
Downloading: Ubuntu 24.04 LTS
Installing: Ubuntu 24.04 LTS
There is no distribution with the supplied name.
Error code: Wsl/InstallDistro/Service/RegisterDistro/ReadDistroConfig/WSL_E_DISTRO_NOT_FOUND

wsl -l -v shows no distros.

OS: Windows 11 upgraded from Windows 10 last week. WSL was installed in 10 and still working on 11.
WSL: Tried 2.4.11 installed by Windows, 2.4.8 and 2.4.11 from GitHub. All behave the same.

@ColderCube
Copy link
Author

ColderCube commented Feb 19, 2025

here's the tdd .run file @OneBlue

@OneBlue
Copy link
Collaborator

OneBlue commented Feb 20, 2025

Thank you @ColderCube. I was able to understand the root cause of the error you're seeing in the trace.

Essentially you have a "leftover" default distribution set in the registry, which causes WSL to fail when trying to set the debian as the new default.

If you delete the following registry value: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss\DefaultDistribution

The installation should succeed.

(I will go fix the logic in WSL itself so this issue doesn't break installations anymore).

@marc-byte
Copy link

Yes, confirmed workaround. Thanks!

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

No branches or pull requests

5 participants