WSL: WSL Networking Broken in 2.0.7

Windows Version

Microsoft Windows [Version 10.0.22631.2506]

WSL Version

2.0.7.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

Linux version 5.15.133.1-microsoft-standard-WSL2 (root@1c602f52c2e4) (gcc (GCC) 11.2.0, GNU ld (GNU Binutils) 2.37) #1 SMP Thu Oct 5 21:02:42 UTC 2023

Distro Version

Ubuntu 22.04

Other Software

No response

Repro Steps

  1. Launch a WSL instance
    • I usually do this by opening Terminal which defaults to my Ubuntu setup, but I can also repro this by just launching wsl.exe from Powershell

Expected Behavior

WSL Distro successfully starts

Actual Behavior

Following error is received

Failed to configure network (networkingMode Nat). To disable networking, set `wsl2.networkingMode=None` in C:\Users\bjgra\.wslconfig
Error code: Wsl/Service/CreateInstance/CreateVm/ConfigureNetworking/HNS/0x80070424

[process exited with code 4294967295 (0xffffffff)]
You can now close this terminal with Ctrl+D, or press Enter to restart.

Not sure how noteworthy it is but there is no .wslconfig file at the directory specified.

Diagnostic Logs

WslLogs-2023-11-07_17-30-23.zip - Launching Terminal with VMP Disabled WslLogs-2023-11-07_17-32-12.zip - After enabling VMP again

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 30
  • Comments: 70 (2 by maintainers)

Most upvoted comments

Can confirm enabling “Virtual Machine Platform” in Optional Features fixed this same issue.

I figured out my issue at least. If you have NordVPN client set to auto-connect when the computer starts, then you get the error when you try to start the terminal.

If you just disable your vpn before you try to start the terminal, then it starts ups without an error.

While I set the file in C:\Users\xx\.wslconfig as follows, the problem was fixed:

[experimental]
autoMemoryReclaim=gradual  # gradual | dropcache | disabled
networkingMode=NAT         # mirrored | NAT | None 
dnsTunneling=true
firewall=true
autoProxy=true

I can confirm that enabling VMP fixed the issue. I’ll leave this open for now in case there’s additional information you’d like to me provide, but I also don’t have a problem with this being marked as closed/resolved. Now that I’m able to get back into my WSL env, I’ve update the issue with Kernel/Distro info.

I had this problem persistent even with Virtual Machine Platform was enabled. I noticed that my Mullvad VPN wouldnt connect and it said due to VMWare conflict Turns out it was something to do with the fact I installed and then uninstalled VMWare - which setup its bridging that conflicted with wsl

This fixed it:

Open Registry Editor: Press Win + R, type regedit, and press Enter.

Navigate to the Registry Key: Go to HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID{3d09c1ca-2bcc-40b7-b9bb-3f3ec143a87b} or Go to HKEY_CLASSES_ROOT\CLSID{3d09c1ca-2bcc-40b7-b9bb-3f3ec143a87b}.

Delete the Registry Key: Right-click on {3d09c1ca-2bcc-40b7-b9bb-3f3ec143a87b} and select Delete. Confirm the deletion.

Reboot Your PC: Restart your computer to apply the changes.

Go to Network Connections: Press Win + R, type ncpa.cpl, and press Enter.

Select Your Ethernet Adapter: Find your Ethernet adapter, right-click on it, and select Properties.

Remove VMware Bridge Protocol: In the Properties window, look for VMware Bridge Protocol.

Uncheck it or select it and click Uninstall.

Exact same problem here. Enabling Virtual Machine Platform fixed it.

This worked for me (same as L-ingqin12, but firewal disabled):

[experimental]
autoMemoryReclaim=gradual  # gradual | dropcache | disabled
networkingMode=NAT         # mirrored | NAT | None 
dnsTunneling=true
firewall=false
autoProxy=true

and restart wsl using: wsl.exe --shutdown and start with wsl.exe

A potential workaround is to use bridged mode (if acceptable). It took only few minutes.

  1. created a new virtual switch using Hyper-V Manager -> Virtual Switch Manager (see below few steps)
  2. made c:\users\<USER>\.wslconfig change
[wsl2]  # omit that if you already have it. 
networkingMode=bridged
vmSwitch=wsl_switch

Create New Virtual Switch: Choose the type of virtual switch you need ( ‘External’) and click on ‘Create Virtual Switch’. Configure the Virtual Switch: Name your virtual switch (in my case I named it “wsl_switch” see above) If you chose an external switch, select the network adapter (NIC) you want to use. There will be a prompt warning about network connectivity disruption. Click ‘Yes’ if you agree to proceed.

I found https://github.com/microsoft/WSL/issues/10666 while looking through the 2.0.7 notes and it looks like I don’t have Virtual Machine Platform enabled. So I’m confused as to why this wasn’t an issue for me prior to 2.0.7 (is the version returned by wsl.exe --version wrong on the Microsoft Store provided version of WSL?) and, assuming MSS versioning isn’t wrong, it appears the fix in 2.0.7 does not work.

@KubeDevMax I eventually rolled back to WSL1 in order to avoid the Hyper-V problem, and then it worked

https://github.com/microsoft/WSL/issues/12019

I have this issue and none of the workarounds (I tried them all) worked.

I was getting errors when loading up WSL, same message error asking me to load with no network, error: 0xffffffff Turns out the problem is when an application is running on port 53 it messes with WSL Getting to resmon on win+r then network tab, listening port sections and killing the app running on port 53 solved for me.

Downgrading to 2.0.4 fixes it for me

If you have a vpn. turn it of.

I have this issue suddently. But since I have no change on system and VMP is always on, just restarted system and then OK.

+1

I have this issue suddently. But since I have no change on system and VMP is always on, just restarted system and then OK.

I had the same issue here after installing the 2024-03 Cumulative Update for Windows 11 Version 23H2 (KB5035853) update.

@MikeS1042 's answer prompted me to look at the Technitium DNS server I have set up for “at home DNS”. Stopping Technitium, starting WSL, then restarting technitium, seemed to resolve things. the .wslconfig file made no difference.

I had this same error although the error code was different at the end. Mine read

Error code: Wsl/Service/CreateInstance/CreateVm/ConfigureNetworking/HNS/0xffffffff

Turned out my DNS proxy I had installed for development was messing things up (I am using Acyrlic DNS Proxy). When I stopped this it all worked.

I figured out my issue at least. If you have NordVPN client set to auto-connect when the computer starts, then you get the error when you try to start the terminal.

If you just disable your vpn before you try to start the terminal, then it starts ups without an error.

you are amazing and i love you thank you so much this has been very hard to troubleshoot but your answer did it!

I have enabled the VMP and the VPN was disabled. image But the issue is still there.

PS C:\WINDOWS\system32> wsl --version
WSL version: 2.0.9.0
Kernel version: 5.15.133.1-1
WSLg version: 1.0.59
MSRDC version: 1.2.4677
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22000.2538
PS C:\WINDOWS\system32> wsl
Failed to configure network (networkingMode Nat). To disable networking, set `wsl2.networkingMode=None` in C:\Users\lab\.wslconfig
Error code: Wsl/Service/CreateInstance/CreateVm/ConfigureNetworking/HNS/0xffffffff 

How can I fix this? Please help me out!

TL;DR; VMP is enabled on my machine and I still have the issue.

I’m getting the same issue, but I already had (and still have) “Virtual Machine Platform” installed. WSL worked fine when I first installed it yesterday, but later in the day this same bug came up. I somehow got the error to go away by disabling VMP, restarting the computer, running wsl --install --no-distribution (which reenabled VMP), and restarting the computer again. However, the bug came up again today and I haven’t been able to make it go away.

My WSL version is 2.0.9.0, and I’m happy to provide logs if you need.

Failed to configure network (networkingMode Nat). To disable networking, set wsl2.networkingMode=None in C:\Users\asdf.wslconfig Error code: Wsl/Service/CreateInstance/CreateVm/ConfigureNetworking/HNS/0x80072736

[process exited with code 4294967295 (0xffffffff)] You can now close this terminal with Ctrl+D, or press Enter to restart.

Could you please follow the steps below and attach the diagnostic logs? https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#collect-wsl-logs-for-networking-issues

@chanpreetdhanjal Can you please read the rest of the comment thread where you can see that logs were already requested and provided?

Same problem after upgrading from WSL version 1.2.5.0 to 2.0.9 (“Failed to configure network (networkingMode Nat). To disable networking, set wsl2.networkingMode=None …”). Fixed by installing VMP. Survives wsl --shutdown. Notable, and that’s why I am posting here: On the first launch of wsl after installing VMP, I got this:

wsl: Failed to create virtual network with address range: '172.24.224.0/20', created new network with range: '172.18.16.0/20', The object already exists.
wsl: Failed to create network endpoint with address: '172.24.224.3', assigned new address: '172.18.31.109'

Could ping 8.8.8.8 as well as google.com with no problem.

Just in case this helps understanding what may be going on.