Score:1

Cannot Install Ubuntu on WSL 2 Windows 11

bs flag

I'm trying to install Ubuntu on my Windows 11 machine and I get this error:

WslRegisterDistribution failed with error: 0xffffffff
Error: 0xffffffff (null)

System Info:

Edition Windows 11 Home Single Language 
Version 22H2 
Installed on ‎2022-‎09-‎12 
OS build 22623.1037 
Experience Windows Feature Experience Pack 1000.22638.1000.

Output of wsl --version:

WSL version: 1.0.3.0
Kernel version: 5.15.79.1
WSLg version: 1.0.47
MSRDC version: 1.2.3575
Direct3D version: 1.606.4
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp 
Windows version: 10.0.22623.1037

error image

in flag
Have you tried [this StackOverflow solution](https://stackoverflow.com/a/64217462/14952832)?
Ahnaf Ahamed avatar
bs flag
@matigo yes I checked it, my port 53 is free already
NotTheDr01ds avatar
vn flag
Keep in mind the warning that you should have received when you added the image to your post -- We do ask that you *also* include the relevant *text* [for many reasons](https://meta.stackoverflow.com/a/285557/11810933)! Thanks!
NotTheDr01ds avatar
vn flag
What does `wsl --version` show?
Ahnaf Ahamed avatar
bs flag
@NotTheDr01ds this is what I get: WSL version: 1.0.3.0 Kernel version: 5.15.79.1 WSLg version: 1.0.47 MSRDC version: 1.2.3575 Direct3D version: 1.606.4 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.22623.1037
NotTheDr01ds avatar
vn flag
@AhnafAhamed Thanks for the info - I've edited it into the question. It appears to me that `10.0.22623.1037` is a Windows Insider build -- Is this correct? I'm not sure if that could be related.
cn flag
This is a windows error not WSL or Ubuntu. All the relevanct checks to do can be found here https://github.com/microsoft/WSL/issues/4364 but a fix by microsoft is probably needed if an insider build is supposed to run WSL.
Score:1
vn flag

From the Stack Overflow question on the same error message that was reference in the comments, there were several suggestions. I'm going to add them (and some additional) here in case they help you (and others).

  • First, for others sake, this error has commonly been caused in the past when another service is running on port 53 on the Windows host. In the comments, you mention that you have already checked this on your system. However, if the following suggestions still don't work for you, this is the area that I would suggest you focus on.

  • Networking issues (which, in theory, could cause the port 53 conflict) have been seen when the user's profile is encrypted and/or compressed. As noted in the SO answer, try using File Explorer to navigate to %localappdata%\Packages\. Look for a Canonical... folder in there. The name will vary depending on which Ubuntu release you are trying to install, but you can probably be safe in changing all of these:

    Right-click on each of the Canonical... folders, click the Advanced button on the General tab and make sure that neither the Compress nor Encrypt options are selected.

  • If all else fails, the main "workaround" that has been successful for many people is to install Ubuntu under WSL1, then convert it to WSL2.

    1. Since you are on Windows 11, WSL1 may not longer be installed (it is still, currently, on Windows 10). Check it and turn it on if needed in the Turn Windows features on or off settings.

    2. From PowerShell (as a regular user, not as Administrator, despite what the Stack Overflow answer says):

      wsl --set-default-version 1
      
    3. Check if any Ubuntu is registered:

      wsl -l -v
      

      There shouldn't be, based on the above error.

    4. Run ubuntu.exe (if using "plain, unversioned" Ubuntu from the Store), ubuntu2004.exe, ubuntu2204.exe, etc.

      The registration will take slightly longer this way, but will hopefully succeed. At the completion, you'll be asked for an Ubuntu username and password.

    5. If this completes, then you can try changing the distribution to WSL2. First, exit Ubuntu. From PowerShell (again, as a regular user):

      wsl -l -v
      # Confirm the name of the distribution is "Ubuntu" and modify the next command if needed
      wsl --shutdown
      wsl --set-version ubuntu 2
      wsl ~ -d ubuntu
      
Ahnaf Ahamed avatar
bs flag
Thanks for the response. Since point 1 and 2 is all fine on my machine. I tried the 3rd method which is to install Ubuntu under WSL1, then convert it to WSL2. When I try to set the wsl version back to 2, I get this error: `There is no distribution with the supplied name. Error code: Wsl/Service/WSL_E_DISTRO_NOT_FOUND`
NotTheDr01ds avatar
vn flag
@AhnafAhamed Hmm. Does that WSL 1 distribution show with `wsl -l -v`?
Ahnaf Ahamed avatar
bs flag
Yes, it does show
NotTheDr01ds avatar
vn flag
@AhnafAhamed Odd -- Are you able to run it as a WSL1 distribution? And you've double-checked the `wsl --set-version <distro_name> 2` is using the correct name?
Ahnaf Ahamed avatar
bs flag
Yes, I am able to run it on WSL 1, seems like I used the the wrong distro name, hence the above error. Now I tried it with the correct distro name, I'm running into this error `Error: 0xffffffff` `Error code: Wsl/Service/CreateVm/ConfigureNetworking/0xffffffff`
NotTheDr01ds avatar
vn flag
@AhnafAhamed Bummer - So back to the original issue. Let me see if I can find any other ideas.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.