Add WSLCContainerNetworkTypeCustom support#40311
Open
beena352 wants to merge 5 commits intomicrosoft:feature/wsl-for-appsfrom
Open
Add WSLCContainerNetworkTypeCustom support#40311beena352 wants to merge 5 commits intomicrosoft:feature/wsl-for-appsfrom
beena352 wants to merge 5 commits intomicrosoft:feature/wsl-for-appsfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds support for WSLCContainerNetworkTypeCustom so containers can attach to user-created WSLC networks, including validation and port allocation behavior consistent with bridged networking.
Changes:
- Enables
WSLCContainerNetworkTypeCustomin the IDL and wires network name through the launcher/options path. - Adds
WSLCSession::HasNetwork()and uses it to validate custom network existence before container creation. - Extends port mapping + recovery logic to allocate VM ports for
Custom, and adds tests for custom network behavior/error cases.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
test/windows/WSLCTests.cpp |
Adds coverage for launching containers on a custom network and validates error cases. |
src/windows/wslcsession/WSLCSession.h |
Declares HasNetwork() helper used for custom network validation. |
src/windows/wslcsession/WSLCSession.cpp |
Implements HasNetwork() with locking around cached networks. |
src/windows/wslcsession/WSLCContainer.cpp |
Adds custom network branch in port mapping, changes Docker mode parsing behavior, and allocates recovery ports for custom networks. |
src/windows/service/inc/wslc.idl |
Enables WSLCContainerNetworkTypeCustom = 3. |
src/windows/common/WSLCContainerLauncher.h |
Adds API to set custom network name and stores it. |
src/windows/common/WSLCContainerLauncher.cpp |
Propagates container network name into options passed to container creation. |
localization/strings/en-US/Resources.resw |
Adds user-facing localized string for missing custom network name validation. |
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
Add support for WSLCContainerNetworkTypeCustom, allowing containers to attach to user-created WSLC networks.
PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed