Skip to content
DnsLister Forum

Where domain hunters compare notes

Fix for WSL mirrored networking error CreateInstance/CreateVm/ConfigureNetworking/0x8007054f

I was getting this WSL error repeatedly:

wsl: An internal error occurred. Error code: CreateInstance/CreateVm/ConfigureNetworking/0x8007054f wsl: Failed to configure network (networkingMode Mirrored), falling back to networkingMode None. 

My .wslconfig was:

[wsl2] networkingMode=mirrored dnsTunneling=true 

WSL itself would still start, but mirrored networking would fail and fall back to networkingMode=None.

For my setup, switching away from mirrored networking wasn't really an acceptable workaround. I run some MCP servers/services inside WSL that need to be accessed from Windows and the other way around, and some of them don't work properly or aren't reachable the same way when WSL is using the default NAT-style networking.

With mirrored mode, Windows ↔ WSL localhost/network communication works much more cleanly for these services, so I specifically needed to get networkingMode=mirrored working again rather than just changing the networking mode.

I tried the usual things:

  • wsl --shutdown
  • restarting WSL multiple times
  • restarting hns
  • restarting vmcompute
  • upgrading, downgrading and trying pre-release WSL versions
  • checking that VirtualMachinePlatform, Microsoft-Windows-Subsystem-Linux, and HypervisorPlatform were enabled

None of those fixed it reliably.

The actual problem

I found this WSL GitHub issue/comment:

https://github.com/microsoft/WSL/issues/41251#issuecomment-5188667183

It pointed to the Windows TCP dynamic port range.

I checked mine with Administrator PowerShell:

netsh int ipv4 show dynamicport tcp netsh int ipv6 show dynamicport tcp 

My dynamic TCP port range had been changed to essentially the whole port space.

If you see something similar to:

Start Port : 1024 Number of Ports : 64511 

that may be what is breaking WSL mirrored networking.

I restored the normal Windows dynamic TCP port range:

netsh interface ipv4 set dynamicportrange protocol=tcp startport=49152 numberofports=16384 netsh interface ipv6 set dynamicportrange protocol=tcp startport=49152 numberofports=16384 

Then I did a full Windows reboot.

After rebooting:

wsl -d Ubuntu-24.04 

Mirrored networking started normally again.

No more:

CreateInstance/CreateVm/ConfigureNetworking/0x8007054f 

and no more:

Failed to configure network (networkingMode Mirrored) 

My Windows-hosted apps can also reach the MCP servers/services I run inside WSL normally again.

TL;DR

Check:

netsh int ipv4 show dynamicport tcp netsh int ipv6 show dynamicport tcp 

If the range has been changed to something huge like:

1024 / 64511 

restore it:

netsh interface ipv4 set dynamicportrange protocol=tcp startport=49152 numberofports=16384 netsh interface ipv6 set dynamicportrange protocol=tcp startport=49152 numberofports=16384 

Then reboot Windows.

This completely fixed the WSL mirrored networking 0x8007054f error for me.

Posting this because I spent a ridiculous amount of time restarting WSL/HNS and chasing Hyper-V issues. In my case the problem was the Windows dynamic TCP port range, and simply falling back to normal WSL networking wasn't a good option because I need reliable Windows → WSL access for MCP servers.

Source: r/bashonubuntuonwindows · by /u/iSemiOG

Leave a Reply

Your email address will not be published. Required fields are marked *