Skip to content

[WSLC] Enable portMappings for WSLC (TCP host->container forwarding)#530

Open
SohamDas2021 wants to merge 4 commits into
mainfrom
user/sodas/wslc-port-mapping
Open

[WSLC] Enable portMappings for WSLC (TCP host->container forwarding)#530
SohamDas2021 wants to merge 4 commits into
mainfrom
user/sodas/wslc-port-mapping

Conversation

@SohamDas2021

@SohamDas2021 SohamDas2021 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

📖 Description

This change enables port mappings for TCP hosts; we call WSLC SDK API WslcSetContainerSettingsPortMappings and wire the portMappings in the runner.

🔗 References

🔍 Validation

✅ Checklist

📋 Issue Type

  • Bug fix
  • Feature
  • Task

GitHub Actions runs the PR validation build automatically. The ADO pipeline
(MXC-PR-Build) is the official build pipeline that signs the binaries; it
runs on merge to main and nightly, and Microsoft reviewers can trigger it
on a PR with /azp run. See docs/pull-requests.md.

Microsoft Reviewers: Open in CodeFlow

Copilot AI review requested due to automatic review settings June 15, 2026 18:45
@SohamDas2021 SohamDas2021 requested a review from a team as a code owner June 15, 2026 18:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Enable WSLC host→container TCP port forwarding by wiring experimental.wslc.portMappings through the Rust config parser into the WSLC SDK container-settings call, with accompanying schema/docs/test updates.

Changes:

  • Add WSLC SDK bindings + runner support for WslcSetContainerSettingsPortMappings and WslcContainerPortMapping.
  • Strengthen port-mapping config parsing/validation (required fields, normalization, duplicate detection; explicit UDP rejection with a clear message).
  • Add/update dev schema, docs, and local/SDK tests to cover TCP port-mapping usage and UDP rejection.

Reviewed changes

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

Show a summary per file
File Description
tests/scripts/run_wslc_all_tests.ps1 Adds two WSLC network test configs to the local WSLC test runner.
tests/configs/wslc_port_mapping_tcp.json New WSLC config exercising a single TCP port-mapping entry.
tests/configs/wslc_port_mapping_multiple.json New WSLC config exercising multiple TCP port-mapping entries.
src/core/wxc_common/src/config_parser.rs Parses/validates WSLC portMappings (required fields, protocol normalization, UDP rejection, duplicate detection) + updates unit tests.
src/backends/wslc/common/src/wslc_bindings.rs Introduces FFI types and function pointer for WslcSetContainerSettingsPortMappings, plus layout test.
src/backends/wslc/common/src/wsl_container_runner.rs Applies port mappings to WSLC container settings before container creation.
sdk/tests/integration/wslc-e2e.test.ts Adds E2E coverage for TCP forwarding and UDP rejection; improves assertions/timeout.
sdk/src/types.ts Expands documentation for portMappings/protocol in SDK types.
schemas/dev/mxc-config.schema.0.8.0-dev.json Updates WSLC portMappings schema to TCP-only + adds default [].
docs/wsl/wsl-container-support-plan.md Documents WSLC portMappings API + notes UDP E_NOTIMPL limitation and parser behavior.
docs/schema.md Adds portMappings example to the main schema doc snippet.

Comment thread sdk/src/types.ts Outdated
Comment thread sdk/tests/integration/wslc-e2e.test.ts
Comment thread src/core/wxc_common/src/config_parser.rs

@MGudgin MGudgin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🕐

@microsoft-github-policy-service microsoft-github-policy-service Bot added the Needs-Author-Feedback Issue needs attention from issue or PR author label Jun 18, 2026
@microsoft-github-policy-service microsoft-github-policy-service Bot added Needs-Attention Issue needs attention from Microsoft and removed Needs-Author-Feedback Issue needs attention from issue or PR author labels Jun 18, 2026
@microsoft microsoft deleted a comment from azure-pipelines Bot Jun 18, 2026
@microsoft microsoft deleted a comment from azure-pipelines Bot Jun 18, 2026

@MGudgin MGudgin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

:shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs-Attention Issue needs attention from Microsoft

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants