Skip to content

Add Rust client for the OpenVMM VM service - #41618

Merged
Daman Mulye (damanm24) merged 21 commits into
feature/openvmmfrom
user/damanmulye/wsl-openvmm-rpc
Sep 21, 2026
Merged

Daman Mulye (damanm24) merged 21 commits into
feature/openvmmfrom
user/damanmulye/wsl-openvmm-rpc

Conversation

@damanm24

@damanm24 Daman Mulye (damanm24) commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

This change consumes the following collateral from the Wsl-deps repository:

  • Microsoft.WSL.OpenVMM nuget package which contains:
  • OpenVMM
  • wslopenvmm.dll and wslopenvmm.h (a Rust based dll that provides an RPC client to communicate with OpenVMM and corresponding header file definitions)

Copilot AI lite review requested due to automatic review settings September 15, 2026 21:29

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.

🟡 Changes recommended

Unresolved moderate findings remain in build gating, toolchain validation, import-library delivery, and VHDX suffix handling.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds an optional Rust C-ABI DLL for OpenVMM VM RPC communication over AF_UNIX, including lifecycle/resource operations, cancellation, recovery, diagnostics, and tests.

Changes:

  • Adds the Rust client, C ABI, RPC transport, and VM operations.
  • Integrates conditional Rust builds and test execution.
  • Updates dependencies, packaging metadata, and build configuration.
File summaries
File Reviewed changes and final comments
tools/test/test.bat.in Runs Rust tests during the normal test pass.
src/windows/wslopenvmm/wslopenvmm.h Defines the C ABI. Moderate (1 vote): The dllimport declarations require an import library that is not published.
src/windows/wslopenvmm/src/tests.rs Adds DLL and RPC mock tests.
src/windows/wslopenvmm/src/rpc.rs Handles deadlines, cancellation, and HRESULT mapping.
src/windows/wslopenvmm/src/lib.rs Exports the DLL API. Nit (1 vote): Exported resource-control methods lack ABI-level fixture tests.
src/windows/wslopenvmm/src/diagnostics.rs Adds diagnostic tracing.
src/windows/wslopenvmm/src/client.rs Implements VM configuration and operations. Moderate (3 votes): VHDX suffix matching is case-sensitive. Nit (1 vote): New mutation entry points lack focused tests.
src/windows/wslopenvmm/src/af_unix.rs Implements AF_UNIX transport.
src/windows/wslopenvmm/CMakeLists.txt Builds the Rust DLL. Moderate (1 vote): Only the DLL is staged; the required import library is not exposed.
src/windows/wslopenvmm/Cargo.toml Defines Rust dependencies and packaging.
src/windows/wslopenvmm/Cargo.lock Locks Rust dependencies.
src/windows/wslopenvmm/build.rs Generates protobuf bindings.
packages.config Updates the DeviceHost package version.
msixinstaller/CMakeLists.txt Refactors installer dependencies.
CMakeLists.txt Gates OpenVMM builds. Moderate (2 votes): DEFINED enables the target even when INCLUDE_OPENVMM=OFF; toolchain validation does not verify the selected target or Rust edition support.
.gitignore Nit (1 vote): Does not ignore the configured cargo-target output directory.
Review details

Suppressed comments (4)

src/windows/wslopenvmm/CMakeLists.txt:26

  • The C header marks every entry point as __declspec(dllimport), so a normal C/C++ consumer also needs the MSVC import library. This command copies only the DLL into the advertised ${BIN} output and exposes no import-library output/target; either publish the generated import library alongside it or make the interface explicitly support dynamic loading instead.
    COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CARGO_OUTPUT} ${WSLOPENVMM_DLL}

src/windows/wslopenvmm/src/client.rs:388

  • The new VM mutation entry points beginning here are not exercised by the Rust suite, even though the mock service defines expectations for ModifyResource, AddVpciDevice, and RemoveVpciDevice. Request shapes, share bookkeeping, and recovery behavior can therefore regress without a test; add focused tests for these exported operations.
    pub fn attach_scsi_disk(
        &self,
        controller: u32,
        lun: u32,
        host_path: String,
        read_only: bool,
    ) -> HRESULT {

src/windows/wslopenvmm/src/lib.rs:281

  • The new Rust tests exercise configuration construction and Resume/Teardown/Quit, but none of the exported resource-control methods below are invoked through the ABI. modify_disk, modify_port, and share bookkeeping can therefore regress while cargo test remains green; add fixture-backed tests for these operations, including request fields and success/failure state updates.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn WslOpenVmmVmAttachScsiDisk(

src/windows/wslopenvmm/wslopenvmm.h:17

  • __declspec(dllimport) makes these declarations require an MSVC import library for normal C/C++ linking, but the CMake rule only copies wslopenvmm.dll and does not publish Cargo's .dll.lib or a CMake target for it. A consumer using this header cannot link against the normal build output; either stage/expose the import library or make the header explicitly support a dynamically loaded API.
__declspec(dllimport) HRESULT WslOpenVmmCreateConfig(_Out_ WslOpenVmmConfig** Config);
  • Files reviewed: 14/16 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread CMakeLists.txt Resolved
Comment thread CMakeLists.txt Resolved
Comment thread src/windows/wslopenvmm/src/client.rs Resolved
@benhillis
Ben Hillis (benhillis) changed the base branch from master to feature/openvmm September 15, 2026 22:33
Copilot AI review requested due to automatic review settings September 15, 2026 23:00
@damanm24
Daman Mulye (damanm24) marked this pull request as ready for review September 15, 2026 23:02
@damanm24
Daman Mulye (damanm24) requested a review from a team as a code owner September 15, 2026 23:02

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.

🟡 Changes recommended

Unresolved build integration, linking, schema-path, test coverage, and pipeline test execution issues remain.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (4)

Previously missed (2) — in code that hasn't changed since the last review.

src/windows/wslopenvmm/src/client.rs:387

  • The exported VM control surface introduced here is not exercised by the new RPC tests: only CreateVm/ResumeVm/TeardownVm/Quit are sent, while disk attach/detach, port bind/unbind, and share add/remove request construction and bookkeeping are untested. Add mock-server assertions for these methods, including failure/recovery paths, so an incorrect ModifyType/address or stale share state cannot ship unnoticed.
    tools/test/test.bat.in:9
  • This only adds the Rust command to the developer test.bat. The normal pipeline test path invokes TAEF directly from cloudtest/TestGroup.xml.in and stages only the native test artifacts, so these Rust unit tests are never run by the normal WSL test pass described by the PR. Wire cargo test into the pipeline test job or stage and invoke it there as well.

CMakeLists.txt:600

  • Cargo presence is the only gate here, so any normal build on a machine with Cargo unconditionally adds this ALL target. There is no OpenVMM opt-in variable, which contradicts the PR's stated build behavior and adds Rust compilation to ordinary WSL builds. Gate this target and the injected test command behind an explicit OpenVMM build option.
if (CARGO_EXECUTABLE)
    add_subdirectory(src/windows/wslopenvmm)
endif()

src/windows/wslopenvmm/CMakeLists.txt:31

  • Because this is an ALL target and the only guard is Cargo being installed, every ordinary WSL build on a Rust-equipped machine now compiles the full tonic/protoc dependency graph, even when OpenVMM support was not requested. This contradicts the stated opt-in build behavior and adds a substantial build cost; gate the subdirectory/target behind an explicit OpenVMM option or remove ALL and build it explicitly.
add_custom_target(wslopenvmm ALL DEPENDS ${WSLOPENVMM_DLL})
  • Files reviewed: 14/16 changed files
  • Comments generated: 3
  • Review effort level: Lite

Comment thread CMakeLists.txt Resolved
Comment thread src/windows/wslopenvmm/CMakeLists.txt Resolved
Comment thread src/windows/wslopenvmm/CMakeLists.txt Resolved
…am (#41617)

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Co-authored-by: WSL localization <noreply@microsoft.com>
Copilot AI review requested due to automatic review settings September 16, 2026 19:37

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.

🟡 Changes recommended

CMake requires Rust unconditionally, and the Rust tests lack the tokio-stream sync feature.

Get a fresh assessment by requesting another Copilot review.

Review details
  • Files reviewed: 14/16 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread CMakeLists.txt Resolved
Comment thread src/windows/wslopenvmm/Cargo.toml Resolved
Copilot AI review requested due to automatic review settings September 17, 2026 03:26
@damanm24
Daman Mulye (damanm24) force-pushed the user/damanmulye/wsl-openvmm-rpc branch from 53f6dcf to 935ccb1 Compare September 17, 2026 03:26

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.

🟡 Changes recommended

The Rust tests do not parse, CI omits the DLL target, a dependency feature is missing, coverage is incomplete, and locale edits must be reverted.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (2)

src/windows/wslopenvmm/CMakeLists.txt:28

  • This target is only declared with ALL, but the repository's CI invokes CMake with an explicit target list (.pipelines/build-job.yml:132-134) that does not include wslopenvmm. The x64/ARM64 build jobs therefore skip compiling this DLL, so CI can pass without validating the new library. Add the target to the pipeline target list (and any required artifact wiring), or make an existing CI target depend on it.
add_custom_target(wslopenvmm ALL DEPENDS ${WSLOPENVMM_DLL} ${WSLOPENVMM_IMPORT_LIB})

src/windows/wslopenvmm/Cargo.toml:29

  • ReceiverStream is used by the test server in src/tests.rs, but tokio-stream exposes that wrapper behind its sync feature; enabling only net makes the Rust test target fail to compile. Add the sync feature or use a wrapper that is covered by the enabled features.
tokio-stream = { version = "0.1", features = ["net"] }
  • Files reviewed: 20/22 changed files
  • Comments generated: 7
  • Review effort level: Lite

Comment thread src/windows/wslopenvmm/src/tests.rs Resolved
Comment thread src/windows/wslopenvmm/src/client.rs Resolved
Restore localized resources to their feature/openvmm versions so they are not included in the OpenVMM RPC change.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 17, 2026 16:30

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.

🟡 Changes recommended

Unresolved critical CMake integration, GUID serialization, and test-fixture failures block approval.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (3)

Previously missed (1) — in code that hasn't changed since the last review.

tools/test/test.bat.in:9

  • This only augments the locally generated test.bat; the normal CloudTest job does not stage or invoke that script. .pipelines/build-job.yml stages the TAEF artifacts and cloudtest/TestGroup.xml.in executes wsltests.dll directly, so these Rust tests will not run in CI as claimed. Add the Cargo invocation to the CloudTest execution path (or stage and run this script there).

src/windows/wslopenvmm/src/client.rs:409

  • The new VM mutation surface is not covered by the integration fixtures: no test invokes Add/RemoveShare, Attach/DetachScsiDisk, or Bind/UnbindPort, even though MockVmService has request variants for these RPCs. Request encoding, local share bookkeeping, and recovery behavior can therefore regress without detection. Add success and uncertain/failure cases for these methods.
    pub fn add_share(&self, tag: String, host_path: String, read_only: bool) -> HRESULT {
        self.with_operation("AddShare", false, |inner, deadline, cancellation| {
            if inner.shares.contains_key(&tag) {
                return HRESULT::from_win32(ERROR_ALREADY_EXISTS.0);
            }

src/windows/wslopenvmm/src/client.rs:598

  • Path::extension() returns None for a path with a trailing separator, so the test case C:\disks\archive.vhdx\ (and callers using that spelling) is classified as VHD1 instead of VHDX. Trim trailing separators or otherwise inspect the final filename component before checking the extension.
    if Path::new(path)
        .extension()
        .is_some_and(|extension| extension.eq_ignore_ascii_case("vhdx"))
  • Files reviewed: 15/17 changed files
  • Comments generated: 3
  • Review effort level: Lite

Comment thread src/windows/wslopenvmm/CMakeLists.txt Resolved
Comment thread src/windows/wslopenvmm/src/client.rs Resolved
Comment thread src/windows/wslopenvmm/src/tests.rs Resolved
Copilot AI review requested due to automatic review settings September 17, 2026 22:06
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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.

🟡 Changes recommended

Packaging/staging conflicts remain, and Rust test execution is not integrated into the normal test flow.

Get a fresh assessment by requesting another Copilot review.

Review details
  • Files reviewed: 6/7 changed files
  • Comments generated: 3
  • Review effort level: Lite

Comment thread msipackage/CMakeLists.txt
set(PACKAGE_WIX ${BIN}/package.wix)
set(CAB_CACHE ${BIN}/cab)
set(WINDOWS_BINARIES wsl.exe;wslg.exe;wslhost.exe;wslrelay.exe;wslservice.exe;wslserviceproxystub.dll;wsldevicehostproxystub.dll;wslinstall.dll;wslc.exe;wslcsession.exe)
set(WINDOWS_BINARIES wsl.exe;wslg.exe;wslhost.exe;wslrelay.exe;wslservice.exe;wslserviceproxystub.dll;wsldevicehostproxystub.dll;wslinstall.dll;wslc.exe;wslcsession.exe;openvmm.exe;wslopenvmm.dll)
Comment thread CMakeLists.txt Resolved
Comment thread msipackage/package.wix.in Resolved
Copilot AI review requested due to automatic review settings September 17, 2026 22:10

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.

🟡 Changes recommended

Unresolved packaging and client-integration issues block approval.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (3)

msipackage/CMakeLists.txt:20

  • Release builds set PACKAGE_INPUT_DIR to packageStagingDir, but the build-stage target patterns do not copy openvmm.exe or wslopenvmm.dll there (see .pipelines/build-stage.yml:35-40). Consequently the new ${PACKAGE_INPUT_DIR} dependencies and WiX sources are missing when msipackage is built in a release pipeline; add these files to the staging/signing pattern or source them directly from the NuGet package.
set(WINDOWS_BINARIES wsl.exe;wslg.exe;wslhost.exe;wslrelay.exe;wslservice.exe;wslserviceproxystub.dll;wsldevicehostproxystub.dll;wslinstall.dll;wslc.exe;wslcsession.exe;openvmm.exe;wslopenvmm.dll)

msipackage/CMakeLists.txt:20

  • Adding wslopenvmm.dll to WINDOWS_BINARIES makes it a required MSI input and causes the package target to depend on ${PACKAGE_INPUT_DIR}/wslopenvmm.dll, which contradicts the stated requirement that this DLL is not included in installer payloads. Remove it from the MSI input list when removing the Wix file entry; otherwise normal MSI packaging will also fail whenever the staging directory intentionally omits it.
set(WINDOWS_BINARIES wsl.exe;wslg.exe;wslhost.exe;wslrelay.exe;wslservice.exe;wslserviceproxystub.dll;wsldevicehostproxystub.dll;wslinstall.dll;wslc.exe;wslcsession.exe;openvmm.exe;wslopenvmm.dll)

msipackage/package.wix.in:298

  • The PR description says the Rust DLL is not included in MSI/MSIX payloads, but this new WiX entry adds wslopenvmm.dll to the MSI. The CMake packaging list also stages it, so the shipped installer contradicts the stated packaging boundary; either remove the DLL from the packaging inputs or update the requirement.
                <File Id="wslopenvmm.dll" Source="${PACKAGE_INPUT_DIR}/wslopenvmm.dll" />
  • Files reviewed: 6/7 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread CMakeLists.txt Resolved
Copilot AI review requested due to automatic review settings September 17, 2026 22:14

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.

🟡 Changes recommended

Four moderate findings remain in build, packaging, and dependency configuration.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (3)

CMakeLists.txt:284

  • The imported target is never referenced anywhere else in the tree (wslopenvmm_client only appears in this definition), so configuring CMake does not link the new client DLL into WSLService or any other WSL component. Wire this target to the intended consumer and add the corresponding call site, or defer adding the imported target until a consumer exists.
add_library(wslopenvmm_client SHARED IMPORTED GLOBAL)

msipackage/CMakeLists.txt:20

  • Release builds set PACKAGE_INPUT_DIR to packageStagingDir, which is populated only from the target patterns in .pipelines/build-stage.yml; those patterns do not include either newly added binary. As a result, these new BINARIES_DEPENDENCIES paths are missing when WiX runs and the release msipackage target fails. Add/sign/stage both files in the release target pattern, or do not make them MSI inputs.
set(WINDOWS_BINARIES wsl.exe;wslg.exe;wslhost.exe;wslrelay.exe;wslservice.exe;wslserviceproxystub.dll;wsldevicehostproxystub.dll;wslinstall.dll;wslc.exe;wslcsession.exe;openvmm.exe;wslopenvmm.dll)

msipackage/package.wix.in:298

  • This WiX entry puts wslopenvmm.dll in the MSI payload, contradicting the PR description that the DLL is not included in MSI or MSIX installers. Remove this file from the WiX component and from the corresponding WINDOWS_BINARIES/dependency list so the package does not ship it.
                <File Id="wslopenvmm.dll" Source="${PACKAGE_INPUT_DIR}/wslopenvmm.dll" />
  • Files reviewed: 6/7 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread packages.config Resolved

@OneBlue Blue (OneBlue) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, minor comments. Feel free to fix in a followup

Comment thread CMakeLists.txt Resolved
Comment thread CMakeLists.txt
file(CREATE_LINK "${WSL_OPENVMM_SOURCE_DIR}/bin/${TARGET_PLATFORM}/${binary}" "${BIN}/${binary}")
endforeach()

add_library(wslopenvmm_client SHARED IMPORTED GLOBAL)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do we need to create a target for this library ? I was originally thinking of just adding the include path & updating the linking options in wslservice / wslcsession

@damanm24
Daman Mulye (damanm24) merged commit dd7cad0 into feature/openvmm Sep 21, 2026
3 checks passed
@damanm24
Daman Mulye (damanm24) deleted the user/damanmulye/wsl-openvmm-rpc branch September 21, 2026 21:07
Daman Mulye (damanm24) added a commit that referenced this pull request Nov 6, 2026
* Add Rust client for the OpenVMM VM service (#41618)

* repo: modify CODEOWNERS to change wsl-maintainers to wsl-reviewers team (#41617)

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>

* Localization change from build: 157736413 (#41621)

Co-authored-by: WSL localization <noreply@microsoft.com>

* Migrate wslvmservice to WSL

* tests + address missing functionality from initial poc

* Retry OpenVMM named-pipe connections during startup

* Use AF_UNIX for OpenVMM RPC connections

* Add more robust RPC handling + tests

* add tracing

* Revert RPC robustness and tracing changes

Reverts 260080d (add tracing) and ff9c777 (Add more robust RPC handling + tests), restoring the RPC layer to eb59238.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Restore RPC robustness and tracing changes

Reverts ea86585 to restore the original RPC handling, tests, and tracing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* re-do tests

* Update packaging

* undo unnecessary change

* CMake simplify, address copilot comments, run formatter, and make ci changes

* feedback

* Remove unintended localization changes

Restore localized resources to their feature/openvmm versions so they are not included in the OpenVMM RPC change.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* use nuget instead

* missed a couple of updates

* .

* Stop tracking local OpenVMM notes

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* last set of reverted changes

---------

Co-authored-by: Ben Hillis <benhillis@gmail.com>
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Co-authored-by: Blue <OneBlue@users.noreply.github.com>
Co-authored-by: WSL localization <noreply@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Introduce virtual machine backend interface (#41663)

* Initial work

* .

* flatten

* previous PR feedback

* Update cleanup logic in OpenVmmVirtualMachineBackend

Replaced file deletion with recursive directory removal for improved error handling.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Initial work

* previous PR feedback

* feedback

* Remove accidentally committed file

* .

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Implement OpenVMM backend (#41697)

* Implement OpenVMM virtual machine backend

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* .

* fix

* feedback

* feedback

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Introduce HcsVirtualMachineBackend (#41718)

* Initial work

* .

* flatten

* previous PR feedback

* Update cleanup logic in OpenVmmVirtualMachineBackend

Replaced file deletion with recursive directory removal for improved error handling.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* logging improvements + use wsl error codes where applicable + tests

* Configure OpenVMM networking at VM creation time

Expose effective VM descriptions and reject unsupported network configuration and adapter hot-add. Update backend coverage for creation-time networking.

* Refactor + fix locking story

* add user token

* Partially implemented HcsVirtualMachineBackend

* Implement OpenVMM virtual machine backend

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* .

* fix

* feedback

* Relocate virtual machine backends to common

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* restore

* 2a03975

* 7c9c0db

* finally rebased

* .

* HcsAttachDisk

* HcsDetachDisk

* tests

* test fixes

* missed some things during merge

* Feedback

* Address HCS backend review feedback

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* feedback

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Implement remaining HCS VirtualMachineBackend surface (#41761)

* .

* .

* .

* Add filesystem share test

* Fix rebased filesystem share validation

* Remove file share

* initial work

* GPU/PMem

* guest DMA/swiotb, memory configuration, HCS hosted p9 support, shared memory device

* Fix VM backend and WinRT unity build collisions

Port the shared VM constants and explicit WinRT imports from hcs-integration commits 3d53df3 and 1cee239.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 563f9b88-0149-48a5-ac0c-07d6f0adbd9e

* streamline comments

* Revert streamline comments

* feedback

* feedback

* .

* Align VM termination with existing code

* feedback

---------

Copilot-Session: 563f9b88-0149-48a5-ac0c-07d6f0adbd9e

* Integrate HcsVirtualMachineBackend into WslCoreVm (#41824)

* .

* .

* .

* Add filesystem share test

* Fix rebased filesystem share validation

* Remove file share

* initial work

* GPU/PMem

* guest DMA/swiotb, memory configuration, HCS hosted p9 support, shared memory device

* Fix VM backend and WinRT unity build collisions

Port the shared VM constants and explicit WinRT imports from hcs-integration commits 3d53df3 and 1cee239.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 563f9b88-0149-48a5-ac0c-07d6f0adbd9e

* streamline comments

* Revert streamline comments

* feedback

* feedback

* .

* Align VM termination with existing code

* test new rs_prerelease image

* formatter

* Integrate HCS virtual machine backend

(cherry picked from commit 5207c4c)

* updates

(cherry picked from commit 21bab9c)

* formatter

(cherry picked from commit 5a6f3e1)

* Merge user/damanmulye/hcs-fs-devices into user/damanmulye/hcs-integration

(cherry picked from commit 721cc2b)

* Remove duplicate state

(cherry picked from commit 32e8ca1)

* More duplicate state removal

(cherry picked from commit a43e9e0)

* test fixes

(cherry picked from commit eaaa885)

* Fix leak for wsldevicehostproxy

(cherry picked from commit 49ba11e)

* Fix merge inconsistencies in the VM backend integration

Reconcile HcsVirtualMachineBackend with the current nested VmResource
model and the termination-information interface:

- Access inherited resource descriptions directly and backend-only
  state through .Backend.
- Drop the duplicate VmFileSystemShare description from
  HcsFileSystemShare, which VmResource already provides.
- Resolve shared-handle versus raw HANDLE conversions for file system
  device and share tokens.
- Store port bindings as VmPortBinding and read the network adapter
  resource path from backend state.
- Restore the SmallPageMemory feature and its HCS capability detection.
- Move WslCoreVm off the obsolete crash/exit APIs to
  GetTerminationReason().

* recover fixes

* .

* .

* .

* Format HCS virtual machine backend

* Only pass a user token for HCS-hosted Plan 9 shares that request root identity

Passing the token unconditionally implicitly set UseShareRootIdentity on GPU shares, changing their flags from ReadOnly|AllowOptions (0x21) to 0x31 and causing the guest /gpu_drivers mount to fail with EINVAL during distro import.

* .

* feedback

* termination feedback

* .

* feedback

---------

Copilot-Session: 563f9b88-0149-48a5-ac0c-07d6f0adbd9e

* Merge latest main branch into feature/openvmm (#41952)

* repo: modify CODEOWNERS to change wsl-maintainers to wsl-reviewers team (#41617)

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>

* Localization change from build: 157736413 (#41621)

Co-authored-by: WSL localization <noreply@microsoft.com>

* CLI: Global option scopes for nested commands (related to compose support) (#41546)

* Change default relay  buffer size to 64KiB (#41603)

The current logic uses a fixed 4KiB buffer for stdio relay on the Windows side. And uses an initial 4KiB buffer for stdio relay on the Linux side, which grows only if the message won't fit. This can severely limit the relay performance in some situations. For example, in #41572, when redirecting stdout to a SMB share.

This PR increases thedefault relay buffer size to 64KiB. Which shows significant performance improvements according to buffer size tests.

* Fix redirect stdout and stderror to the same file overlapping (#41611)

Currently the stdout and stderr relay tracks the output offset separately. And when redirected to the same file, the writes could overlap.

This PR uses the append mode for overlap io writes instead of the separate offsets in the relay. So, the file write offset is correctly tracked by the system.

* move installer log collection after repro (#41620)

The installer log files were collected before the log collection starts. Which will miss the user repro.

This PR moves it after the user repro.

* wslc: add --digests to image list for docker parity (#41457)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Localization change from build: 157843092 (#41630)

Co-authored-by: WSL localization <noreply@microsoft.com>

* Explicitely return SOCKET from WSLCPluginAPI_ProcessGetFd() (#41626)

* In mirrored mode, handle route update as add instead of replace (#41391)

In mirrored mode, handle route update as add instead of replace
Remove usage of route update as it can overwrite routes on other interfaces. add tests that verify host routing changes are correctly reflected in Linux

---------

Co-authored-by: Catalin-Emil Fetoiu <cfetoiu@microsoft.com>

* Add wslc events command (#41608)

* Don't fail the UnitTests::Warnings test case if GlobalSecureAccess VPN is running (#41638)

* Don't fail the UnitTests::Warnings test case if GlobalSecureAccess VPN is running

* Cleanup diff

* Fix test

* Wait for wslservice to be started when running tests (#41639)

* Wait for wslservice to be started when running tests

* Fail on timeout

* Improve check

* Format

* Create new namespaces for distro cgroups (#41512)

In 2.9.8, the distro processes are separated into their own cgroups. But they remain in the same cgroup namespace. That caused compatibility issues with softwares that assume a fixed systemd cgroup layout. For example, rootless docker and nerdctl.
Fixes on Moby and nertctl are being worked on. However, to avoid issues with other software, WSL's cgroup handling should also be improved.

This PR creates new cgroup namespaces for the distros. So, to the non-critical distro processes, the systemd cgroup layout stays the same as before.
This PR also introduces a cgroup structure change to accomplish this. The systemd init is moved from wsl-user/distro-N/systemd to wsl-user/distro-N. And the initialization of the distro-N controllers is handled by systemd instead.
The processes are also moved into the non-systemd cgroup in systemdless distros. This makes sure that sub-group controllers can be enabled in the distro root.
Cgroup v2 is now enforced when distro isolation is enabled. Instead of constructing an unusable cgroup v1 layout when cgroup v1 and distro isolation are both enabled.

* Fix unnecessary delay in the port tracking loop (#41472)

Before this change, an additional 10ms delay was added in the port tracker loop presumably to make the main loop slower than the worker loop. So, the worker result does not get super dated. This is not reliable. And the 10ms delay also slows down every consecutive bind call.

This PR refactors the thread synchronization method. So, the timing between those two loops is more deterministic. And removes the performance penalty for all bind calls.

* Localization change from build: 157954210 (#41643)

Co-authored-by: WSL localization <noreply@microsoft.com>

* wslc: add --follow-link to cp (#41501)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Disable unstable bind cap test and re-enable Loopback test that was incorrectly disabled- #41648 (#41648)

Co-authored-by: Catalin-Emil Fetoiu <cfetoiu@microsoft.com>

* Move objects shared by wslc.exe and the tests to src/windows/common (#41619)

* Move objects shared by wslc.exe and the tests to src/windows/common

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Link yaml-cpp, advapi32 and Crypt32 into common

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Drop yaml-cpp, advapi32 and crypt32 from wslclib now that common provides them

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Move wslc code in common under common/wslc and namespace CLI types as wslc::cli

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix various protocol parsing issues (#41637)

* Save state

* Use proper arrays

* Format

* Add new tests

* Cleanup tests

* Cleanup diff

* Format

* Apply PR feedback

* Apply PR feedback

* Format

* Apply PR feedback

* Move logging call

* Apply PR feedback

* Apply PR feedback

* Localization change from build: 157980831 (#41647)

Co-authored-by: WSL localization <noreply@microsoft.com>

* Add WSLC network lifecycle events (#41576)

* Add WSLC network lifecycle events

* Localize pending network prune errors

* Fix network operation wait ownership and cleanup ordering

* Fix prune event correlation after timed-out

* Fix network event rollback and timeout recovery

* Format

* Forward Docker network events directly

* Restore lock_guard after removing event waits

* fix test

* align event stream test helpers after merge

* feedback

* Fix potential out of bound access when pretty-printing string field in init messages (#41664)

* Localization change from build: 158197536 (#41662)

Co-authored-by: WSL localization <noreply@microsoft.com>

* simplify event reader cleanup and remove unused include (#41667)

* Fix ipv4 forwarding when both v4 and v6 ports are listening

* Fix config's handling of non-ascii characters (#41657)

When parsing the config file, non-ascii utf-16 values are casted into char. This will mangle non-ascii values in the config file. For example, a custom kernel path containing Chinese characters will cause WSL_E_CUSTOM_KERNEL_NOT_FOUND.

This PR removes the faulty static cast and stores the config value in wstring instead of string. So non-ascii values are preserved.

* Prevent potential invalid access for string array pretty print (#41673)

* resolve comments (#41642)

This is a follow up to PR #41512

Remove the redundant restore cgroup namespace code.
Simplify the cgroup check logic by moving the retry inside the debug shell.
Add a new systemd boot timeout test.

* Use a static CRT in debug builds (#41684)

* Fix potential test failure in BrokenDistroImport by not assuming the disk's block device in WSL (#41686)

* Update releaseScripts reference from v1 to v2 (#41687)

* INcrease the VM termination timeout to 30 seconds (#41688)

* Impersonate the caller before making various filesystem operations (#41689)

* Impersonate the caller before making various filesystem operations

* Apply PR feedback

* Support STDIN through SDK (#41698)

* stdin flag

* add winrt test, fix coroutine bug in streams

* Followup to STDIN PR (#41703)

* Add ability to format your branch (#41699)

* Remove references to WSLC being in a preview (#41704)

* Don't write to the install log file if it's a reparse point (#41705)

* Use the latest ESRP signing key code (#41640)

* Use the latest ESRP signing key code

* Only change key code

* Restore original pipeline line endings

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Refactor event stream cancellation waits (#41696)

* Don't expect the brd module logline to stabilize the CustomDmesgOutput test case (#41714)

* Use WSL icon for developer docs (#41715)

* Use WSL icon for developer docs

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ce78a21f-e946-4e9c-b2ea-934a5b0935f3

* Reuse docs logo as favicon

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ce78a21f-e946-4e9c-b2ea-934a5b0935f3

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Copilot-Session: ce78a21f-e946-4e9c-b2ea-934a5b0935f3

* Fix: update drvfs gid uid after default uid is set in oobe (#41521)

For a newly installed distro, the drvfs are initially mount as 0:0. And is not updated after oobe sets the default uid. This could cause access issues before the distro is restarted.

This PR updates the auto mounted drvfs gid uid before completing the oobe. The non-auto mounted shares are not remounted to avoid breaking user set gid uid values.

* Update WSLC SDK API documentation (#41677)

* Update WSLC SDK API documentation

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update docs

* Update docs

* Quick fixes

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Craig Loewen <crloewen@microsoft.com>

* Updated README (#41723)

* Expose kernel headers and perf to distributions (#41400)

* Expose kernel headers and perf to distributions

Mount kernel-matched headers and perf tooling from the artifacts VHD into each distribution, expose perf through the default environment, and cover the resulting paths and replacement behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: cdebc331-ad3e-492e-9591-c25587c859c5

* Address kernel artifact review feedback

Correct the documented header target and directory fallback, and log failures while removing mount path environment variables.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: cdebc331-ad3e-492e-9591-c25587c859c5

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Copilot-Session: cdebc331-ad3e-492e-9591-c25587c859c5

* Use iterators in FromJson to avoid copies (#41641)

* Use iterators in FromJson to avoid copies

* Cleanup

* Fix template build

* Format

* Use a retry with timeout in HostPortCantBeBoundByGuest (#41728)

* Run the nightly tests on ge-current (#41725)

* Don't fail configuring the consommé loopback adapter when ipv6 is disabled (#41729)

* Enable experimental sparse VHD creation (#41726)

* Refine sparse VHD creation policy

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Enable experimental sparse VHD creation in WSL

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Make sparse VHD unsafe flag optional

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Keep fixed VHD creation non-sparse

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update Microsoft.RemoteDesktop.Client.MSRDC.SessionHost to version 1.2.7391 (#41730)

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>

* Fix WSL container event timestamps (#41717)

* Revert "Enable RedirectionGuard process mitigation" (#41744)

* Revert "Enable RedirectionGuard process mitigation (#41542)"

This reverts commit e53598d.

* Add comments

* Fix comment

* Add --format json to wslc events (#41734)

* Update the DACL to only allow access to the user when creating virtual disks (#41678)

* Update the DACL to only allow access to the user when creating virtual disks

* Save state

* Increase test coverage

* Fix test

* Apply PR feedback

* Apply PR feedback

* Format

* Apply PR suggestions

* Apply PR suggestions

* Clarify container image localization context (#41743)

Add translator guidance distinguishing container images from pictures or photos for the affected WSLC strings.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Copilot-Session: 88d3d4b4-5a0e-4d97-9ed4-0fcd856e61de

* Add RLCPlus-9 and RLCPlus-10 (Rocky Linux Plus, CIQ) (#41323)

* Add RLCPlus-9 and RLCPlus-10 (Rocky Linux Plus, CIQ)

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Re-trigger CI: xattr check confirmed clean (no security.selinux attributes found), all four combinations remain boot-tested

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Fix race condition on system distro & init port access (#41762)

* archlinux: Release 2026.10.01.179549 (#41755)

This is an automated release [1].

[1] https://gitlab.archlinux.org/archlinux/archlinux-wsl/-/blob/main/.gitlab-ci.yml

* Enable automatic vNUMA for large WSL VMs (#41741)

* Enable automatic vNUMA for WSL VMs

Add the HCS NUMA topology object so HCS can derive a supported virtual topology for large processor counts instead of requiring WSL to clamp the VM to 256 processors.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ea0c67c5-0211-479b-a7b5-59aebb19b71c

* Gate automatic vNUMA on Germanium

Preserve the existing single-node HCS configuration on older Windows builds where vNUMA topology creation is unsupported.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ea0c67c5-0211-479b-a7b5-59aebb19b71c

* Remove vNUMA test coverage

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ea0c67c5-0211-479b-a7b5-59aebb19b71c

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Copilot-Session: ea0c67c5-0211-479b-a7b5-59aebb19b71c

* Exclude wslc.exe and wslcsession.exe from custom LSP providers (#41767)

* Exclude wslc.exe and wslcsession.exe from custom LSP providers

* Include container.exe

* Localization change from build: 159271766 (#41772)

Co-authored-by: WSL localization <noreply@microsoft.com>

* Reuse EmptyObject for HCS NUMA configuration (#41768)

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Implement container health notifications to wslc events (#41763)

* Save state

* Increase test coverage

* Remove useless state

* Replace TableOutput with TableData model and TableRenderer (#41700)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* refactor container cp task to be simpler and move logic to container service and common filesystem helpers (#41668)

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Use a fallback gateway if no ipv4 gateway is available in consommé networking (#41779)

* Record Docker die and stop events with parity (#41770)

* Save state (#41780)

* Localization change from build: 159357096 (#41786)

Co-authored-by: WSL localization <noreply@microsoft.com>

* Update issue template for WSLC (#41778)

* Update issue tempalte for WSLC

* Fix description

* Run the nightly tests on Windows Server 2025 (#41760)

* Run the nightly tests on ge-current

* Run the nightly tests on Windows Server 2025

* Skip some network tests

* Update name

* Fix mirrored check

* Use the server field

* Localization change from build: 159470205 (#41800)

Co-authored-by: WSL localization <noreply@microsoft.com>

* Fix various issues preventing the ModernOOBE test from running multiple times on the same test_distro (#41781)

* Remove unused delay-load options (#41804)

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Disable pushing to the store by default (#41782)

* Scope down the ephemeral port range in various consommé tests (#41805)

* Fix race condition in LifetimeManager (#41807)

* Use DistroFileChange instead of going through wsl.localhost (#41810)

* Explicitely setup impersonation when instanciating IWslSupport (#41815)

* Wait for bound ports to be released by the port relay in the tests (#41817)

* Support reading the wslc image build context from stdin (#41765)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update Microsoft.WSL.Kernel to 6.18.54.1 (#41822)

* Add logic to reject commands with extra arguments (#41821)

* Add logic to reject commands with extra arguments

* Simplify tests

* Improve wslc event filters (#41809)

* Localization change from build: 159727887 (#41826)

Co-authored-by: WSL localization <noreply@microsoft.com>

* Make the binfmt mount writable (#41808)

* Make the binfmt mount writeable

* Apply PR suggestions

* Match container and network filters across event types (#41818)

* Fix incorrect wsl.conf warnings being displayed when creating a new distribution (#41820)

* Convert EnsureCaseSensitiveDirectoryRecursive to iterative traversal (#40347)

* Convert EnsureCaseSensitiveDirectoryRecursive to iterative traversal

Replace unbounded recursive depth-first traversal with an iterative
approach using an explicit stack. A deeply nested directory tree could
overflow the thread stack during the recursive calls.

The iterative version collects directories in reverse post-order during
traversal, then marks them bottom-up (children before parents),
preserving the ordering invariant that EnsureCaseSensitiveDirectory
relies on for its early-exit optimization.

Bug: 61964147, 61974992, 61911308, 61463090

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add deep-nesting regression test for case-sensitive recursion

The original recursive EnsureCaseSensitiveDirectoryRecursive could blow
the Windows 1 MB thread stack at a few hundred levels of nesting because
each frame carried a FILE_ID_BOTH_DIR_INFORMATION enumeration buffer.
The iterative implementation in this PR moves that state to the heap, so
a very deep tree must complete without crashing.

The test creates a 1024-level chain via the \\\\?\\ long-path prefix
(cumulative path length exceeds MAX_PATH) and then calls
EnsureCaseSensitiveDirectory on the root. Cleanup goes through the same
long-path prefix so remove_all can see every component.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add publishing to DCAT, nuget to the release pipeline (#41549)

* Add a testpass on rs_base2 (#41832)

* Run the nightly tests on rs_base2

* Update tests for os change

* Update tests

* Localization change from build: 159856815 (#41839)

Co-authored-by: WSL localization <noreply@microsoft.com>

* Fix the security model link in SECURITY.md (#41835)

#41605 moved the security model to doc/docs/technical-documentation/security.md; the link in SECURITY.md still pointed at doc/docs/security.md.

* Fix RLCPlus distribution manifest formatting (#41841)

Restore canonical JSON indentation without changing distribution data so the distribution validation workflow passes its formatting check.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Copilot-Session: aa251cac-d075-47a8-8757-92e013a714d8

* Update GitPython to resolve Dependabot alerts (#41840)

Upgrade both Python tooling requirement pins to 3.1.62, which fixes all four advisories reported across eight Dependabot alerts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Copilot-Session: aa251cac-d075-47a8-8757-92e013a714d8

* Fix CaseSensitivityDeepNesting test build failure (#41849)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Reorganize test/windows into common/, wsl/, and wslc/ (#41661)

* Reorganize test/windows and split WSLCTests.cpp into per-domain files

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Split wslc tests into per-layer directories and move common unit tests under common/unit

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Flatten test/windows into common/, wsl/, wslc/ and move wslc helpers to common

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Port master's WSLC event and network tests into the split test files

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Revert WSLCTests.cpp split so the change is file moves only

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update test layout guidance for common/wsl/wslc split

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Make CaseSensitivityDeepNesting testDir static constexpr so the lambda can use it

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Drop static from CaseSensitivityDeepNesting testDir so it can be captured

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix e2fsck return code 1 treated as failure in resize (#41720)

e2fsck -f -y returns 1 or 2 when there were errors fixed. However, the resize implementation currently only accepts 0 as a success.

This PR adds 1 and 2 to the accepted return codes.

* Document WSL architecture and contributor commands for Copilot (#41843)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Copilot-Session: 25aa9436-0656-41c8-a222-d81d6414a9e6

* Add WSLC volume events (#41831)

* Fix incorrect AAAA DNS resolution for static DNS records causing resolution failure in musl (#41859)

* Fix race condition causing potential use-after-free in NatNetworking (#41850)

* Acquire m_instanceLock before calling _ValidateDistributionNameAndPathNotInUse() (#41855)

* Acquire m_instanceLock before calling _ValidateDistributionNameAndPathNotInUse

* Cleanup diff

* Cleanup diff

* Make the store publish stage opt-in (#41857)

* Remove the gate before publishing nuget packages, and rename to avoid confusion (#41858)

* Remove the gate before publishing nuget packages, and rename to avoid confusion

* Complete nuget

* Fail bind() requests that fail in Windows (#41856)

* Don't add swiotlb=force with the hv_pci swiotlb pool (#41829)

The hv_pci pool is created with force_bounce set, so virtio devices
bounce through it without the global flag. swiotlb=force only made every
other device, mainly hv_storvsc, bounce all its I/O through the default
64 MB pool, which runs out under load (#41828).

* Fix potential crash caused by error during session initialization (#41887)

* Add a /hyperv to triage hyper-v issues (#41885)

* Localization change from build: 160297307 (#41890)

Co-authored-by: WSL localization <noreply@microsoft.com>

* Increase the default commited stack size to 64KB (#41888)

* Increase the default commited stack size to 64KB

* Fix formatting of stack size comment in CMakeLists

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* suppress systemctl is-system-running pulling error messages (#41881)

The systemctl is-system-running polling can produce error messages like Failed to connect to bus: No such file or directory before d-bus is ready. And those error messages are duplicated into /dev/kmsg by wsl.

This PR suppresses the error messages as those are not useful for the polling result.

* Disable unsafe move constructors in ScopedRelay (#41897)

* Wait for the drvfs initialization thread to exit before destroying WslCoreVm (#41895)

* Fix potential crash by use-after-free by in the stdin relay thread (#41894)

* Release resources that could call callbacks before returning from HcsVirtualMachine's constructor on failure (#41908)

* Narrow volume event publish ordering comments (#41889)

* Apply clang-format to merged files

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f2cf5bc5-64ce-4bfc-a921-ae7ca379ad64

* Add wslc cp alias for wslc container cp (#41902)

* Add wslc cp alias for wslc container cp

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Move wslc cp usage examples under generated usage line with color

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Use cp short description key and add cp help example tests

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove cp help examples

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix potential starvation in COMImplClass::Disconnect (#41912)

* Use repository NuGet configuration for out-of-tree builds (#41916)

* Fix a potential use-after-free between plugin calls and WSLCSessionManagerImpl's destruction (#41911)

* Save state

* Simplify reset logic

* Prepare for PR

* Add missing synchronization around load WinHttp proxy methods (#41909)

* Add missing synchronization around load WinHttp proxy methods

* Fix loading logic

* Fix missing synchronization on m_httpProxyStateTracker access (#41907)

* Fix missing synchronization on m_httpProxyStateTracker access

* Update header

* Use the instance lock instead

* Format

* Fix potential deadlock in between VM exit callback and session shutdown (#41910)

* Fix potential deadlock in between VM exit callback and ~LxssUserSessionImpl

* Cleanup diff

* Fix potential use-after-free in EpollWatcher (#41896)

* Match docker -v parsing: LTR spec parser, shared validation, config-v… (#41905)

* Match docker -v parsing: LTR spec parser, shared validation, config-volume anonymous volumes

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Reject extra colons in -v mode section

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Mount bind volumes during cp on non-running containers (#41906)

* Mount bind volumes during cp on non-running containers

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Mirror issue repro in bind mount cp test

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Throw on deleted container in archive mounts, generate test tar in container

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* reap sub processes during shutdown to unblock systemd (#41899)

After the cgroup isolation change. The process tree looks like this:
```
init (systemd)                 in the distro cgroup namespace
    init (wsl)                 in the root cgroup namespace
        login                  in the distro cgroup namespace
```
And the poweroff sequence is:

WSL init resets the signal handlers, which sets SIGCHLD to default.
WSL init calls systemctl poweroff
systemd kills processes in it's cgroup namespace like the login process. And skips processes like the wsl init in the root namespace.
The WSL init does not reap the killed sub process. Making it a zombie in the distro namespace.
Systemd waits for the zombie processes and blocks.
The timeout in init finally shutsdown with RB_POWER_OFF.
This could cause the terminate to wait for the timeout and slow down the termination.

This PR adds a waitpid loop that reaps any subprocesses of the WSL init during systemd poweroff. So systemd is no longer stuck by the zombie processes. And it calls BR_POWER_OFF itself to kill the WSL processes in the same PID namespace but in the root cgroup namespace.

* Localization change from build: 160603855 (#41933)

Co-authored-by: WSL localization <noreply@microsoft.com>

* Fix incorrect srwlock usage in when initializing drvfs (#41925)

* Fix potential deadlock in WSL1 instance termination (#41922)

* Fix potential deadlock in WSL1 instance termination

* Differenciate using instance ids

* Prepare for PR

* Fix potential use-after-free if the WSLC VM is killed while the last session COM reference is being released (#41946)

---------

Co-authored-by: Ben Hillis <benhillis@gmail.com>
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Co-authored-by: Blue <OneBlue@users.noreply.github.com>
Co-authored-by: WSL localization <noreply@microsoft.com>
Co-authored-by: David Bennett <dbennett-msft@outlook.com>
Co-authored-by: Feng Wang <wang6922@outlook.com>
Co-authored-by: ggarzia-MSFT <gavingarzia@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: FetoiuCatalin <fetoiucatalin@gmail.com>
Co-authored-by: Catalin-Emil Fetoiu <cfetoiu@microsoft.com>
Co-authored-by: beena352 <beenachauhan@microsoft.com>
Co-authored-by: Flor Chacón <14323496+florelis@users.noreply.github.com>
Co-authored-by: JohnMcPMS <johnmcp@microsoft.com>
Co-authored-by: Keith Horton <khorton@microsoft.com>
Co-authored-by: Craig Loewen <crloewen@microsoft.com>
Co-authored-by: Patrick Swartz <patrick@swartzclan.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Arch Linux Technical User <65091038+archlinux-github@users.noreply.github.com>
Co-authored-by: Mitchell Levy <46305051+chessturo@users.noreply.github.com>
Co-authored-by: Franco Ceballos Rastello <f.ceballos.rastello@gmail.com>
Co-authored-by: Oleg Tsvetkov <oleg-tsv@yandex.ru>
Co-authored-by: Tuna Birgün <tunabirgun@gmail.com>
Copilot-Session: ce78a21f-e946-4e9c-b2ea-934a5b0935f3
Copilot-Session: cdebc331-ad3e-492e-9591-c25587c859c5
Copilot-Session: 88d3d4b4-5a0e-4d97-9ed4-0fcd856e61de
Copilot-Session: ea0c67c5-0211-479b-a7b5-59aebb19b71c
Copilot-Session: aa251cac-d075-47a8-8757-92e013a714d8
Copilot-Session: 25aa9436-0656-41c8-a222-d81d6414a9e6
Copilot-Session: f2cf5bc5-64ce-4bfc-a921-ae7ca379ad64

* address previous feedback

* .

* Feedback

* lifetime/callback cleanup

* Address the rest of feedbac

* Address feedback

* feedback

* Feedback

* feedback

* Remove devicehostproxy changes

* Validate boot disk read access before granting VM access

Restore the original validation order so a best-effort HCS access-grant failure cannot contaminate the read-access error context.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Preserve disk state when VM termination fails

Propagate HCS termination failures before beginning resource cleanup. Only restore attached disks and publish shutdown completion after termination succeeds or exit has already been reported.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* feedback

* test fix

* feedback

* Eliminate potential race in terminate()

* Remove redundant common include directory

---------

Co-authored-by: Ben Hillis <benhillis@gmail.com>
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Co-authored-by: Blue <OneBlue@users.noreply.github.com>
Co-authored-by: WSL localization <noreply@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: David Bennett <dbennett-msft@outlook.com>
Co-authored-by: Feng Wang <wang6922@outlook.com>
Co-authored-by: ggarzia-MSFT <gavingarzia@microsoft.com>
Co-authored-by: FetoiuCatalin <fetoiucatalin@gmail.com>
Co-authored-by: Catalin-Emil Fetoiu <cfetoiu@microsoft.com>
Co-authored-by: beena352 <beenachauhan@microsoft.com>
Co-authored-by: Flor Chacón <14323496+florelis@users.noreply.github.com>
Co-authored-by: JohnMcPMS <johnmcp@microsoft.com>
Co-authored-by: Keith Horton <khorton@microsoft.com>
Co-authored-by: Craig Loewen <crloewen@microsoft.com>
Co-authored-by: Patrick Swartz <patrick@swartzclan.com>
Co-authored-by: Arch Linux Technical User <65091038+archlinux-github@users.noreply.github.com>
Co-authored-by: Mitchell Levy <46305051+chessturo@users.noreply.github.com>
Co-authored-by: Franco Ceballos Rastello <f.ceballos.rastello@gmail.com>
Co-authored-by: Oleg Tsvetkov <oleg-tsv@yandex.ru>
Co-authored-by: Tuna Birgün <tunabirgun@gmail.com>
Co-authored-by: Daman Mulye <damanmulye@microsoft.com>
Copilot-Session: 563f9b88-0149-48a5-ac0c-07d6f0adbd9e
Copilot-Session: ce78a21f-e946-4e9c-b2ea-934a5b0935f3
Copilot-Session: cdebc331-ad3e-492e-9591-c25587c859c5
Copilot-Session: 88d3d4b4-5a0e-4d97-9ed4-0fcd856e61de
Copilot-Session: ea0c67c5-0211-479b-a7b5-59aebb19b71c
Copilot-Session: aa251cac-d075-47a8-8757-92e013a714d8
Copilot-Session: 25aa9436-0656-41c8-a222-d81d6414a9e6
Copilot-Session: f2cf5bc5-64ce-4bfc-a921-ae7ca379ad64
Copilot-Session: 6dd56ac9-2a18-4b8a-8a41-fa065b9071f7
Ben Hillis (benhillis) added a commit that referenced this pull request Nov 10, 2026
* resolve comments (#41642)

This is a follow up to PR #41512

Remove the redundant restore cgroup namespace code.
Simplify the cgroup check logic by moving the retry inside the debug shell.
Add a new systemd boot timeout test.

* Use a static CRT in debug builds (#41684)

* Fix potential test failure in BrokenDistroImport by not assuming the disk's block device in WSL (#41686)

* Update releaseScripts reference from v1 to v2 (#41687)

* INcrease the VM termination timeout to 30 seconds (#41688)

* Impersonate the caller before making various filesystem operations (#41689)

* Impersonate the caller before making various filesystem operations

* Apply PR feedback

* Support STDIN through SDK (#41698)

* stdin flag

* add winrt test, fix coroutine bug in streams

* Followup to STDIN PR (#41703)

* Add ability to format your branch (#41699)

* Remove references to WSLC being in a preview (#41704)

* Don't write to the install log file if it's a reparse point (#41705)

* Use the latest ESRP signing key code (#41640)

* Use the latest ESRP signing key code

* Only change key code

* Restore original pipeline line endings

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Refactor event stream cancellation waits (#41696)

* Don't expect the brd module logline to stabilize the CustomDmesgOutput test case (#41714)

* Use WSL icon for developer docs (#41715)

* Use WSL icon for developer docs

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ce78a21f-e946-4e9c-b2ea-934a5b0935f3

* Reuse docs logo as favicon

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ce78a21f-e946-4e9c-b2ea-934a5b0935f3

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Copilot-Session: ce78a21f-e946-4e9c-b2ea-934a5b0935f3

* Fix: update drvfs gid uid after default uid is set in oobe (#41521)

For a newly installed distro, the drvfs are initially mount as 0:0. And is not updated after oobe sets the default uid. This could cause access issues before the distro is restarted.

This PR updates the auto mounted drvfs gid uid before completing the oobe. The non-auto mounted shares are not remounted to avoid breaking user set gid uid values.

* Update WSLC SDK API documentation (#41677)

* Update WSLC SDK API documentation

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update docs

* Update docs

* Quick fixes

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Craig Loewen <crloewen@microsoft.com>

* Updated README (#41723)

* Expose kernel headers and perf to distributions (#41400)

* Expose kernel headers and perf to distributions

Mount kernel-matched headers and perf tooling from the artifacts VHD into each distribution, expose perf through the default environment, and cover the resulting paths and replacement behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: cdebc331-ad3e-492e-9591-c25587c859c5

* Address kernel artifact review feedback

Correct the documented header target and directory fallback, and log failures while removing mount path environment variables.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: cdebc331-ad3e-492e-9591-c25587c859c5

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Copilot-Session: cdebc331-ad3e-492e-9591-c25587c859c5

* Use iterators in FromJson to avoid copies (#41641)

* Use iterators in FromJson to avoid copies

* Cleanup

* Fix template build

* Format

* Use a retry with timeout in HostPortCantBeBoundByGuest (#41728)

* Run the nightly tests on ge-current (#41725)

* Don't fail configuring the consommé loopback adapter when ipv6 is disabled (#41729)

* Enable experimental sparse VHD creation (#41726)

* Refine sparse VHD creation policy

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Enable experimental sparse VHD creation in WSL

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Make sparse VHD unsafe flag optional

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Keep fixed VHD creation non-sparse

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update Microsoft.RemoteDesktop.Client.MSRDC.SessionHost to version 1.2.7391 (#41730)

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>

* Fix WSL container event timestamps (#41717)

* Revert "Enable RedirectionGuard process mitigation" (#41744)

* Revert "Enable RedirectionGuard process mitigation (#41542)"

This reverts commit e53598d74f8fbac5dd4cbfe67fa0436c869f3c2a.

* Add comments

* Fix comment

* Add --format json to wslc events (#41734)

* Update the DACL to only allow access to the user when creating virtual disks (#41678)

* Update the DACL to only allow access to the user when creating virtual disks

* Save state

* Increase test coverage

* Fix test

* Apply PR feedback

* Apply PR feedback

* Format

* Apply PR suggestions

* Apply PR suggestions

* Clarify container image localization context (#41743)

Add translator guidance distinguishing container images from pictures or photos for the affected WSLC strings.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Copilot-Session: 88d3d4b4-5a0e-4d97-9ed4-0fcd856e61de

* Add RLCPlus-9 and RLCPlus-10 (Rocky Linux Plus, CIQ) (#41323)

* Add RLCPlus-9 and RLCPlus-10 (Rocky Linux Plus, CIQ)

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Re-trigger CI: xattr check confirmed clean (no security.selinux attributes found), all four combinations remain boot-tested

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Fix race condition on system distro & init port access (#41762)

* archlinux: Release 2026.10.01.179549 (#41755)

This is an automated release [1].

[1] https://gitlab.archlinux.org/archlinux/archlinux-wsl/-/blob/main/.gitlab-ci.yml

* Enable automatic vNUMA for large WSL VMs (#41741)

* Enable automatic vNUMA for WSL VMs

Add the HCS NUMA topology object so HCS can derive a supported virtual topology for large processor counts instead of requiring WSL to clamp the VM to 256 processors.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ea0c67c5-0211-479b-a7b5-59aebb19b71c

* Gate automatic vNUMA on Germanium

Preserve the existing single-node HCS configuration on older Windows builds where vNUMA topology creation is unsupported.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ea0c67c5-0211-479b-a7b5-59aebb19b71c

* Remove vNUMA test coverage

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ea0c67c5-0211-479b-a7b5-59aebb19b71c

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Copilot-Session: ea0c67c5-0211-479b-a7b5-59aebb19b71c

* Exclude wslc.exe and wslcsession.exe from custom LSP providers (#41767)

* Exclude wslc.exe and wslcsession.exe from custom LSP providers

* Include container.exe

* Localization change from build: 159271766 (#41772)

Co-authored-by: WSL localization <noreply@microsoft.com>

* Reuse EmptyObject for HCS NUMA configuration (#41768)

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Implement container health notifications to wslc events (#41763)

* Save state

* Increase test coverage

* Remove useless state

* Replace TableOutput with TableData model and TableRenderer (#41700)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* refactor container cp task to be simpler and move logic to container service and common filesystem helpers (#41668)

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Use a fallback gateway if no ipv4 gateway is available in consommé networking (#41779)

* Record Docker die and stop events with parity (#41770)

* Save state (#41780)

* Localization change from build: 159357096 (#41786)

Co-authored-by: WSL localization <noreply@microsoft.com>

* Update issue template for WSLC (#41778)

* Update issue tempalte for WSLC

* Fix description

* Run the nightly tests on Windows Server 2025 (#41760)

* Run the nightly tests on ge-current

* Run the nightly tests on Windows Server 2025

* Skip some network tests

* Update name

* Fix mirrored check

* Use the server field

* Localization change from build: 159470205 (#41800)

Co-authored-by: WSL localization <noreply@microsoft.com>

* Fix various issues preventing the ModernOOBE test from running multiple times on the same test_distro (#41781)

* Remove unused delay-load options (#41804)

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Disable pushing to the store by default (#41782)

* Scope down the ephemeral port range in various consommé tests (#41805)

* Fix race condition in LifetimeManager (#41807)

* Use DistroFileChange instead of going through wsl.localhost (#41810)

* Explicitely setup impersonation when instanciating IWslSupport (#41815)

* Wait for bound ports to be released by the port relay in the tests (#41817)

* Support reading the wslc image build context from stdin (#41765)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update Microsoft.WSL.Kernel to 6.18.54.1 (#41822)

* Add logic to reject commands with extra arguments (#41821)

* Add logic to reject commands with extra arguments

* Simplify tests

* Improve wslc event filters (#41809)

* Localization change from build: 159727887 (#41826)

Co-authored-by: WSL localization <noreply@microsoft.com>

* Make the binfmt mount writable (#41808)

* Make the binfmt mount writeable

* Apply PR suggestions

* Match container and network filters across event types (#41818)

* Fix incorrect wsl.conf warnings being displayed when creating a new distribution (#41820)

* Convert EnsureCaseSensitiveDirectoryRecursive to iterative traversal (#40347)

* Convert EnsureCaseSensitiveDirectoryRecursive to iterative traversal

Replace unbounded recursive depth-first traversal with an iterative
approach using an explicit stack. A deeply nested directory tree could
overflow the thread stack during the recursive calls.

The iterative version collects directories in reverse post-order during
traversal, then marks them bottom-up (children before parents),
preserving the ordering invariant that EnsureCaseSensitiveDirectory
relies on for its early-exit optimization.

Bug: 61964147, 61974992, 61911308, 61463090

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add deep-nesting regression test for case-sensitive recursion

The original recursive EnsureCaseSensitiveDirectoryRecursive could blow
the Windows 1 MB thread stack at a few hundred levels of nesting because
each frame carried a FILE_ID_BOTH_DIR_INFORMATION enumeration buffer.
The iterative implementation in this PR moves that state to the heap, so
a very deep tree must complete without crashing.

The test creates a 1024-level chain via the \\\\?\\ long-path prefix
(cumulative path length exceeds MAX_PATH) and then calls
EnsureCaseSensitiveDirectory on the root. Cleanup goes through the same
long-path prefix so remove_all can see every component.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add publishing to DCAT, nuget to the release pipeline (#41549)

* Add a testpass on rs_base2 (#41832)

* Run the nightly tests on rs_base2

* Update tests for os change

* Update tests

* Localization change from build: 159856815 (#41839)

Co-authored-by: WSL localization <noreply@microsoft.com>

* Fix the security model link in SECURITY.md (#41835)

#41605 moved the security model to doc/docs/technical-documentation/security.md; the link in SECURITY.md still pointed at doc/docs/security.md.

* Fix RLCPlus distribution manifest formatting (#41841)

Restore canonical JSON indentation without changing distribution data so the distribution validation workflow passes its formatting check.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Copilot-Session: aa251cac-d075-47a8-8757-92e013a714d8

* Update GitPython to resolve Dependabot alerts (#41840)

Upgrade both Python tooling requirement pins to 3.1.62, which fixes all four advisories reported across eight Dependabot alerts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Copilot-Session: aa251cac-d075-47a8-8757-92e013a714d8

* Fix CaseSensitivityDeepNesting test build failure (#41849)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Reorganize test/windows into common/, wsl/, and wslc/ (#41661)

* Reorganize test/windows and split WSLCTests.cpp into per-domain files

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Split wslc tests into per-layer directories and move common unit tests under common/unit

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Flatten test/windows into common/, wsl/, wslc/ and move wslc helpers to common

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Port master's WSLC event and network tests into the split test files

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Revert WSLCTests.cpp split so the change is file moves only

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update test layout guidance for common/wsl/wslc split

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Make CaseSensitivityDeepNesting testDir static constexpr so the lambda can use it

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Drop static from CaseSensitivityDeepNesting testDir so it can be captured

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix e2fsck return code 1 treated as failure in resize (#41720)

e2fsck -f -y returns 1 or 2 when there were errors fixed. However, the resize implementation currently only accepts 0 as a success.

This PR adds 1 and 2 to the accepted return codes.

* Document WSL architecture and contributor commands for Copilot (#41843)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Copilot-Session: 25aa9436-0656-41c8-a222-d81d6414a9e6

* Add WSLC volume events (#41831)

* Fix incorrect AAAA DNS resolution for static DNS records causing resolution failure in musl (#41859)

* Fix race condition causing potential use-after-free in NatNetworking (#41850)

* Acquire m_instanceLock before calling _ValidateDistributionNameAndPathNotInUse() (#41855)

* Acquire m_instanceLock before calling _ValidateDistributionNameAndPathNotInUse

* Cleanup diff

* Cleanup diff

* Make the store publish stage opt-in (#41857)

* Remove the gate before publishing nuget packages, and rename to avoid confusion (#41858)

* Remove the gate before publishing nuget packages, and rename to avoid confusion

* Complete nuget

* Fail bind() requests that fail in Windows (#41856)

* Don't add swiotlb=force with the hv_pci swiotlb pool (#41829)

The hv_pci pool is created with force_bounce set, so virtio devices
bounce through it without the global flag. swiotlb=force only made every
other device, mainly hv_storvsc, bounce all its I/O through the default
64 MB pool, which runs out under load (#41828).

* Fix potential crash caused by error during session initialization (#41887)

* Add a /hyperv to triage hyper-v issues (#41885)

* Localization change from build: 160297307 (#41890)

Co-authored-by: WSL localization <noreply@microsoft.com>

* Increase the default commited stack size to 64KB (#41888)

* Increase the default commited stack size to 64KB

* Fix formatting of stack size comment in CMakeLists

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* suppress systemctl is-system-running pulling error messages (#41881)

The systemctl is-system-running polling can produce error messages like Failed to connect to bus: No such file or directory before d-bus is ready. And those error messages are duplicated into /dev/kmsg by wsl.

This PR suppresses the error messages as those are not useful for the polling result.

* Disable unsafe move constructors in ScopedRelay (#41897)

* Wait for the drvfs initialization thread to exit before destroying WslCoreVm (#41895)

* Fix potential crash by use-after-free by in the stdin relay thread (#41894)

* Release resources that could call callbacks before returning from HcsVirtualMachine's constructor on failure (#41908)

* Narrow volume event publish ordering comments (#41889)

* Add wslc cp alias for wslc container cp (#41902)

* Add wslc cp alias for wslc container cp

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Move wslc cp usage examples under generated usage line with color

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Use cp short description key and add cp help example tests

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove cp help examples

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix potential starvation in COMImplClass::Disconnect (#41912)

* Use repository NuGet configuration for out-of-tree builds (#41916)

* Fix a potential use-after-free between plugin calls and WSLCSessionManagerImpl's destruction (#41911)

* Save state

* Simplify reset logic

* Prepare for PR

* Add missing synchronization around load WinHttp proxy methods (#41909)

* Add missing synchronization around load WinHttp proxy methods

* Fix loading logic

* Fix missing synchronization on m_httpProxyStateTracker access (#41907)

* Fix missing synchronization on m_httpProxyStateTracker access

* Update header

* Use the instance lock instead

* Format

* Fix potential deadlock in between VM exit callback and session shutdown (#41910)

* Fix potential deadlock in between VM exit callback and ~LxssUserSessionImpl

* Cleanup diff

* Fix potential use-after-free in EpollWatcher (#41896)

* Match docker -v parsing: LTR spec parser, shared validation, config-v… (#41905)

* Match docker -v parsing: LTR spec parser, shared validation, config-volume anonymous volumes

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Reject extra colons in -v mode section

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Mount bind volumes during cp on non-running containers (#41906)

* Mount bind volumes during cp on non-running containers

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Mirror issue repro in bind mount cp test

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Throw on deleted container in archive mounts, generate test tar in container

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* reap sub processes during shutdown to unblock systemd (#41899)

After the cgroup isolation change. The process tree looks like this:
```
init (systemd)                 in the distro cgroup namespace
    init (wsl)                 in the root cgroup namespace
        login                  in the distro cgroup namespace
```
And the poweroff sequence is:

WSL init resets the signal handlers, which sets SIGCHLD to default.
WSL init calls systemctl poweroff
systemd kills processes in it's cgroup namespace like the login process. And skips processes like the wsl init in the root namespace.
The WSL init does not reap the killed sub process. Making it a zombie in the distro namespace.
Systemd waits for the zombie processes and blocks.
The timeout in init finally shutsdown with RB_POWER_OFF.
This could cause the terminate to wait for the timeout and slow down the termination.

This PR adds a waitpid loop that reaps any subprocesses of the WSL init during systemd poweroff. So systemd is no longer stuck by the zombie processes. And it calls BR_POWER_OFF itself to kill the WSL processes in the same PID namespace but in the root cgroup namespace.

* Localization change from build: 160603855 (#41933)

Co-authored-by: WSL localization <noreply@microsoft.com>

* Fix incorrect srwlock usage in when initializing drvfs (#41925)

* Fix potential deadlock in WSL1 instance termination (#41922)

* Fix potential deadlock in WSL1 instance termination

* Differenciate using instance ids

* Prepare for PR

* Fix potential use-after-free if the WSLC VM is killed while the last session COM reference is being released (#41946)

* Try smaller port ranges when mirrored mode cannot allocate ports (#41880)

The mirrored network mode requires a continuous 4096 port range. This allocation can fail if the host port range is fragmented. And if the allocation fails, the network mode falls back to none without a clear user facing message.

This PR makes two changes:

Retry the port allocation with a smaller range if the default 4096 count fails. Down to 512 ports.
Add user warnings when a smaller port range is used or the allocation eventually fails.

* Fix wslservice potentially killing wslcsession process too early (#41951)

* Localization change from build: 160716380 (#41954)

Co-authored-by: WSL localization <noreply@microsoft.com>

* Fix wslc inspect for slash-prefixed container names (#41923)

* Fix WSLC GPU hook execution and library discovery (#41886)

* Add hourly upstream sync workflow for feature/wsl-for-apps

* Remove upstream sync workflow

* Fix WSLC GPU hook execution and library discovery

Run image-provided ldconfig only from the sandboxed startContainer hook. Retain VM-side cache generation for non-root, read-only and minimal images, and configure musl library discovery.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address feedback

* Preserve GPU library discovery for non-root WSLC containers

Use a temporary root-owned setuid helper after container restrictions are applied, remove it before invoking image ldconfig, and preserve root identity through shell wrappers. Cover non-root loading, restart, privilege restrictions, and hook failures, with comments explaining the lifecycle and permission choices.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 41029ba7-2173-4277-b148-5de84b1db137

* Keep GPU linker-cache tests on WSLC APIs and bundled images

Use bundled Debian's Perl loader instead of pulling a Python image, replace Docker lifecycle commands with WSLC APIs, and remove Docker-only policy cases. Compare hook capabilities with an ordinary root WSLC process and keep rationale comments next to the relevant checks.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 41029ba7-2173-4277-b148-5de84b1db137

---------

Co-authored-by: Kevin Vega <kevinve@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 41029ba7-2173-4277-b148-5de84b1db137

* Fix NAT relay listener lifetime across active connections (#41948)

Co-authored-by: Jack Moffitt <jackmoffitt@microsoft.com>

* Warn when nested virtualization capability detection fails (#41942)

* Initial plan

* Warn when nested virtualization capability detection fails

Co-authored-by: benhillis <17727402+benhillis@users.noreply.github.com>

* Distinguish nested virtualization detection failures

Emit a localized detection-failure warning with the error code while retaining the unsupported warning for negative capability results.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: bbd8114d-2fc2-4be1-a8b0-f3fc6dc3f3d2

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: benhillis <17727402+benhillis@users.noreply.github.com>
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Copilot-Session: bbd8114d-2fc2-4be1-a8b0-f3fc6dc3f3d2

* Fix potential hang when a distribution is terminated while waiting on OOBE (#41924)

* Fix race condition in Signal() / ResizeTty() process logic (#41929)

* Fix race condition in Signal() / ResizeTty() process logic

* Fix test case

* Fix potential use free in WSLCContainer (#41949)

* Remove bundled perf integration (#41904)

* Expose bundled perf through WSL-owned paths

Keep perf artifacts read-only and expose them through a per-distro wrapper and managed local symlink without modifying distro packages or session search paths.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: dc502fd6-021a-4a35-8227-e3688decebda

* Preserve explicit perf helper path overrides

Default the runtime wrapper's PERF_EXEC_PATH only when unset or empty, and cover empty values and inherited overrides.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: dc502fd6-021a-4a35-8227-e3688decebda

* Strengthen bundled perf package-isolation coverage

Verify PERF_EXEC_PATH is not set globally and regular distro perf replacements remain writable across restarts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 513b5be8-a1a8-4bf1-8938-b74e06526ee3

* Prefer distro perf before bundled fallback

Dispatch to executable distro perf before setting bundled helper defaults, preserving arguments and failures. Cover dynamic selection and fallback, and document the behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 513b5be8-a1a8-4bf1-8938-b74e06526ee3

* Remove bundled perf integration

Stop mounting and exposing bundled perf so distro packages own perf installation and selection. Preserve kernel headers and modules and cover distro perf replacement across restarts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 513b5be8-a1a8-4bf1-8938-b74e06526ee3

* Remove obsolete distro perf regression test

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 513b5be8-a1a8-4bf1-8938-b74e06526ee3

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Copilot-Session: dc502fd6-021a-4a35-8227-e3688decebda
Copilot-Session: 513b5be8-a1a8-4bf1-8938-b74e06526ee3

* Fix potential hang while waiting for timezone thread (#41926)

* Run DCAT release jobs on a custom pool (#41961)

* Fix potential deadlock + use-after-free in WatchForExitedProcesses (#41928)

* Fix potential deadlock in WatchForExitedProcesses

* Cleanup test

* Move to an external registry

* Format

* WSLc Clarify image pull status message (#41753)

* Clarify image pull status message

Updates the `WSLCCLI_ImageNotFoundPulling` en-US resource string to say `not found locally` before pulling. This makes it clear the image may exist remotely and improves CLI message clarity.

* Update image pull test expectation

Co-authored-by: licon4812 <32421608+licon4812@users.noreply.github.com>

* Reword image pull message and update test

Updates the en-US `WSLCCLI_ImageNotFoundPulling` string to a clearer phrasing: `Unable to find image '{}' locally, pulling`. The WSLC container create E2E test expectation was updated to match this exact output so behavior and test assertions stay aligned.

* Align WSLC missing image message with Docker

Co-authored-by: licon4812 <32421608+licon4812@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

* Localization change from build: 160948052 (#41972)

Co-authored-by: WSL localization <noreply@microsoft.com>

* Don't sleep for 3 hours waiting for the installer service (#41962)

* Match console detach sequence for full UTF-16 characters (#41960)

* Match console detach sequence on full UTF-16 chars

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add console detach unicode low-byte test

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Move detach unicode test to wslc pseudoconsole E2E

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Write detach test unicode pair separately from marker

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Notice change from build: 160977557 (#41977)

Co-authored-by: WSL notice <noreply@microsoft.com>

* fix plan9 truncate the wrong file after replacement (#41974)

* Fix guiApplications config parsing (#41973)

* fix start up parsing regression

* Fix distro config parsing logic

* Add unit test

* Notice change from build: 160989053 (#41980)

Co-authored-by: WSL notice <noreply@microsoft.com>

* Fix potential use-after-free in MirroredNetworking (#41982)

* Add missing synchronization around container & process handles (#41983)

* CLI: Add --ipv6 to network create (#41303)

* Fix concurrent resource access in WSL1 instance during OOBE (#41981)

* Fix concurrent resource access in WSL1 instance during OOBE

* Don't get stuck if the distro gets stuck

* Raise distributionStartTimeout to 4 hours to trigger the test watchdogs when stuck (#42001)

* Use canonical path in WSLCE2E_Container_Cp_ContainerToLocal_FileDestinationBehavior (#42004)

* Fix incorrect COM lifetime tracking causing wslcsession.exe to potentially exit while references are still held by clients (#42000)

* Save state

* Mark pruned containers as exited

* Revert "Mark pruned containers as exited"

This reverts commit 91af5d2f44df08fb2daf91e6118a905d1348f114, including its test changes.

* Load container images

* Use a GIT reference

* Fix potential use free in WSLCContainer

* Support encrypted when opening the vhd for compaction (#42008)

* wslc rm --force: succeed when container does not exist (#42010)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add --cap-add and --cap-drop to wslc run and create for both cli and sdk (#41681)

* add --cap-add and --cap-drop options

* avoid repeating the warning on retry

* update docs

* fix localization

* update component check logic to avoid mismatch

* block container run and create when cap add is disabled

* Use version check instead of interface check

* allow current version in runtime version check

* resolve compatibility unrelated comments

* change compatibility design

* resolve comment

---------

Co-authored-by: Feng Wang (from Dev Box) <wangfen@microsoft.com>

* Update Microsoft.NETCore.App.Runtime to 10.0.13 (#42003)

* Update the linux version of conncheckshared to use poll instead of fd_set (#42016)

* Notice change from build: 161239276 (#42019)

Co-authored-by: WSL notice <noreply@microsoft.com>

* Fix ipv4 mapped ipv6 address handling in consomme mode (#42007)

Problem: Consomme treated IPv4-mapped IPv6 addresses as native IPv6, causing bind failures on IPv6-only host sockets and incorrect loopback/wildcard routing.

Fix: Normalize mapped addresses to IPv4 before port mapping and unmapping. Add regression coverage for mapped loopback and wildcard forwarding, including port cleanup.

* Localization change from build: 161288754 (#42027)

Co-authored-by: WSL localization <noreply@microsoft.com>

* Make m_telemetryCounter atomic (#42017)

* Reject messages with unterminated interface names in GNSPortTrackerChannel (#42022)

* Reject messages with unterminated interface names in GNSPortTrackerChannel

* Remove broken test

* Fix hresult comparison in interop (#42024)

The error code translation logic compares hresults to raw error codes. Which could cause all hresults to be translated into EINVAL instead of the intended ENOENT or EACCESS.

This PR fixes the comparison by converting the raw values to hresults.

This PR also piggy backs the error code change as a followup to #41880.

* Avoid generating SIGPIPE when replying to DNS clients (#42025)

A race condition between a write and the DNS client closing the tcp DNS connection abnormally can generate a SIGPIPE in the GNS process. Which could cause the process to crash.

This PR changes the syscall to send and avoids generating SIGPIPE with the MSG_NOSIGNAL flag.

* Localization change from build: 161414555 (#42038)

Co-authored-by: WSL localization <noreply@microsoft.com>

* Fix WSLC --rm container cleanup after reboot (#42014)

* Expose VGEM DRM nodes to WSLC GPU containers (#42015)

The WSLC GPU CDI device only passed /dev/dxg through, so VAAPI could not
find a DRM device inside containers even though the WSLC VM has
/dev/dri/card0 and /dev/dri/renderD128 backed by VGEM. libva maps VGEM on
WSL kernels to the D3D12 VA driver, so these nodes are required for GPU
video acceleration.

Fixes #41748

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 32483a51-1fa1-4e2c-a7db-2387bbbcf187

* Automatic MSI install logging (#42033)

* Gate encrypted VHD support on supported Windows builds (#42041)

Only request encrypted-file support on Windows build 22631 and later, and skip CompactEncrypted on older builds. Fixes the older-Windows regression introduced by #42008.

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7aea2e49-4dd6-4657-bc07-495d2cfe7cae

* Add network support to the WSLC SDK (#42002)

* Add ListNetworks to the WSLC SDK

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address ListNetworks review feedback: JSON compat layer, network flags, binary IPAM addresses

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add DeleteNetwork to the WSLC SDK

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add CreateNetwork to the WSLC SDK

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix NetworkCreate duplicate-name check

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add multi-network container creation to WSLC SDK

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Move container static IP to per-network settings

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix stale network IP notes in WslcCreateContainer header

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Merge compat network methods into IWSLCCompatSession2

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add IPv6 static container IP and accept ENABLE_IPV4 network flag

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address network API review feedback

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update documented WSLC_CONTAINER_OPTIONS_SIZE

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Log subnet parse failures and test container connectivity by alias and IP (#42045)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix ring buffer handling (#42028)

Problem: Dmesg-to-ETW extraction could skip lines because the backward scanner discarded delimiters needed as boundaries for preceding lines. Wraparound handling also confused empty fragments with absent fragments and could omit a line’s prefix.

Fix: Reuse each delimiter as the preceding line’s end boundary, track pending fragments with an optional string, and combine both segments when reconstructing wrapped lines.

* Fix consomme falling back to none when ipv6 is disabled with a dual stack host (#42026)

Problem: Consomme always enabled IPv6, even when the guest used ipv6.disable=1. On a dual-stack host, configuring the guest’s IPv6 address failed, causing fallback to networking None and breaking IPv4 too.

Fix: Detect IPv6 availability through the existing guest-capability handshake and enable Consomme’s IPv6 flag only when supported, preserving IPv4-only networking.

* Localization change from build: 161661029 (#42061)

Co-authored-by: WSL localization <noreply@microsoft.com>

* Retry vsock bind()/listen() on EINTR under mirrored networking (#42035)

With networkingMode=mirrored, every bind() and listen() in the distro is
trapped by the port tracker's seccomp hook, including the session leader's
own AF_VSOCK bind in UtilBindVsockAnyPort(). Until the supervisor receives
the notification the caller waits interruptibly (WAIT_KILLABLE_RECV only
applies after receipt), and the session leader's SIGCHLD handler has no
SA_RESTART, so a relay exiting during that window fails bind() with EINTR.
The session leader then exits and wsl.exe -e times out after 30 s with
Wsl/Service/0x8007274c.

Retry bind() and listen() on EINTR in the vsock helpers (the trapped call
never ran, so this is safe), and preserve errno in
SessionLeaderSigchldHandler so a late SIGCHLD can't clobber it before the
retry check.

* Add exec events to WSLC (#41999)

* Default wslc image import to the latest tag when no tag is given (#42065)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* WSLC-managed container restart policy for run & create - 'always' and 'no' only (#41986)

* Fix warning handle duplication crashes (#42047)

* Fix deadlock on container --rm restart logic (#42067)

* Fix deadlock after failed WSLC auto-remove restart

Signal restart completion after publishing deletion and before synchronous COM disconnection. Complete active restarts when the container is deleted, and cover failed restarts racing Start with a 50-iteration stress test.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 46d81bb8-301b-4817-adca-7de0537a0244

* Add coverage for force-delete during concurrent WSLC restart

Exercise a blocked Restart, concurrent Start, and force-Delete in 50 iterations. Keep timeout cleanup in an isolated session and make the blocking-stop launcher accept an explicit session.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 46d81bb8-301b-4817-adca-7de0537a0244

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 46d81bb8-301b-4817-adca-7de0537a0244

* Always capture guest state if the tests time out (#42066)

* Publish WSLC init process control only after WSLCProcess construction succeeds (#42069)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Release COMImplClass caller registration before dropping impl reference (#42072)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Treat only real consoles as console stdin in wslc relay (#42073)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* initialize m_enableInboxGpuLibs (#42059)

m_enableInboxGpuLibs was uninitialized when optional GPU share creation was skipped or failed. This could make the guest attempt to mount a nonexistent share, triggering VM shutdown and preventing WSL2 startup.

* Fix path unescape character range (#42062)

The original path unescape logic unescapes all characters in the range {0xEF, 0x80-0xFF, 0x80-0xFF}. Which covers more than then escaped characters. For example, ':?|' are in that range.

This PR changes the unescape range to a smaller one. Matching the escape logic better.

* Localization change from build: 161791961 (#42079)

Co-authored-by: WSL localization <noreply@microsoft.com>

* Open VHD backing handles without buffering (#42057)

Signed-off-by: niedong <37202664+niedong@users.noreply.github.com>

* Fix potential use-after-free if WSLCContainerImpl is released after the VM terminates (#41979)

* Fix potential use-after-free if WSLCContainerImpl is released after the VM terminates

* Cleanup diff

* Remove confusing comment

* Fix concurrent resource access in WSL1 instance during OOBE

* Revert "Fix concurrent resource access in WSL1 instance during OOBE"

This reverts commit de92ad71a740890e2546e2d71548a858073717e1.

* Fix uninitialized values in WslCoreVm (#42080)

* Update Microsoft.WSL.Kernel version to 6.18.58.1-1 (#42084)

* Don't use a NAT network if the address range conflicts with docker's bridge network (#42036)

* Raise distributionStartTimeout to 4 hours to trigger the test watchdogs when stuck

* Factor network ids

* Serialize network creation

* Fix potential use free in WSLCContainer

* Scope lock down

* Fix potential use free in WSLCContainer

* Cleanup diff

* Cleanup diff

* Add missing user impersonation logic on various filesystem operations (#42048)

* Add missing user impersonation logic on various filesystem operations

* Add test coverage

* Format

* Cleanup diff

* Change read access

* Actually try to open the handle

* Fix path

* Apply PR suggestions

* fix relative path check condition (#42076)

PathIsRelative has some interesting behaviors: https://devblogs.microsoft.com/oldnewthing/20180222-00/?p=98075/. It treats a path like \a\b\c as not relative. That could cause this to bypass the client side path resolution and instead resolve relative to the service. Which could cause the --move command to accidently move the distro to the C: drive instead of where wsl is called.

This PR uses std::filesystem::path::is_absolute for this check instead. Which handles \a\b\c correctly.

* Fix: handle windows installer MSI error correctly (#42060)

The MSI error code 1618 was treated as install corruption and triggers the wrong user message and actions. This error means the Windows Installer is busy with another installation and the WSL installation must wait the other installation to complete.

This PR adds a new error message for this situation to correctly inform the user.

* Wait for init to exit before trying to remount the distro VHD (#41669)

* Save state

* Cover all code paths

* Cleanup diff

* Apply PR feedback

* Apply PR feedback

* Apply PR feedback

* Apply PR suggestions

* Allow WSLC networks to be referenced by name, Id, or Id prefix (#42046)

* Allow WSLC networks to be referenced by name or Id

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Resolve network full Id before name to match engine precedence

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add WSLC_E_NETWORK_PREFIX_AMBIGUOUS error code for ambiguous network prefixes

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Resolve built-in networks by ID or prefix at container create

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Resolve network prefixes via engine, reject host IDs, and check aliases before lookup

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Inspect networks by reference in a single engine round trip

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Move network resolution into WSLCSession and resolve container networks through it

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Only register the container event callback when the container is fully initialized (#42085)

* Register container event callback after class is fully initialized

* Fix potential use free in WSLCContainer

* Localization change from build: 161949897 (#42092)

Co-authored-by: WSL localization <noreply@microsoft.com>

* Update gitpython to 3.2.1 (#42089)

* Update Microsoft.WSL.DeviceHost to version 1.2.69-0 (#42095)

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>

* Add missing impersonatation when handling a clunk request in plan9 (#42088)

* Fix potential use-after-free in DockerEventTracker (#42098)

* Fix potential use-after-free in DockerEventTracker

* Cleanup diff

* WSLC: Fix stale restart cleanup affecting newer container restarts (#42070)

* Localization change from build: 162093566 (#42103)

Co-authored-by: WSL localization <noreply@microsoft.com>

* Fix potential deadlock on init's global locks (#42099)

* Fix potential deadlock on init's global locks

* Fix typo in AssertSingleThreaded comment

Corrected a typo in the comment regarding thread limitation.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Cleanup diff

* Mark unsused

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Isolate plugin cgroups (#41993)

* Isolate plugin cgroups

* resolve comments

* Add optional host loopback support to WSLC SDK (#42087)

* Add image events to wslc events (#42116)

* Localization change from build: 162467628 (#42126)

Co-authored-by: WSL localization <noreply@microsoft.com>

* Localization change from build: 162539722 (#42131)

Co-authored-by: WSL localization <noreply@microsoft.com>

* Fix potential hang when destroying NatNetworking (#42118)

* Fix incorrect access of m_utilityVm without m_instanceLock in WslCoreVm (#42120)

* Fix potential use-after-free in slim_registry_watcher (#42119)

* archlinux: Release 2026.11.01.182233 (#42128)

This is an automated release [1].

[1] https://gitlab.archlinux.org/archlinux/archlinux-wsl/-/blob/main/.gitlab-ci.yml

* Update gitpython to 3.2.1 (#42137)

* Fix ordering issue in DnsResolver (#42138)

* Fix race condition in DnsResolver::LoadDnsResolverMethods (#42136)

* Block container start during in-flight stop/kill requests (#42090)

* Block container start while stop/kill requests from the previous run are in flight

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Use a per-batch shared event for pending exit requests

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix potential use-after-free in DnsResolver::ProcessDnsRequest (#42139)

* Switch to include() to get rid of cmake warnings (#42142)

* Fix service crash when a distribution registration has an invalid name (#42141)

* Fix service crash when a distribution registry has an invalid name

* Fix message

* Fix cancellation of queued EventStream GetNext calls (#42054)

* Fix cancellation of queued EventStream GetNext calls

* Fix WinRT namespace collisions in unity test builds

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

* Fix: restore umask after starting plan9 (#42105)

`StartPlan9Server` changes init's umask for the plan9 subprocess but never restores it for the parent process. This PR adds the missing restore logic.

* Localization change from build: 162670355 (#42149)

Co-authored-by: WSL localization <noreply@microsoft.com>

* Fix hang when HCS stops while a WSLC session is running (#42146)

* Move shared WSLC implementation to common to avoid duplicate builds (#42154)

* Harden WSLC localhost resolution and improve WSLC startup diagnostics (#42140)

* Support '--' as end of options in wslc parser (#42083)

* Support '--' as end of options in wslc parser

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove Globals end-of-options parser case

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Treat root '--' as end of global options only

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Consume -- in global pass; allow subcommands, help and version after it at each level

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Added a 'Keep WSL VM alive' setting peek to the WSL OOBE (#42097)

* Fix: restore signal handling before executing the plugin binary (#42102)

Currently the plugin processes inherit init's signal handling. Which could cause unexpected behavior if the plugin does not set its own handling explicitly. For example, SIGTERM will be ignored by default for the plugins.

This PR restores the signal handling before executing the plugin binaries.

* Make rmdir failure non-fatal on unmount (#42150)

WSL will rmdir the mount point after unmounting the mount. If the mount point was created by the user and is not empty, this step will fail. And this rmdir failure will fail the unmount and interrupt the rest of the cleanup.

This PR treats the rmdir non-fatal.

* Localization change from build: 162803447 (#42167)

Co-authored-by: WSL localization <noreply@microsoft.com>

* Stop the DNS channel before stopping the response queue (#42160)

* Fix potential deadlock on error in NatNetworking.cpp (#42159)

* Update Leap (16.1) and Tumbleweed v20261103.0 (#42155)

Leap 16.0 will be replaced by Leap 16.1 (x64/arm64 `.wsl`); 
Tumbleweed updated to 20261102 (x64/arm64 `.appx` & `.wsl`)

* Don't register the p9rdr connection target if the distribution is terminated (#42157)

* Only publish the OOBE completion event when the OOBE worker has started (#42156)

* fedora: Add Fedora 45 and drop Fedora 43 (#42152)

Fedora 45 releases today, November 3rd; add its images and make it the
default. Additionally, Fedora 43 will shortly go EOL so it is removed
from the list.

* Fix E_POINTER in WUA download (#42172)

* Add WSLC test for virtiofs directory fdatasync (#42129) (#42145)

* Add WSLC test for virtiofs directory fdatasync (#42129)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Bump Microsoft.WSL.DeviceHost to 1.2.71-0

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Don't leak DNS requests on failure (#42171)

* Restore signal mask when creating a child process (#42153)

* Restore signal mask when creating a child process

* Cleanup diff

* wslc: Allow existing containers to connect/disconnect from a network (#42161)

* Add container network connect/disconnect to WSLC SDK

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add ping check to SDK network connect test and share RunScriptOnNetwork helper

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Test SDK network disconnect before container start

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Clarify WslcContainerNetwork name also accepts network ID or prefix

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Override disabled firewall setting instead of falling back to NAT for default mirrored mode (#42163)

Problem: Policy-selected mirrored networking incorrectly fell back to NAT with a misleading Windows-version warning. Firewall normalization ran before policy selection, leaving the required firewall disabled when firewall=false.

Fix: Enable mirrored mode’s required firewall after policy selection.

* Fix: apply running filter for verbose list (#42165)

Problem: wsl --list --running --verbose included stopped distributions because the running-only filter was applied only in the nonverbose branch.
Fix: Moved filtering and empty-result handling before output formatting, with regression coverage for both verbose flag forms.

* Localization change from build: 162931978 (#42181)

Co-authored-by: WSL localization <noreply@microsoft.com>

* Update Microsoft.NETCore.App.Runtime to 10.0.14 (#42177)

* Document WSLC container network connect/disconnect and check runtime support earlier (#42178)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix potential use-after-free in p9file (#42176)

* Fix use-after-free in UtilGetEnvironmentVariable (#42187)

* Solve various issues in NAT endpoint creation (#42175)

* Fix use after free issues in the settings app (#42182)

Fixes two use-after-free issues in WSL Settings:

Configuration reload: Cached settings referenced native strings freed during reload. Managed settings now own independent copies.
String disposal: Cleanup read the string pointer after freeing its containing structure. The string is now freed before the structure.

* Fix: consomme missing dns suffix watcher (#42180)

Problem: Consomme refreshed DNS settings only at startup or on connectivity changes, leaving the guest DNS search list stale after Windows suffix-only changes.

Fix: Add a DNS-suffix registry watcher, serialize refreshes, and cancel GNS communications before draining callbacks during teardown.

Note: This PR also piggy backs the comment change requested in #42163

* Refactor WSL2 VM management behind an HCS backend (#42031)

* Add Rust client for the OpenVMM VM service (#41618)

* repo: modify CODEOWNERS to change wsl-maintainers to wsl-reviewers team (#41617)

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>

* Localization change from build: 157736413 (#41621)

Co-authored-by: WSL localization <noreply@microsoft.com>

* Migrate wslvmservice to WSL

* tests + address missing functionality from initial poc

* Retry OpenVMM named-pipe connections during startup

* Use AF_UNIX for OpenVMM RPC connections

* Add more robust RPC handling + tests

* add tracing

* Revert RPC robustness and tracing changes

Reverts 260080dbf (add tracing) and ff9c77770 (Add more robust RPC handling + tests), restoring the RPC layer to eb5923833.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Restore RPC robustness and tracing changes

Reverts ea86585bf6a6ea469ec6d1fc612d9672b1e29aba to restore the original RPC handling, tests, and tracing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* re-do tests

* Update packaging

* undo unnecessary change

* CMake simplify, address copilot comments, run formatter, and make ci changes

* feedback

* Remove unintended localization changes

Restore localized resources to their feature/openvmm versions so they are not included in the OpenVMM RPC change.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* use nuget instead

* missed a couple of updates

* .

* Stop tracking local OpenVMM notes

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* last set of reverted changes

---------

Co-authored-by: Ben Hillis <benhillis@gmail.com>
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Co-authored-by: Blue <OneBlue@users.noreply.github.com>
Co-authored-by: WSL localization <noreply@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Introduce virtual machine backend interface (#41663)

* Initial work

* .

* flatten

* previous PR feedback

* Update cleanup logic in OpenVmmVirtualMachineBackend

Replaced file deletion with recursive directory removal for improved error handling.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Initial work

* previous PR feedback

* feedback

* Remove accidentally committed file

* .

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Implement OpenVMM backend (#41697)

* Implement OpenVMM virtual machine backend

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* .

* fix

* feedback

* feedback

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Introduce HcsVirtualMachineBackend (#41718)

* Initial work

* .

* flatten

* previous PR feedback

* Update cleanup logic in OpenVmmVirtualMachineBackend

Replaced file deletion with recursive directory removal for improved error handling.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* logging improvements + use wsl error codes where applicable + tests

* Configure OpenVMM networking at VM creation time

Expose effective VM descriptions and reject unsupported network configuration and adapter hot-add. Update backend coverage for creation-time networking.

* Refactor + fix locking story

* add user token

* Partially implemented HcsVirtualMachineBackend

* Implement OpenVMM virtual machine backend

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* .

* fix

* feedback

* Relocate virtual machine backends to common

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* restore

* 2a03975

* 7c9c0db

* finally rebased

* .

* HcsAttachDisk

* HcsDetachDisk

* tests

* test fixes

* missed some things during merge

* Feedback

* Address HCS backend review feedback

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* feedback

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Implement remaining HCS VirtualMachineBackend surface (#41761)

* .

* .

* .

* Add filesystem share test

* Fix rebased filesystem share validation

* Remove file share

* initial work

* GPU/PMem

* guest DMA/swiotb, memory configuration, HCS hosted p9 support, shared memory device

* Fix VM backend and WinRT unity build collisions

Port the shared VM constants and explicit WinRT imports from hcs-integration commits 3d53df31 and 1cee239b.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 563f9b88-0149-48a5-ac0c-07d6f0adbd9e

* streamline comments

* Revert streamline comments

* feedback

* feedback

* .

* Align VM termination with existing code

* feedback

---------

Copilot-Session: 563f9b88-0149-48a5-ac0c-07d6f0adbd9e

* Integrate HcsVirtualMachineBackend into WslCoreVm (#41824)

* .

* .

* .

* Add filesystem share test

* Fix rebased filesystem share validation

* Remove file share

* initial work

* GPU/PMem

* guest DMA/swiotb, memory configuration, HCS hosted p9 support, shared memory device

* Fix VM backend and WinRT unity build collisions

Port the shared VM constants and explicit WinRT imports from hcs-integration commits 3d53df31 and 1cee239b.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 563f9b88-0149-48a5-ac0c-07d6f0adbd9e

* streamline comments

* Revert streamline comments

* feedback

* feedback

* .

* Align VM termination with existing code

* test new rs_prerelease image

* formatter

* Integrate HCS virtual machine backend

(cherry picked from commit 5207c4c5ac3755c319e3bb75aa17ebc501c7509d)

* updates

(cherry picked from commit 21bab9c95c250639d807fb0bd16379982e3cbbc3)

* formatter

(cherry picked from commit 5a6f3e1083dc22d5f982b10704dcc820b750bdea)

* Merge user/damanmulye/hcs-fs-devices into user/damanmulye/hcs-integration

(cherry picked from commit 721cc2b0bcf4bf2c451f7b6fff4d3abb14088dd8)

* Remove duplicate state

(cherry picked from commit 32e8ca1a36f6eaaa4f281f1e93971f529eeaef44)

* More duplicate state removal

(cherry picked from commit a43e9e0ae71d1af10ba8291ad4ba961fab42993f)

* test fixes

(cherry picked from commit eaaa88551e6fb8a66dcf2a24c3e63e9d98990c2c)

* Fix leak for wsldevicehostproxy

(cherry picked from commit 49ba11e31390fb709ad8081ade39669bb24458e8)

* Fix merge inconsistencies in the VM backend integration

Reconcile HcsVirtualMachineBackend with the current nested VmResource
model and the termination-information interface:

- Access inherited resource descriptions directly and backend-only
  state through .Backend.
- Drop the duplicate VmFileSystemShare description from
  HcsFileSystemShare, which VmResource already provides.
- Resolve shared-handle versus raw HANDLE conversions for file system
  device and share tokens.
- Store port bindings as VmPortBinding and read the network adapter
  resource path from backend state.
- Restore the SmallPageMemory feature and its HCS capability detection.
- Move WslCoreVm off the obsolete crash/exit APIs to
  GetTerminationReason().

* recover fixes

* .

* .

* .

* Format HCS virtual machine backend

* Only pass a user token for HCS-hosted Plan 9 shares that request root identity

Passing the token unconditionally implicitly set UseShareRootIdentity on GPU shares, changing their flags from ReadOnly|AllowOptions (0x21) to 0x31 and causing the guest /gpu_drivers mount to fail with EINVAL during distro import.

* .

* feedback

* termination feedback

* .

* feedback

---------

Copilot-Session: 563f9b88-0149-48a5-ac0c-07d6f0adbd9e

* Merge latest main branch into feature/openvmm (#41952)

* repo: modify CODEOWNERS to change wsl-maintainers to wsl-reviewers team (#41617)

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>

* Localization change from build: 157736413 (#41621)

Co-authored-by: WSL localization <noreply@microsoft.com>

* CLI: Global option scopes for nested commands (related to compose support) (#41546)

* Change default relay  buffer size to 64KiB (#41603)

The current logic uses a fixed 4KiB buffer for stdio relay on the Windows side. And uses an initial 4KiB buffer for stdio relay on the Linux side, which grows only if the message won't fit. This can severely limit the relay performance in some situations. For example, in #41572, when redirecting stdout to a SMB share.

This PR increases thedefault relay buffer size to 64KiB. Which shows significant performance improvements according to buffer size tests.

* Fix redirect stdout and stderror to the same file overlapping (#41611)

Currently the stdout and stderr relay tracks the output offset separately. And when redirected to the same file, the writes could overlap.

This PR uses the append mode for overlap io writes instead of the separate offsets in the relay. So, the file write offset is correctly tracked by the system.

* move installer log collection after repro (#41620)

The installer log files were collected before the log collection starts. Which will miss the user repro.

This PR moves it after the user repro.

* wslc: add --digests to image list for docker parity (#41457)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Localization change from build: 157843092 (#41630)

Co-authored-by: WSL localization <noreply@microsoft.com>

* Explicitely return SOCKET from WSLCPluginAPI_ProcessGetFd() (#41626)

* In mirrored mode, handle route update as add instead of replace (#41391)

In mirrored mode, handle route update as add instead of replace
Remove usage of route update as it can overwrite routes on other interfaces. add tests that verify host routing changes are correctly reflected in Linux

---------

Co-authored-by: Catalin-Emil Fetoiu <cfetoiu@microsoft.com>

* Add wslc events command (#41608)

* Don't fail the UnitTests::Warnings test case if GlobalSecureAccess VPN is running (#41638)

* Don't fail the UnitTests::Warnings test case if GlobalSecureAccess VPN is running

* Cleanup diff

* Fix test

* Wait for wslservice to be started when running tests (#41639)

* Wait for wslservice to be started when running tests

* Fail on timeout

* Improve check

* Format

* Create new namespaces for distro cgroups (#41512)

In 2.9.8, the distro processes are separated into their own cgroups. But they remain in the same cgroup namespace. That caused compatibility issues with softwares that assume a fixed systemd cgroup layout. For example, rootless docker and nerdctl.
Fixes on Moby and nertctl are being worked on. However, to avoid issues with other software, WSL's cgroup handling should also be improved.

This PR creates new cgroup namespaces for the distros. So, to the non-critical distro processes, the systemd cgroup layout stays the same as before.
This PR also introduces a cgroup structure change to accomplish this. The systemd init is moved from wsl-user/distro-N/systemd to wsl-user/distro-N. And the initialization of the distro-N controllers is handled by systemd instead.
The processes are also moved into the non-systemd cgroup in systemdless distros. This makes sure that sub-group controllers can be enabled in the distro root.
Cgroup v2 is now enforced when distro isolation is enabled. Instead of constructing an unusable cgroup v1 layout when cgroup v1 and distro isolation are both enabled.

* Fix unnecessary delay in the port tracking loop (#41472)

Before this change, an additional 10ms delay was added in the port tracker loop presumably to make the main loop slower than the worker loop. So, the worker result does not get super dated. This is not reliable. And the 10ms delay also slows down every consecutive bind call.

This PR refactors the thread synchronization method. So, the timing between those two loops is more…
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