Repository navigation
Description
Windows Version
Microsoft Windows [Version 10.0.26300.9974]
WSL Version
3.0.5.0 (stock), also reproduced with a local 3.0.6.0 build from microsoft/WSL main
Are you using WSL 1, WSL 2, or WSLC?
WSL 2
Kernel Version
6.18.58.1-1
Distro Version
Ubuntu 26.04
Other Software
Host networking is HNS (hostnetsvc.dll 10.0.26100.9949, in-box Windows component). A third-party routing/VPN application installed ~25k static routes on one host adapter, all with Protocol = MIB_IPPROTO_NETMGMT.
Repro Steps
- On the host, have an adapter with a large static route table. In our environment one adapter had 25,409 static routes (9,858 IPv4 + 15,551 IPv6); the whole machine had 25,496 routes. Any routing/VPN application can create this, or use the synthetic route-generation script in the linked HNS issue.
- Set
networkingMode=mirroredin%UserProfile%\.wslconfig. - Run
wsl --shutdown, then start a distro. - Observe that startup takes minutes; while it is stuck, the guest only has
lo(no eth, no routes, no/mnt/wsl/resolv.conf). - Attach a debugger to
wslservice.exeand dump all thread stacks while it is stuck.
Expected Behavior
Mirrored networking initializes in seconds and the guest receives the mirrored interfaces and routes. WSL startup and shutdown should not scale with the host route count.
Actual Behavior
- Cold start: 536 s with 25,409 host routes vs 3.7 s with 8 routes.
wsl --shutdown: 477 s with 25,409 host routes vs 1.6 s with 8 routes.
While blocked, wslservice.exe is in:
wslservice!wsl::core::networking::WslMirroredNetworkManager::AddEndpointImpl
wslservice!wsl::core::networking::WslMirroredNetworkManager::AddEndpoint
wslservice!wsl::core::MirroredNetworking::AddNetworkEndpoint
-> HcnModifyEndpoint
RPCRT4!NdrClientCall3
RPCRT4!LRPC_BASE_CCALL::SendReceive
ntdll!NtAlpcSendWaitReceivePort
At the same moment, HNS is in:
hostnetsvc!HNS::Service::Network::MirroringCore::BootstrapNetworkRoute
hostnetsvc!HNS::Service::Common::Notify::GetStaticRoutes
hostnetsvc!HNS::Service::Common::Notify::GetRoute
IPHLPAPI!InternalGetIpForwardEntry2
NSI!NsiAllocateAndGetTable
ntdll!NtDeviceIoControlFile
GetStaticRoutes already has a full MIB_IPFORWARD_ROW2 snapshot, but calls GetRoute(&row, /*refresh=*/true) for every matching route; GetRoute then calls GetIpForwardEntry2, which re-enumerates the entire NSI route table. The cost is O(routes Γ table size).
HNS also calls GetRoute from NotifyRouteChangeCallback for every route change. A 51-second ETW capture during the stall contained 2,186 NotifyRouteChangeCallback events (~43/s).
Because WSL holds m_networkLock while waiting for HcnModifyEndpoint, wsl --shutdown blocks on the same lock until HNS finishes.
Diagnostic Logs
Simultaneous WSL/HNS thread stacks, the 51 s ETW capture, and a read-only probe (GetIpForwardTable2 = 25,488 rows in 51β70 ms; 128 GetIpForwardEntry2 calls = 3.47β4.30 s; 0 snapshot mismatches) are available in the HNS issue: microsoft/Windows-Containers#671. I can attach the full dumps here as well.
Additional context
This is not a WSL-side logic bug: the per-route re-query is in hostnetsvc.dll, a Windows in-box component owned by the HNS team. Filing here to track the WSL-visible impact and to ask whether WSL can:
- avoid triggering a full HNS endpoint refresh on every route change while the host routing table is being populated (coalesce/debounce);
- avoid holding
m_networkLockwhile waiting forHcnModifyEndpoint, so shutdown and unrelated operations are not blocked by an HNS refresh; - coordinate with the HNS team on the fix tracked in [HNS] GetStaticRoutes re-queries the full NSI route table for every route (O(NΒ²)), causing multi-minute mirrored endpoint bootstrap on hosts with large route tablesΒ Windows-Containers#671.
A WSL-side batching change for SendRouteRequestToGns only shortens the later serial phase (WSL β GNS β guest). It cannot shorten the first phase, where WSL is blocked in HcnModifyEndpoint(Refresh) while HNS enumerates the table per route.
AI was used to help prepare this report.
Activity
github-actions commentedon Nov 24, 2026
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:
The script will output the path of the log file once done.
If this is a networking issue, please use
.\collect-wsl-logs.ps1 -LogProfile networkinginstead, following the instructions in Collect WSL logs for networking issuesOnce completed please upload the output files to this GitHub issue.
See Collect WSL logs (recommended method).
If you choose to email these logs instead of attaching them to the bug, please send them to wsl-gh-logs@microsoft.com with the GitHub issue number in the subject, and include a link to your GitHub issue comment in the message body, and reply with '/emailed-logs'.
github-actions commentedon Nov 24, 2026
No logs.etl found in the archive. Make sure that you ran
collect-wsl-logs.ps1as administrator and that thelogs.etlfile is in the archive.Diagnostic information
Lihewin commentedon Nov 24, 2026
wsl-42348-collector.zip
Attached:
wsl-42348-collector.zip(3.5 MB).This is based on the official
collect-wsl-logs.ps1 -LogProfile networkingrun (started 22:26:03, Windows 10.0.26300.9974, WSL 3.0.5.0, 25,409 static host routes). At the "reproduce the problem" prompt I switched.wslconfigtonetworkingMode=mirrored, ranwsl --shutdown(1.8 s), thenwsl -d Ubuntu-26.04 -- true, which returned after 519.6 s. The capture was stopped immediately afterwards.The archive contains:
Get-NetRoutebefore/after (25,503 lines each = 25,409 static routes + header),hns_events.log,hnsdiag,Get-NetAdapter,Get-NetIPConfiguration,wslservice.txtwfpdiag.cabwsl-hns-long.etl+ XML)wslservice/HNS thread stacks,GetStaticRoutesdisassembly, and the read-only route probeTwo caveats, both documented in the README:
logs.etl, WSL-Networking profile) grew to 74.1 GiB during the 519.6 s stall. Compressing and attaching it was not practical.WslLogs-.../networking.sh) towsl.exe, which failed withexecvpe(...): No such file or directory.Because the original files were too large and the collection was abnormal, AI was used to trim and modify the archive to preserve the core parts. If you need a specific time slice of the 74 GB trace (e.g. the first 60 s of the mirrored start), I can provide it through a file share.
Cross-reference: microsoft/Windows-Containers#671
github-actions commentedon Nov 24, 2026
No logs.etl found in the archive. Make sure that you ran
collect-wsl-logs.ps1as administrator and that thelogs.etlfile is in the archive.Diagnostic information
Lihewin commentedon Nov 24, 2026
wsl-42348-collector-v2.zip
github-actions commentedon Nov 24, 2026
Diagnostic information
chemwolf6922 commentedon Nov 25, 2026
Hi Lihewin .
Thanks for reporting this. I have forwarded this issue to the network team internally.