Rebuilding Ubuntu LTS on WSL2 and Interfering Docker Integrations

In an attempt to get some AMD iGPU accelerated apps to run via Ubuntu LTS on WSL2, I had to rebuild my Ubuntu LTS “VM” under WSL2.

  • I had to first remove the existing Ubuntu LTS (named “UbuntuLTS”): wsl --unregister UbuntuLTS

WARNING: Although multiple sources state that the source .vhdx file does not get deleted, it actually does get deleted for me! 🙄

  • I re-downloaded the .wsl file directly from Ubuntu, then installed the VM manually:

wsl --install --from-file "ubuntu-24.04.4-wsl-amd64.wsl" --name UbuntuLTS --location "D:\WSL\UbuntuLTS" --no-launch

Note that if you have Docker already installed, the default “distro” WSL2 may have been set to Docker’s docker-desktop:

  • set the correct default: wsl --set-default UbuntuLTS
  • run wsl.exe and it will launch into the newly created distribution, set a new (default) user and password… and ignore the stupid <3>WSL (299 - Relay) ERROR: operator():579: getpwuid(1000) failed error 🙄
    • NOTE: the error will “go away” after a wsl --shutdown and restart…


  • turn on the integration in Docker again…  and watch errors pop up…
    An error occurred while running the command. DockerDesktop/Wsl/ExecError: c:\windows\system32\wsl.exe -d -e sh -c cat - > ~/.docker/config.json: exit status 1 (stderr: , wslErrorCode: DockerDesktop/Wsl/ExecError)

Continue reading →

“Unrooting” WSL…

WSL starts as root user be default.

Here’s how to ensure it runs as a “non-root user” (assumedly already created), which you then have to su and/or sudo <something> to act as root:

  • either/and:
    • modify a shortcut or change Windows Terminal’s Profile to set the distribution (if required) and the user name, and starting in the user’s home directory:
      • wsl -d <distro> -u <user> -cd ~
    • edit /etc/wsl.conf to always start with a specific user:
      • [user]
        default=<user>

Simple! (Not!)

Windows 11 Host Network Service (HNS) and Windows Subsystem for Linux (WSL)…

For the longest time, my Ubuntu LTS 22.04 on my (forced-to-be-updated-to) Windows 11 (replete with other networking horrors) was not working properly – I could only access the Internet from within the WSL2 container when Windows Firewall was disabled.

Despite shenanigans like attempting to whitelist a whole plethora of executables:

  • C:\Windows\System32\vmcompute.exe
  • C:\Windows\System32\vmms.exe
  • C:\Windows\System32\vmwp.exe
  • C:\Windows\System32\wsl.exe
  • C:\Program Files\WSL\wsl.exe
  • C:\Program Files\WSL\wslservice.exe

Even attempting to whitelist the usual services suspects via C:\Windows\System32\svchost.exe like the following:

  • Host Network Service
  • Internet Connection Sharing (ICS)

All were to no avail. I could resolve domain names, but no traffic went out unless the host’s Windows Firewall was disabled.

I could not even see any blocked traffic from the logs, despite having the correct set up (tip: just use WFC‘s logging interface).

Searching ChatGPT and Perplexity sent me on various wild-goose chases, from changing WSL networking modes (NAT vs. “mirrored” in %USERPROFILE%/.wslconfig), to setting up dubious firewall rules referencing InterfaceAlias using New-NetFirewallRule (but which actual interface UUIDs change every boot). Continue reading →