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

WSL can't start: Error 0x803b0017 #10483

Open
1 of 2 tasks
utkarshsethi opened this issue Sep 17, 2023 · 11 comments
Open
1 of 2 tasks

WSL can't start: Error 0x803b0017 #10483

utkarshsethi opened this issue Sep 17, 2023 · 11 comments
Labels

Comments

@utkarshsethi
Copy link

Windows Version

Microsoft Windows [Version 10.0.22621.2283]

WSL Version

1.2.5.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.90.1

Distro Version

No response

Other Software

No response

Repro Steps

➜ wsl.exe
There was an operation attempted on a degraded object.
Error code: Wsl/Service/CreateInstance/CreateVm/ConfigureNetworking/0x803b0017

after every few days, it runs into this, and the only way to fix it is to restart Windows, which is really tiresome at this point.

Having to restart Windows because WSL refuses to boot is unacceptable. It will be working 10 minutes ago but will refuse to open the next time you need it.

related issues seem to be: #10150

Expected Behavior

WSl should run.

Actual Behavior

image
image

Diagnostic Logs

WslLogs-2023-09-17_11-49-12.zip

@ghost ghost self-assigned this Sep 19, 2023
@ghost
Copy link

ghost commented Sep 19, 2023

@keith-horton,
What kinds of logs do we need if we/you/I want to dig into:
hresult: 0x803B0017
message: Entity B95D0C5E-57D4-412B-B571-18A81A16E005 is in invalid State
module: hostnetsvc.dll

@ghost ghost removed their assignment Sep 19, 2023
@ghost ghost added the network label Sep 19, 2023
@keith-horton
Copy link
Member

The trace shows the network HNS created is in a bad state.

Running this should at least unblock you:

hnsdiag delete networks B95D0C5E-57D4-412B-B571-18A81A16E005

Network : B95D0C5E-57D4-412B-B571-18A81A16E005
Name : WSL
Type : ICS
Subnet Address : 172.29.64.0/20
Gateway : 172.29.64.1

If that works, I can look to handle this error in WSL (HCN_E_DEGRADED_OPERATION)

@utkarshsethi
Copy link
Author

@keith-horton I've tried it on 3 occacions now, all it seems to do is get stuck.

@keith-horton
Copy link
Member

Sorry about this. Are you saying that running the above hnsdiag delete networks command would not unblock HNS - WSL would still fail to start with that error?

@utkarshsethi
Copy link
Author

Yes to that.
Also, the command just stays stuck with no response. Let it run overnight then just had to kill it.

and then trying to open WSL in the morning again shows:

image

@keith-horton
Copy link
Member

Can you look in your wslconfig file, or in the registry? It looks like this is trying to create a NAT but specifying a specific IP address for the container: 172.29.70.154.

Possibly look under HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\lxss --> if there are registry values for "NatNetwork" and/or "NatGatewayIpAddress".

If so, can you remove those and retry?

@chrystalis
Copy link

The trace shows the network HNS created is in a bad state.

Running this should at least unblock you:

hnsdiag delete networks B95D0C5E-57D4-412B-B571-18A81A16E005

Network : B95D0C5E-57D4-412B-B571-18A81A16E005 Name : WSL Type : ICS Subnet Address : 172.29.64.0/20 Gateway : 172.29.64.1

If that works, I can look to handle this error in WSL (HCN_E_DEGRADED_OPERATION)

@keith-horton -- FWIW, I was encountering a similar issue out of the blue today, and this fixed it for me without a reboot. Other things I tried first (which didn't fix it) were:

  • disabling/re-enabling the WSL vEthernet network interface
  • stopping/restarting ICS
  • stopping/restarting HNS

Background: I returned after a few days away, and found all my WSL2 terminals closed. I was unable to launch WSL2 (although WSL1 worked OK). No Windows updates or reboots had taken place while I was gone, although it looks like WSL itself may have been updated from 2.0.9 to 2.1.4 last night.

From the event log:

Windows Installer installed the product. Product Name: Windows Subsystem for Linux. Product Version: 2.1.4.0. Product Language: 1033. Manufacturer: Microsoft Corporation. Installation success or error status: 0.

My error trying to launch WSL2:

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

My environment:

WSL version: 2.1.4.0
Kernel version: 5.15.146.1-2
WSLg version: 1.0.60
MSRDC version: 1.2.5105
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.19045.4046

@utkarshsethi
Copy link
Author

utkarshsethi commented Mar 10, 2024

Can you look in your wslconfig file, or in the registry? It looks like this is trying to create a NAT but specifying a specific IP address for the container: 172.29.70.154.

Possibly look under HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\lxss --> if there are registry values for "NatNetwork" and/or "NatGatewayIpAddress".

If so, can you remove those and retry?

@keith-horton

I've tried deleting those records.
I still end up with:

image

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

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

I Apologise for the late reply, I haven't been using WSL as I was tired of running into this issue every few days and was just hoping to run into an update that would fix it for me.

@keith-horton
Copy link
Member

@utkarshsethi , were you able to find the HNS Network, and delete it?

e.g. 'list networks' to find the GUID for the "WSL" network. then specify that GUID to delete it.

Can you confirm if after deleting the HNS Network, if WSL can start?
If not, can you please take a WSL Networking trace?
https://github.com/microsoft/WSL/blob/master/diagnostics/collect-networking-logs.ps1

C:\Windows\System32>hnsdiag list networks
Network : C08CB7B8-9B3C-408E-8E30-5E16A3AEB444
Name : Default Switch
Type : ICS
Subnet Address : 172.31.64.0/20
Gateway : 172.31.64.1

Network : B95D0C5E-57D4-412B-B571-18A81A16E005
Name : WSL
Type : ICS
Subnet Address : 172.22.144.0/20
Gateway : 172.22.144.1

C:\Windows\System32>hnsdiag delete networks B95D0C5E-57D4-412B-B571-18A81A16E005

C:\Windows\System32>hnsdiag list networks
Network : C08CB7B8-9B3C-408E-8E30-5E16A3AEB444
Name : Default Switch
Type : ICS
Subnet Address : 172.31.64.0/20
Gateway : 172.31.64.1

C:\Windows\System32>

@utkarshsethi
Copy link
Author

utkarshsethi commented Mar 27, 2024

Screenshot 2024-03-28 050355

Did not work the first time, but did eventually work when I retried after restarting my VPN post deleting the Default Switch network (there was no WSL network).

I, unfortunately, forgot to start logging while I was facing the issue.

@utkarshsethi
Copy link
Author

This is still an issue in the exact same manner. hnsdiag to delete the WSL network just hangs the terminal, and does not cause a fix either. deleting reg entries doesn't produce any effect either. I get the exact same error at completely random times.

The only way it seems to work again is to do multiple restarts and hope it works now.

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

3 participants