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 does not boot with localy installed DNS server #10889

Closed
1 of 2 tasks
suikast42 opened this issue Dec 8, 2023 · 14 comments
Closed
1 of 2 tasks

WSL2 does not boot with localy installed DNS server #10889

suikast42 opened this issue Dec 8, 2023 · 14 comments

Comments

@suikast42
Copy link

Windows Version

Windows 11 Enterprise 10.0.22621

WSL Version

2.0.9.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.133.1-1

Distro Version

Ubuntu 22.04.3 LTS

Other Software

technitium dns

Repro Steps

I have installed technitium dns as windows service.

When I boot my host and try start WSL2 then the I hot the error:

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/0xffffffff
Press any key to continue...

When I turn off the DNS service start WSL2 and start the DNS server then everything is running fine. Even if I do shutdown wsl with wsl --shutdown

Expected Behavior

WSL2 starts

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/0xffffffff
Press any key to continue...

Diagnostic Logs

No response

Copy link

github-actions bot commented Dec 8, 2023

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:

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

@OneBlue
Copy link
Collaborator

OneBlue commented Dec 11, 2023

/logs

Copy link
Contributor

Hello! Could you please provide more logs to help us better diagnose your issue?

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 scipt will output the path of the log file once done.

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

Click here for more info on logging

Thank you!

Copy link
Contributor

This issue has been automatically closed since it has not had any author activity for the past 7 days. If you're still experiencing this issue please re-open it.

Thank you!

@tinkerrc
Copy link

tinkerrc commented Jan 6, 2024

I experience the same issue on Windows Pro build 22631.2861 & WSL2. I'm using Acrylic DNS Proxy and WSL distro fails to start with the same error. Stopping the service allows the distro to start, then starting the service afterwards doesn't interfere with WSL.

@tinkerrc
Copy link

tinkerrc commented Jan 6, 2024

Here's the logs:
WslLogs-2024-01-06_10-37-59.zip

@OneBlue
Copy link
Collaborator

OneBlue commented Jan 9, 2024

Here's the root cause:

1528	False	Microsoft.Windows.Hyper.V.NetMgmt	NetMgmt::GetNetworkAdapterType	0	01-06-2024 10:38:29.747	"	"	"Adapter: 	{279ACCDE-1C2A-493F-B760-8D7959ED3291}
ErrorID: 	-2147217406
Message: 	netcfg->FindNetworkAdapterWithInstanceGuid returned an error"				3912	3736	2		00000000-0000-0000-0000-000000000000		

@keith-horton: Is a known issue ?

@OneBlue OneBlue added the network label Jan 9, 2024
@keith-horton
Copy link
Member

Sorry, that's not the root cause. The original source of the failure is this:

2064 03912.03244 2024-01-06T10:38:28.920 [Microsoft-Windows-Host-Network-Service] 'IpICSHlpStartDnsServer' : '0xFFFFFFFF'.
2065 03912.03244 2024-01-06T10:38:28.920 [Microsoft-Windows-Host-Network-Service] ActivityError: PartA_PrivTags=16777216 wilActivity={ hresult=4294967295, ... }

@oakrc , can you please see if the shared access service is running. From the traces we have, it looks like attempts to RPC to that service are failing.

sc query sharedaccess

We'll need network logs to hopefully pinpoint what failed. https://github.com/microsoft/WSL/blob/master/diagnostics/collect-networking-logs.ps1

Thanks!

@notseb
Copy link

notseb commented Jan 15, 2024

I had the same issue with Win 11 Pro 22000.2538 and Technitium DNS Server.
WslLogs-2024-01-15_08-58-53.zip
Stopping the service/Uninstalling fixes it.

@johnrix
Copy link

johnrix commented Feb 8, 2024

Same problem for me with Technitium also.
WslLogs-2024-02-08_22-37-36.zip

PS C:\Users\john> sc query sharedaccess

SERVICE_NAME: sharedaccess
TYPE : 30 WIN32
STATE : 4 RUNNING
(STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0

@keith-horton
Copy link
Member

This looks to be failing because SharedAccess is trying to bind to 0.0.0.0:53, but something is already bound to that port. If Technitium runs a DNS Server, then that would prevent WSL to start in this mode.

If you are on Windows 11, you can use dnsTunneling instead (which is actually more reliable).

@johnrix
Copy link

johnrix commented Mar 27, 2024

I'm not 100% certain what DNS tunnelling will do for me off-hand. I see a few posts about it being added last year, and now being enabled by default, but I didn't find a clear explanation of how it works or how to make use of it. Do you have a link handy?

My use case for Technitium is to define wildcard subdomains that all route to my WSL instance that is running my development web server. Can DNS tunnelling step in and address that?

In any case, I did find after my earlier post above that switching Technitium to bind to 127.0.0.1:53 instead of 0.0.0.0:53 solved the start up issue for me, which is consistent with your summation above.

@keith-horton
Copy link
Member

DNS Tunneling helps in a couple of ways.

  1. it does not require anything binding on the host, which helps interop with other software that might want to bind to port 53.
  2. it doesn't require firewall rules to allow the inbound packet to sharedaccess (we try to create the rule, but there are many firewall policies which can end up blocking that traffic).

Your solution also works - binding to a more precise address than 0.0.0.0 should effectively allow both to coexist.
Thanks!

@johnrix
Copy link

johnrix commented Mar 27, 2024

Would I be able to set up that wildcard A record as described with DNS tunnelling? Although Technitium is fine at the moment, I would be happy to remove it from my toolchest if I can achieve the same without it.

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

No branches or pull requests

6 participants