Skip to content

Add boot check for ipv6 disabled via registry in mirrored mode#40235

Merged
FetoiuCatalin merged 5 commits intomasterfrom
topic/mirrored-networking-ipv6-disabled-check
Apr 21, 2026
Merged

Add boot check for ipv6 disabled via registry in mirrored mode#40235
FetoiuCatalin merged 5 commits intomasterfrom
topic/mirrored-networking-ipv6-disabled-check

Conversation

@FetoiuCatalin
Copy link
Copy Markdown
Contributor

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

  • Closes: Link to issue #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

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

Catalin-Emil Fetoiu and others added 2 commits April 16, 2026 17:51
…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>
Copilot AI review requested due to automatic review settings April 17, 2026 21:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 DisabledComponents registry check in WslCoreVm::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.

Comment thread test/windows/NetworkTests.cpp Outdated
Comment thread src/windows/service/exe/WslCoreVm.cpp
Comment thread src/windows/service/exe/WslCoreVm.cpp
Comment thread src/windows/service/exe/WslCoreVm.cpp
keith-horton
keith-horton previously approved these changes Apr 17, 2026
@keith-horton
Copy link
Copy Markdown
Member

@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.

@FetoiuCatalin FetoiuCatalin marked this pull request as ready for review April 17, 2026 23:30
@FetoiuCatalin FetoiuCatalin requested a review from a team as a code owner April 17, 2026 23:30
Copilot AI review requested due to automatic review settings April 17, 2026 23:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread src/windows/service/exe/WslCoreVm.cpp
OneBlue
OneBlue previously approved these changes Apr 20, 2026
Copy link
Copy Markdown
Collaborator

@OneBlue OneBlue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one minor comment

Comment thread test/windows/NetworkTests.cpp
@FetoiuCatalin FetoiuCatalin dismissed stale reviews from OneBlue and keith-horton via 53f1d73 April 20, 2026 22:15
keith-horton
keith-horton previously approved these changes Apr 20, 2026
OneBlue
OneBlue previously approved these changes Apr 20, 2026
Copilot AI review requested due to automatic review settings April 21, 2026 00:03
@FetoiuCatalin FetoiuCatalin dismissed stale reviews from OneBlue and keith-horton via d8eaf45 April 21, 2026 00:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread test/windows/NetworkTests.cpp
Comment thread src/windows/service/exe/WslCoreVm.cpp
@FetoiuCatalin FetoiuCatalin merged commit 8e65843 into master Apr 21, 2026
13 checks passed
benhillis pushed a commit that referenced this pull request Apr 21, 2026
* 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>
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

Successfully merging this pull request may close these issues.

4 participants