microsoft / WSL

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

WslRegisterDistribution failed with error #7854

Closed LolekLiam closed 2 years ago

LolekLiam commented 2 years ago

Version

Microsoft Windows [Version 10.0.19044.1415]

Repro Steps

Run Ubuntu or any other linux distro.

Expected Behavior

Install within distro and use it.

Actual Behavior

Didn't even install and wsl can't even detect the distro.

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

Diagnostic Logs

I already tried turning off the firewall, but got the same error.

XJIOP commented 2 years ago

same here

Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x80041002
Error: 0x80041002 (null)
Press any key to continue...
LolekLiam commented 2 years ago

same here

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

i found a solution. open powershell as admin and type this command: wsl --set-default-version 1 wait till it's done and open your distro again. if it doesn't work, try opening cmd as admin and paste the same command. that worked for me

XJIOP commented 2 years ago

i found a solution. open powershell as admin and type this command: wsl --set-default-version 1

After that, can you resume to WSL2?

LolekLiam commented 2 years ago

i found a solution. open powershell as admin and type this command: wsl --set-default-version 1

After that, can you resume to WSL2?

I think you can't. I haven't tried yet. Try it and let me know if it works.

XJIOP commented 2 years ago

WSL version 1 works, but the same error when converting to WSL2

wsl --set-version Debian 2
Conversion in progress, this may take a few minutes...
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
Error: 0x80041002
Polemus commented 1 year ago

still getting this issue, all was working then it just somehow stopped working

Win 11 ubuntu 22.04.1 LTS from store

Docker desktop also fails to launch

quangtrinh1312 commented 10 months ago

i delete all previous vm, disable vpn, turn off some defender about app in window defender and restart, switch wsl 1 and it work!

aliyousafzai183 commented 1 month ago

This command worked for me! Open powershell as administrator and type: wsl --update

then restart the docker-desktop