Add boot check for ipv6 disabled via registry in mirrored mode#40235
Add boot check for ipv6 disabled via registry in mirrored mode#40235FetoiuCatalin merged 5 commits intomasterfrom
Conversation
…rking When the registry key HKLM\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters has DisabledComponents set to 0xFF (all IPv6 components disabled), mirrored networking mode cannot mirror host interfaces. This adds a check in ValidateNetworkingMode() that detects this condition and falls back to NAT networking mode with a user-facing warning. Only mirrored networking mode is affected by this registry key; other networking modes (NAT, Bridged, VirtioProxy) are not checked. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a host boot-time compatibility check so that when mirrored networking is requested, WSL will fall back to NAT if IPv6 has been disabled via the legacy DisabledComponents registry mechanism (which mirrored mode does not support), and surfaces a localized warning explaining why.
Changes:
- Add
DisabledComponentsregistry check inWslCoreVm::ValidateNetworkingMode()to force NAT fallback (with user warning) when mirrored is requested. - Add a localized warning string describing the unsupported IPv6-disabled configuration.
- Add a Windows networking test validating mirrored-to-NAT fallback behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| test/windows/NetworkTests.cpp | Adds a new mirrored-mode test expecting fallback to NAT when IPv6 is disabled via DisabledComponents. |
| src/windows/service/exe/WslCoreVm.cpp | Implements the mirrored-mode validation logic that checks the host registry and falls back to NAT with a user warning. |
| localization/strings/en-US/Resources.resw | Adds the new localized warning message text for the IPv6-disabled fallback reason. |
|
@benhillis , @craigloewen-msft : this provides a warning + fallback if the user has configured a known-unsupported registry value to disable IPv6. there is microsoft.com documentation that this setting can break different scenarios. but at least know there's a clear warning, and will fallback to NAT. |
OneBlue
left a comment
There was a problem hiding this comment.
LGTM, one minor comment
53f1d73
d8eaf45
* Fallback to NAT when IPv6 is disabled via registry for mirrored networking When the registry key HKLM\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters has DisabledComponents set to 0xFF (all IPv6 components disabled), mirrored networking mode cannot mirror host interfaces. This adds a check in ValidateNetworkingMode() that detects this condition and falls back to NAT networking mode with a user-facing warning. Only mirrored networking mode is affected by this registry key; other networking modes (NAT, Bridged, VirtioProxy) are not checked. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * add registry check * pr review * remove shutdown * re-add shutdown --------- Co-authored-by: Catalin-Emil Fetoiu <cfetoiu@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary of the Pull Request
Mirrored networking mode does not support IPv6 being disabled using this old registry key: SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters (DisabledComponents)
The recommended way to disabled IPv6 is using Set-NetAdapterBinding for component ms_tcpip6, which is supported by mirrored mode.
PR Checklist
Detailed Description of the Pull Request / Additional comments
Fallback to NAT mode if this registry key is enabled
Validation Steps Performed
Manual testing + added automated test in NetworkTests.cpp