tldr; Check that the HNS is not disabled, sc.exe qc hns to check, sc.exe config hns start= auto to enable, Start-Service hns to start.

I work in a Windows environment by necessity, not by choice. The Windows Subsystem for Linux is a key part of my ability to work productively.

However, I’ve now come across several instances of this irritating error:

wsl: Failed to configure network

And the culprit twice has been HNS, the Host Network Service. As a mechanical engineering pleb, I don’t know much networking, but it’s related to setting up virtual networks and since WSL 2 is running in a VM, it needs these types of virtual networks.

Essentially fixed by running the following series of commands (PowerShell as admin)

wsl --shutdown                # Shut down any live WSL instances
sc.exe qc hns                 # Check if hns is disabled
sc.exe config hns start= auto # Try to configure so it doesn't happen again
Start-Service hns             # Start it back up

I’m thinking our IT management company pushes some policies or updates that periodically break this. But until then, at least this should bring me back up quickly.

Shout out to Codex 5.2 for the help.