dockerubuntuwindows-subsystem-for-linuxdocker-desktop

ubuntu wslregisterdistribution failed with error: 0x80041002


I am attempting to install Ubuntu as a Windows distro on top of WSL-2 Kernel. Here are the steps I take:

  1. I download the Linux Kernel Update package from this URL -> https://learn.microsoft.com/en-us/windows/wsl/install-manual#step-4---download-the-linux-kernel-update-package
  2. I turn on Windows features "Windows subsystem for Linux"; "Virtual Machine Platform"
  3. I restart machine and also ensure virtualization is enabled within my BIOS
  4. I install Ubuntu from Microsoft Store. (I've tried 3 different versions of Ubuntu).
  5. I run Ubuntu as an Administrator

When I run Ubuntu as Admin, I always get this below error:

"ubuntu wslregisterdistribution failed with error: 0x80041002"

I have scoured the net for fixes, but there is little on this error that doesn't simply pertain to a Windows update. The ONLY action that has resolved this is setting the wsl --set-default-version to "1" as the default is 2. When I downgrade to wsl-1, Ubuntu launches fine.

However, from my research and experience, I cannot run Docker Desktop using wsl-1 as it requires version 2.

When I run Ubuntu with wsl-1 and then type command "wsl -l -v", it does indeed say the following:

  NAME      STATE           VERSION
* Ubuntu    Running         1

I believe the Docker portion should be separated from the above-mentioned issue with Ubuntu/wsl, however, as my goal is to simply run the Docker Engine in DD, I'll include the below information as well with regards to Docker Desktop:

I am attempting to run Docker Desktop on Windows 11 Enterprise. Docker engine always fails to start and I believe the issue lies with WSL/Ubuntu as described above as I cannot run Ubuntu with wsl-2. Sometimes, Docker Desktop will not launch at all, and instead displays the below error message, prompting me to reset to factory defaults; but I know my issue is with WSL:

System.InvalidOperationException:
Failed to deploy distro docker-desktop to C:\Users\v-kescul\AppData\Local\Docker\wsl\distro: exit code: -1
 stdout: Error: 0x80041002 

Solution

  • I think I might have the solution for you. I studied the error 0x80041002 and found out that it doesn't come from WSL2, it comes from hyper-v. The error means that since WSL2 uses hyper-v to function, hyper-v tried to create a virtual ethernet adapter but something blocked it from doing it.

    All virtual machine software will use your physical controller as a link to create a virtual network adapter, so if you have many vm software installed and you check your network connections in your control panel, you'll see that your pc has a lot of virtual ethernet adapters. And if you are having the issue 0x80041002, it means that one of your virtual adapters is blocking hyper-v from creating a new network for it.

    In my case I had installed vmware in my second hard drive and I had remove my hard drive from my pc. So the vmware virtual adapaters tried to talk to the source but it couldn't, and since it's linked to my physical controller, it blocked hyper-v from working properly.

    So check if any virtual machine software is causing this issue or a VPN, in case you have Oracle vm, vmware or VPN, try to uninstall it and try again. And maybe try to reinstall your physical network driver.