Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error code: Wsl/Service/CreateInstance/CreateVm/ConfigureNetworking/HNS/0x80041002 #12022

Open
1 of 2 tasks
convergerutley opened this issue Sep 11, 2024 · 6 comments
Open
1 of 2 tasks
Labels

Comments

@convergerutley
Copy link

Windows Version

Microsoft Windows [Version 10.0.22631.4169]

WSL Version

2.2.4.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.153.1-2

Distro Version

Kali

Other Software

No response

Repro Steps

Running wsl, kali, or docker engine

Expected Behavior

WSL distro to start

Actual Behavior

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

Diagnostic Logs

I have sent my logs to [email protected] with the subject line "WslLogs-2024-09-11_12-29-53 GitHub Issue"

Copy link

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'.
Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs

Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The script will output the path of the log file once done.

If this is a networking issue, please use collect-networking-logs.ps1, following the instructions here

Once completed please upload the output files to this Github issue.

Click here for more info on logging
If you choose to email these logs instead of attaching to the bug, please send them to [email protected] with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.

View similar issues

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@convergerutley
Copy link
Author

I have emailed the files.

@CatalinFetoiu
Copy link
Collaborator

thanks for reporting the issue. can you please collecting networking logs using instructions below?

download https://github.com/microsoft/WSL/blob/master/diagnostics/collect-networking-logs.ps1
run .\collect-networking-logs.ps1 -RestartWslReproMode $True
start WSL
stop collect-networking-logs.ps1
share the zip generated by the script

@Raven-Singularity
Copy link

Did you by any chance install VMware Workstation?

That broke my WSL networking, even after uninstalling VMware. It left behind a registry key which prevented virtual network adapters from being created.

This is the registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{3d09c1ca-2bcc-40b7-b9bb-3f3ec143a87b}

After removing this registry key, then clicking Network Reset on the Networking Control Panel page, my system came back up with WSL2 able to start a virtual network again.

Maybe try a Network Reset, and if that doesn't work, check if you have that registry key and remove it, then reboot.

To be clear: the issue is that there is that WSL is unable to create a Hyper-V virtual networking adapter for WSL to connect to the Internet with.

If you don't actually need the Internet, you can disable WSL networking by adding this to C:\Users\YourUserName.wslconfig:

[wsl2]
wsl2.networkingMode=None

@MatthewSteeples
Copy link

I was having the same error. Have never had VMWare installed and don't have the registry key mentioned above. I had to tweak the WSL config to say the following (not quite what's written above). Obviously that leaves me without network but that's fine for my use case. I also have the 2024-09 preview installed.

[wsl2]
networkingMode=None

@psynyde
Copy link

psynyde commented Oct 11, 2024

As a note from a Nix Wsl user. if anyone facing the same issue and want internet to work with it:

  • create .wslconfig in your windows userdir. (type cd ~ in powershell and enter)
  • put the code below inside the config file:
[wsl2]
networkingMode=mirrored
  • put the code below in your configuration.nix:
wsl.usbip.snippetIpAddress = "127.0.0.1";
  • install usbipd with winget install usbipd
  • reboot windows for good measures

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants