microsoft / WSL

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

WslRegisterDistribution failed with error: 0x80041002 Error: 0x80041002 (null) #11044

Open snw1317 opened 5 months ago

snw1317 commented 5 months ago

Windows Version

Microsoft Windows [Version 10.0.19045.3930]

WSL Version

WSL version: 2.0.9.0

Are you using WSL 1 or WSL 2?

Kernel Version

Default Version: 2

Distro Version

Ubuntu 20.04 LTS

Other Software

No response

Repro Steps

Details in Actual Behavior

Expected Behavior

Expecting Ubuntu to run.

Actual Behavior

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

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\Windows\system32> wsl --status Default Version: 2

The Windows Subsystem for Linux kernel can be manually updated with 'wsl --update', but automatic updates cannot occur due to your system settings. To receive automatic kernel updates, please enable the Windows Update setting: 'Receive updates for other Microsoft products when you update Windows'. For more information please visit https://aka.ms/wsl2kernel.

The WSL 2 kernel file is not found. To update or restore the kernel please run 'wsl --update'. PS C:\Windows\system32> wsl --set-default-version 2 For information on key differences with WSL 2 please visit https://aka.ms/wsl2 The operation completed successfully. PS C:\Windows\system32> wsl --shutdown PS C:\Windows\system32> wsl --set-default-version 2 For information on key differences with WSL 2 please visit https://aka.ms/wsl2 The operation completed successfully. PS C:\Windows\system32> wsl --update Installing: Windows Subsystem for Linux Windows Subsystem for Linux has been installed. PS C:\Windows\system32> wsl -l -o The following is a list of valid distributions that can be installed. Install using 'wsl.exe --install '.

NAME FRIENDLY NAME Ubuntu Ubuntu Debian Debian GNU/Linux kali-linux Kali Linux Rolling Ubuntu-18.04 Ubuntu 18.04 LTS Ubuntu-20.04 Ubuntu 20.04 LTS Ubuntu-22.04 Ubuntu 22.04 LTS OracleLinux_7_9 Oracle Linux 7.9 OracleLinux_8_7 Oracle Linux 8.7 OracleLinux_9_1 Oracle Linux 9.1 openSUSE-Leap-15.5 openSUSE Leap 15.5 SUSE-Linux-Enterprise-Server-15-SP4 SUSE Linux Enterprise Server 15 SP4 SUSE-Linux-Enterprise-15-SP5 SUSE Linux Enterprise 15 SP5 openSUSE-Tumbleweed openSUSE Tumbleweed PS C:\Windows\system32> wsl --install -d Ubuntu-20.04 Ubuntu 20.04 LTS is already installed. Launching Ubuntu 20.04 LTS... Installing, this may take a few minutes... WslRegisterDistribution failed with error: 0x80041002 Error: 0x80041002 (null) Press any key to continue... The operation completed successfully. PS C:\Windows\system32> wsl --unregister Ubuntu-20.04 Unregistering. There is no distribution with the supplied name. Error code: Wsl/Service/WSL_E_DISTRO_NOT_FOUND PS C:\Windows\system32> wsl --unregister Ubuntu-20.04 LTS Unregistering. There is no distribution with the supplied name. Error code: Wsl/Service/WSL_E_DISTRO_NOT_FOUND PS C:\Windows\system32> sfc /scannow

Beginning system scan. This process will take some time.

Beginning verification phase of system scan. PS C:\Windows\system32>

Diagnostic Logs

NA

github-actions[bot] commented 5 months ago

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:

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

OneBlue commented 4 months ago

/logs

snw1317 commented 4 months ago

WslLogs-2024-03-15_14-35-28.zip Logs attached. Thanks!

OneBlue commented 4 months ago

@keith-horton: The issue is coming from vmswitch:

717 False   Microsoft.Windows.Hyper.V.NetMgmt   NetMgmt::CreateVirtualSwitch    0   03-15-2024 12:36:21.905 "   "   "ErrorID:   -2147217406
Message:    CreateVSwitchExtensionMiniport call failed"             2996    2924    2       00000000-0000-0000-0000-000000000000        

is there anything that the user can do to work around this ?

@snw1317: You can try to disable networking via setting:

[wsl2]
networkingMode=none

In .wslconfig, but then of course WSL2 won't have networking support.

snw1317 commented 4 months ago

Disabling networking allowed the install to work, thanks! Of course, I'll be interested to see if there's a way to networking support.

keith-horton commented 3 months ago

It looks like one of the optional components did not install correctly, as this looks like a failure with NetSetup, failing to find the WMI object to create a new adapter with NDIS.

I would recommend completely removing all Hyper-V optional components - then reinstall what you need. if you have a Hyper-V VM, you'll want to take care to backup that vhd* before removing Hyper-V.

Hyper V Virtual Machine Platform Windows Hypervisor Platform Windows Sandbox Windows Subsystem for Linux

snw1317 commented 3 months ago

Well seems my computer is even struggling to remove those components. I got this when trying to remove Windows Subsystem for Linux. IMG_0897

keith-horton commented 3 months ago

Sorry - something isn't quite right with the current image you have :(

Hopefully removing all but Windows Subsystem for Linux, then re-adding Virtual Machine Platform, can fix it.

snw1317 commented 3 months ago

Yeah, that seems to be the case unfortunately. I get the same message when trying to remove just Virtual Machine Platform as well.. I guess stick to dual booting at this point.