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

WSL2 fails to start with Error code: Wsl/Service/CreateInstance/CreateVm/ConfigureNetworking/HNS/0x80070424 #10755

Closed
1 of 2 tasks
raulpedroche opened this issue Nov 15, 2023 · 46 comments

Comments

@raulpedroche
Copy link

Windows Version

Microsoft Windows [Versión 10.0.22621.2428]

WSL Version

2.0.9.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

No response

Distro Version

Ubuntu 22.04

Other Software

No response

Repro Steps

Try to start WSL from command line.

Expected Behavior

WSL starts and we have access to Linux shell.

Actual Behavior

WSL throws an error about not being able to setup the network and drops to PowerShell again:

PS C:\Users\rpedroche> wsl
No se pudo configurar la red (networkingMode Nat). Para deshabilitar las redes, establezca "wsl2.networkingMode=None" en C:\Users\rpedroche\.wslconfig
Error code: Wsl/Service/CreateInstance/CreateVm/ConfigureNetworking/HNS/0x80070424
PS C:\Users\rpedroche>

This happens since today's update to 2.0.9.0.

Diagnostic Logs

WslLogs-2023-11-15_10-06-57.zip

Copy link

Hi I'm an AI powered bot that finds similar issues based off the issue title.

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. Thank you!

Open similar issues:

Closed similar issues:

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

@marcomezzaro
Copy link

Hi, I've resolved with these steps:

I have only WSL, no vm no hyper-v machines and other virtualization tool.
Take care of possible side effects or issues with the removal of hyper-v services

  1. removed Optional Features: Hyper-v platform and Hyper-V managment tool
  2. reboot
  3. start WSL: it will ask to install virtual platform service. confirm to install
  4. reboot
  5. wsl works

let me know if these steps also work for you.

Regards.

@fenglielie
Copy link

same issue, after windows update

image

image

@craigemery
Copy link

+1 after a Windows update

@karpikpl
Copy link

Hi, I've resolved with these steps:

I have only WSL, no vm no hyper-v machines and other virtualization tool. Take care of possible side effects or issues with the removal of hyper-v services

  1. removed Optional Features: Hyper-v platform and Hyper-V managment tool
  2. reboot
  3. start WSL: it will ask to install virtual platform service. confirm to install
  4. reboot
  5. wsl works

let me know if these steps also work for you.

Regards.

that helped

@raulpedroche
Copy link
Author

Hi, I've resolved with these steps:

I have only WSL, no vm no hyper-v machines and other virtualization tool. Take care of possible side effects or issues with the removal of hyper-v services

  1. removed Optional Features: Hyper-v platform and Hyper-V managment tool
  2. reboot
  3. start WSL: it will ask to install virtual platform service. confirm to install
  4. reboot
  5. wsl works

let me know if these steps also work for you.

Regards.

It has fixed the problem for me too.

@TheJCAB
Copy link
Member

TheJCAB commented Nov 15, 2023

Same here. I see it after the computer got rebooted by WU for installing KB5032883, KB5032007 and KB5032190 (not sure which would be the relevant one here).

Problem is... I do use Hyper-V in this machine and I don't feel comfortable just removing it. Is there any other suggestion?

@beam
Copy link

beam commented Nov 15, 2023

Closed? Issue is still there..

@raulpedroche
Copy link
Author

Same here. I see it after the computer got rebooted by WU for installing KB5032883, KB5032007 and KB5032190 (not sure which would be the relevant one here).

Problem is... I do use Hyper-V in this machine and I don't feel comfortable just removing it. Is there any other suggestion?

I also use Hyper-V. Enabling it again and a third reboot restore the Hyper-V virtual machines.

@hatuhay
Copy link

hatuhay commented Nov 15, 2023

Disable Hyper-V
Enable the Virtual Machine.
Reboot and problem solved.
This means that WSL2 is not only not compatible with Hyper-V, but also conflicts with it.

@CyberSpock
Copy link

I'm a VirtualBox user so I couldn't remove Hyper-V. But I found I didn't have Virtual Machine or Hypervisor installed now and I can't remember if they were. Once I check them off and rebooted, I could start Ubuntu without the network error message. However, it started in root. To fix this I issued the following in Admin Powershell: ubuntu config --default-user (your user id)

@Foritus
Copy link

Foritus commented Nov 16, 2023

I manually re-enabled Virtual Machine platform and that un-bricked things after the Windows Update caused the above problem. Now WSL starts up but it now starts as root instead of my usual user, how bizarre :D (su myuser is a workaround for now).

@Foritus
Copy link

Foritus commented Nov 16, 2023

Resetting Ubuntu back to default via wsl --setdefault Ubuntu in powershell solved the "default user is root" issue (despite Ubuntu being the only distro I have installed, god knows what screwed up the WSL config so badly in this update)

@rcarde
Copy link

rcarde commented Nov 16, 2023

I manually re-enabled Virtual Machine platform and that un-bricked things after the Windows Update caused the above problem. Now WSL starts up but it now starts as root instead of my usual user, how bizarre :D (su myuser is a workaround for now).

This worked for me. No apparent side-effects on existing VMs. No reboot needed.

I too had the default user as root. I had to use <dist>.exe config --default-user <user> to reset it.

@CyberSpock
Copy link

Now WSL starts up but it now starts as root instead of my usual user, how bizarre :D (su myuser is a workaround for now).

To fix this I issued the following in Admin Powershell: ubuntu config --default-user (your user id)

@juliwang0205
Copy link

Hi, I've resolved with these steps:

I have only WSL, no vm no hyper-v machines and other virtualization tool. Take care of possible side effects or issues with the removal of hyper-v services

  1. removed Optional Features: Hyper-v platform and Hyper-V managment tool
  2. reboot
  3. start WSL: it will ask to install virtual platform service. confirm to install
  4. reboot
  5. wsl works

let me know if these steps also work for you.

Regards.

Hi, I've resolved with these steps:

I have only WSL, no vm no hyper-v machines and other virtualization tool. Take care of possible side effects or issues with the removal of hyper-v services

  1. removed Optional Features: Hyper-v platform and Hyper-V managment tool
  2. reboot
  3. start WSL: it will ask to install virtual platform service. confirm to install
  4. reboot
  5. wsl works

let me know if these steps also work for you.

Regards.

That helps me, Thanks.

@michaltorun
Copy link

Hi, I've resolved with these steps:

I have only WSL, no vm no hyper-v machines and other virtualization tool. Take care of possible side effects or issues with the removal of hyper-v services

  1. removed Optional Features: Hyper-v platform and Hyper-V managment tool
  2. reboot
  3. start WSL: it will ask to install virtual platform service. confirm to install
  4. reboot
  5. wsl works

let me know if these steps also work for you.

Regards.

Thank you Marco! You saved my day!

@MaxDesignFR
Copy link

MaxDesignFR commented Nov 16, 2023

Hi, I've resolved with these steps:
I have only WSL, no vm no hyper-v machines and other virtualization tool. Take care of possible side effects or issues with the removal of hyper-v services

  1. removed Optional Features: Hyper-v platform and Hyper-V managment tool
  2. reboot
  3. start WSL: it will ask to install virtual platform service. confirm to install
  4. reboot
  5. wsl works

let me know if these steps also work for you.
Regards.

Worked for me too (step 3 specifically is in windows terminal: wsl.exe --install --no-distribution).

How did they manage to push this update in production and just forget about WSL2 users? 🤡 Breaking our systems to push half-baked features (the multi-desktop transition effect still needs a good polish).

@westerguard
Copy link

I manually re-enabled Virtual Machine platform and that un-bricked things after the Windows Update caused the above problem. Now WSL starts up but it now starts as root instead of my usual user, how bizarre :D (su myuser is a workaround for now).

This worked for me without the user issue.

@kakadeguaidao
Copy link

Hi, I've resolved with these steps:

I have only WSL, no vm no hyper-v machines and other virtualization tool. Take care of possible side effects or issues with the removal of hyper-v services

  1. removed Optional Features: Hyper-v platform and Hyper-V managment tool
  2. reboot
  3. start WSL: it will ask to install virtual platform service. confirm to install
  4. reboot
  5. wsl works

let me know if these steps also work for you.

Regards.

appreciated!It works for me and helps me a lot.

@vdavidoff
Copy link

vdavidoff commented Nov 17, 2023

This isn't working for me on Windows 11. It started after I rebooted for updates.

  1. Hyper-V was NOT enabled, and best I know, it never was. I enabled it and rebooted and the problem persisted.
  2. I disabled Hyper-V and rebooted and the problem persisted.
  3. I ran wsl --install --no-distribution with Hyper-V disabled and it simply said the operation completed successfully without doing anything, best I could tell. I rebooted and the problem persisted.
  4. I disabled Virtual Machine Platform and rebooted. The OS indicated I needed to enable features for WSL to work, and it enabled VMP, and I rebooted. The problem persisted.
  5. Fully uninstalled WSL (best I could figure how), reinstalled, problem persisted.
  6. Played with Hyper-V and firewall settings as noted below, problem persisted.

Happy to provide logs and such if someone can tell me what they need and how to get it.

Thanks.

@jtabox
Copy link

jtabox commented Nov 17, 2023

I was also having issues after the latest update, I had no network at all. The solution above about Hyper-V completely solved the issue for me too, and I'm on Windows 11 Pro. I didn't even have to uninstall the other virtualization-related features.

Read the comment I made in another thread, in case it gives you some idea to solve your issue.

#10774 (comment)

Edit:
I now read the following in the WSL networking documentation (https://learn.microsoft.com/en-us/windows/wsl/networking):

On machines running Windows 11 22H2 and higher, with WSL 2.0.9 and higher, the Hyper-V firewall feature will be turned on by default.

Clicking the link about Hyper-V firewall default settings (https://learn.microsoft.com/en-us/windows/security/operating-system-security/network-security/windows-firewall/hyper-v-firewall) and running the command suggested there, those are the default values for me:

C:\Get-NetFirewallHyperVVMSetting -PolicyStore ActiveStore -Name '{40E0AC32-46A5-438A-A0B2-2B479E8F2E90}'

Name                  : {40E0AC32-46A5-438A-A0B2-2B479E8F2E90}
Enabled               : True
DefaultInboundAction  : Block
DefaultOutboundAction : Block
LoopbackEnabled       : True
AllowHostPolicyMerge  : True

I can't stop my WSL distro atm, but when I can, I will try changing the DefaultInboundAction and DefaultOutboundAction settings, in case it makes any difference when having Hyper-V installed too.

@aalku
Copy link

aalku commented Nov 18, 2023

I just run "OptionalFeatures.exe" and then enabled "Virtual Machine Platform" and that's it. No additional steps before or after.

@juparog
Copy link

juparog commented Nov 19, 2023

The following steps were used to solve the problem with wsl Error code: Wsl/Service/CreateInstance/CreateVm/ConfigureNetworking/HNS/0x80070424 on my Windows 11 after applying a windows update.

  • disable Hyper-V and reboot the system, you can do this by running the following command as administrator in powershell:
    Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V
  • After the reboot try to start wsl normally, if it does not start it will most likely ask you to execute the command:
    wsl.exe --install --no-distribution
  • Reboot the system again and with this you could start wsl normally.

Greetings,

@GaussianGuaicai
Copy link

I just run "OptionalFeatures.exe" and then enabled "Virtual Machine Platform" and that's it. No additional steps before or after.

This work for me!
some how "Virtual Machine Platform" was no enable in my case, but i am sure it was enable before one of the Windows Updates; it work by just enable it, don`t even need to reboot.

@roboalex123
Copy link

I just run "OptionalFeatures.exe" and then enabled "Virtual Machine Platform" and that's it. No additional steps before or after.

This worked, nice job!

@YY-Edwards
Copy link

The following steps were used to solve the problem with wsl Error code: Wsl/Service/CreateInstance/CreateVm/ConfigureNetworking/HNS/0x80070424 on my Windows 11 after applying a windows update.

  • disable Hyper-V and reboot the system, you can do this by running the following command as administrator in powershell:
    Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V
  • After the reboot try to start wsl normally, if it does not start it will most likely ask you to execute the command:
    wsl.exe --install --no-distribution
  • Reboot the system again and with this you could start wsl normally.

Greetings,

it works for me(On Win11)

@adambirds
Copy link

does anyone else have two wsl services listed in services.msc after this issue? One that won't start and apparently doesn't exist.

@adambirds
Copy link

Mine just keeps doing this:
image

@adambirds
Copy link

Oh, turns out mine was caused by #10764 actually, what is with windows update breaking so many things with wsl

@loverchun
Copy link

marcomezzaro

That helps me a lot, thank you~

@hsakada321
Copy link

Hi, I've resolved with these steps:

I have only WSL, no vm no hyper-v machines and other virtualization tool. Take care of possible side effects or issues with the removal of hyper-v services

1. removed Optional Features: Hyper-v platform and Hyper-V managment tool

2. reboot

3. start WSL: it will ask to install virtual platform service. confirm to install

4. reboot

5. wsl works

let me know if these steps also work for you.

Regards.

Just throwing this out there in case anyone else hits the same headache. This was not working for me at first, for some reason I had to also run WSL with my VPN connection turned off after disabling this. After that, it now starts regardless of if the VPN is off or not, but does not work if Hyper-v is reenabled.

@loverchun
Copy link

loverchun commented Dec 1, 2023 via email

@psyll0n
Copy link

psyll0n commented Dec 8, 2023

The following steps were used to solve the problem with wsl Error code: Wsl/Service/CreateInstance/CreateVm/ConfigureNetworking/HNS/0x80070424 on my Windows 11 after applying a windows update.

  • disable Hyper-V and reboot the system, you can do this by running the following command as administrator in powershell:
    Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V
  • After the reboot try to start wsl normally, if it does not start it will most likely ask you to execute the command:
    wsl.exe --install --no-distribution
  • Reboot the system again and with this you could start wsl normally.

Greetings,

it works for me(On Win11)

This also resolved the issue for me. Thanks!

powershell:

Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V
  • After the reboot try to start wsl normally, if it does not start it will most likely ask you to execute the command:
wsl --install ubuntu

@frank-garcia-dev
Copy link

Hi, I've resolved with these steps:

I have only WSL, no vm no hyper-v machines and other virtualization tool. Take care of possible side effects or issues with the removal of hyper-v services

  1. removed Optional Features: Hyper-v platform and Hyper-V managment tool
  2. reboot
  3. start WSL: it will ask to install virtual platform service. confirm to install
  4. reboot
  5. wsl works

let me know if these steps also work for you.

Regards.

This work for me, thanks

@Chandler-Fei
Copy link

Hi, I've resolved with these steps:

I have only WSL, no vm no hyper-v machines and other virtualization tool. Take care of possible side effects or issues with the removal of hyper-v services

  1. removed Optional Features: Hyper-v platform and Hyper-V managment tool
  2. reboot
  3. start WSL: it will ask to install virtual platform service. confirm to install
  4. reboot
  5. wsl works

let me know if these steps also work for you.

Regards.

Thanks

@princeo
Copy link

princeo commented Feb 11, 2024

I had various errors that meant wsl had suddenly stopped working. In the end it was because I was using Acrylic DNS Proxy - it uses port 53 to run a dns proxy service. I spent days till I came across a stack overflow entry that showed me the problem. At that point I had uninstalled wsl and strugging to resintall it. Once I disabled Acrylic DNS Proxy, I managed to reinstall wsl.

I use docker desktop and that wouldnt run would wsl, so once I fixed wsl everything works.
#5214

@loverchun
Copy link

loverchun commented Feb 11, 2024 via email

@vivekbajaj
Copy link

Same error but not resolved with above methods:
Failed to configure network (networkingMode Nat). To disable networking, set wsl2.networkingMode=None in C:\Users\Vivek Bajaj.wslconfig
Error code: Wsl/Service/CreateInstance/CreateVm/ConfigureNetworking/HNS/ERROR_FILE_NOT_FOUND

@vivekbajaj
Copy link

Screenshot 2024-02-18 171359

@vivekbajaj
Copy link

WSL version: 2.0.14.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.22621.3155

@vivekbajaj
Copy link

Updates

@Stepych
Copy link

Stepych commented Apr 22, 2024

Fixed on Windows 10 with shutting down PrivateInternetAccess VPN. It was auto-starting and auto-connecting.

@loverchun
Copy link

loverchun commented Apr 22, 2024 via email

@lukas-santiago
Copy link

lukas-santiago commented May 9, 2024

Fixed on Windows 11 with wsl2.networkingMode = mirrored in .wslconfig file. This have some disadvantages cause actually doesn't solve the issue with virtual NAT networking creation but it can connect externally.

@loverchun
Copy link

loverchun commented May 9, 2024 via email

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

No branches or pull requests