Add networking mode setting as fallback#14564
Merged
yao-msft merged 4 commits intofeature/wsl-for-appsfrom Mar 30, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a user-configurable session networking mode to WSLC as a temporary fallback mechanism, allowing users to switch away from the current virtio-proxy (“virtionet”) mode if needed.
Changes:
- Introduce
session.networkingModeuser setting (validated from YAML intoWSLCNetworkingMode). - Wire
SessionOptions::Default()networking mode to the user setting instead of a hardcoded value. - Minor settings plumbing tweaks: use
_1MBconstant for memory conversion; avoid overwriting an existing settings file when opening settings on “Default” type.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/windows/wslc/settings/UserSettings.h | Adds SessionNetworkingMode to the settings enum/mapping and includes wslc.h for WSLCNetworkingMode. |
| src/windows/wslc/settings/UserSettings.cpp | Implements YAML validation for session.networkingMode; uses _1MB; avoids resetting settings file if it already exists. |
| src/windows/wslc/services/SessionModel.cpp | Uses the new setting for SessionOptions::Default().NetworkingMode. |
benhillis
reviewed
Mar 28, 2026
ptrivedi
reviewed
Mar 30, 2026
|
lgtm, once the comments are resolved |
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
src/windows/wslc/settings/UserSettings.cpp:264
- PrepareToShellExecuteFile() no longer creates/writes the default template for all UserSettingsType::Default cases; it now only does so when the settings file is missing. Please add a unit test to lock in the intended behavior (especially that an existing-but-unparseable settings.yaml is not overwritten).
void UserSettings::PrepareToShellExecuteFile() const
{
if (m_type == UserSettingsType::Default && !std::filesystem::exists(m_settingsPath))
{
// First run — create the directory and write the commented-out defaults template.
Reset();
}
OneBlue
reviewed
Mar 30, 2026
| { | ||
| return WSLCNetworkingModeNAT; | ||
| } | ||
| if (value == "virtioproxy") |
Collaborator
There was a problem hiding this comment.
nit: I would have a small preference for virtionet here, since that's how we've been describing it so far. What do you think @benhillis ?
OneBlue
approved these changes
Mar 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the Pull Request
Added session networking setting as temp fallback if virtionet has issues. As it's only temporary, we did not add the setting to default template. The setting may be removed once we fixed the virtionet issue.
PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed
Manually tested the changes. As this change is only temporary, test was not updated.