Repository navigation
Merge latest main branch into feature/openvmm - #42020
Merged
Daman Mulye (damanm24) merged 171 commits intoOct 22, 2026
Merged
Conversation
…am (#41617) Co-authored-by: Ben Hillis <[email protected]>
Co-authored-by: WSL localization <[email protected]>
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.
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.
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.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: WSL localization <[email protected]>
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 <[email protected]>
…PN 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 * Fail on timeout * Improve check * Format
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.
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.
Co-authored-by: WSL localization <[email protected]>
Co-authored-by: Copilot <[email protected]>
…ncorrectly disabled- #41648 (#41648) Co-authored-by: Catalin-Emil Fetoiu <[email protected]>
…41619) * Move objects shared by wslc.exe and the tests to src/windows/common Co-authored-by: Copilot <[email protected]> * Link yaml-cpp, advapi32 and Crypt32 into common Co-authored-by: Copilot <[email protected]> * Drop yaml-cpp, advapi32 and crypt32 from wslclib now that common provides them Co-authored-by: Copilot <[email protected]> * Move wslc code in common under common/wslc and namespace CLI types as wslc::cli Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
* 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
Co-authored-by: WSL localization <[email protected]>
* 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
…n init messages (#41664)
Co-authored-by: WSL localization <[email protected]>
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.
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.
* Match console detach sequence on full UTF-16 chars Co-authored-by: Copilot <[email protected]> * Add console detach unicode low-byte test Co-authored-by: Copilot <[email protected]> * Move detach unicode test to wslc pseudoconsole E2E Co-authored-by: Copilot <[email protected]> * Write detach test unicode pair separately from marker Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
Co-authored-by: WSL notice <[email protected]>
* fix start up parsing regression * Fix distro config parsing logic * Add unit test
Co-authored-by: WSL notice <[email protected]>
* Fix concurrent resource access in WSL1 instance during OOBE * Don't get stuck if the distro gets stuck
…ially 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 91af5d2, including its test changes. * Load container images * Use a GIT reference * Fix potential use free in WSLCContainer
Co-authored-by: Copilot <[email protected]>
…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) <[email protected]>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The critical IPv6 gateway defect and five moderate localization issues remain unresolved; Windows build and runtime validation are outstanding.
5 open issues
What changed in this PR
Merges recent main-branch changes into feature/openvmm, integrating container features and reliability fixes across Windows services, Linux initialization, VM backends, and release infrastructure.
Changes:
- Adds container capability controls and IPv6 network creation across CLI, SDK, compatibility interfaces, documentation, and tests.
- Revises COM/process lifetimes, VM teardown, OOBE synchronization, networking fallback, and Plan9 file handling.
- Updates localization, runtime dependencies, and publishing pipelines; removes bundled perf exposure.
Unresolved findings:
- Critical — 1 vote:
src/windows/common/ConsommeNetworking.cpp:517forwards host-scoped IPv6 gateways that the guest parser rejects. Strip the Windows scope suffix before forwarding. - Moderate — 3 votes:
localization/strings/hu-HU/Resources.resw:927reverses the allocated and original port counts. Correct through the localization pipeline. - Moderate — 3 votes:
localization/strings/ja-JP/Resources.resw:933reverses the allocated and original port counts. Correct through the localization pipeline. - Moderate — 3 votes:
localization/strings/ko-KR/Resources.resw:933reverses the allocated and original port counts. Correct through the localization pipeline. - Moderate — 3 votes:
localization/strings/tr-TR/Resources.resw:927reverses the allocated and original port counts. Correct through the localization pipeline. - Moderate — 1 vote:
src/windows/WslcSDK/winrt/ContainerSettings.cpp:243exposes a hardcoded English exception message. Use the existing HRESULT-only path or a localized resource.
Validation was limited to static review and a standalone IPv6 parser check; Windows builds and integration tests were not run.
| File | Description |
|---|---|
test/windows/wslc/WslcSdkWinRTTests.cpp |
Tests WinRT capabilities, policy enforcement, and session access. |
test/windows/wslc/WslcSdkTests.cpp |
Tests C SDK capabilities, validation, and policy errors. |
test/windows/wslc/WSLCE2ENetworkCreateTests.cpp |
Tests IPv6 network creation and connectivity. |
test/windows/wslc/WSLCE2EContainerRunTests.cpp |
Tests capabilities, policy blocking, and Unicode detach handling. |
test/windows/wslc/WSLCE2EContainerRemoveTests.cpp |
Tests forced removal of missing containers. |
test/windows/wslc/WSLCE2EContainerInspectTests.cpp |
Tests round-tripping inspected container names. |
test/windows/wslc/WSLCE2EContainerCreateTests.cpp |
Tests capability settings and updates pull-message expectations. |
test/windows/wslc/WSLCE2EContainerCpTests.cpp |
Canonicalizes the archive extraction destination. |
test/windows/wsl/Plan9Tests.cpp |
Tests truncation after Linux replaces an open file. |
test/windows/wsl/NetworkTests.cpp |
Tests fragmented port availability and allocation fallback. |
test/windows/wsl/InstallerTests.cpp |
Corrects installer-service polling frequency. |
test/windows/OpenVmmVirtualMachineBackendTests.cpp |
Tests preservation of parent error context. |
test/windows/HcsVirtualMachineBackendTests.cpp |
Tests crash-log writing to precomputed paths. |
test/windows/common/Common.h |
Accepts handle wrappers in asynchronous readers. |
test/windows/common/Common.cpp |
Updates reader ownership and diagnostic startup timeout. |
src/windows/wslrelay/localhost.cpp |
Avoids retaining listening sockets in established relays. |
src/windows/wslcsession/WSLCVirtualMachine.h |
Introduces a separately owned process registry. |
src/windows/wslcsession/WSLCVirtualMachine.cpp |
Revises process tracking and VM teardown ordering. |
src/windows/wslcsession/WSLCSessionReference.h |
Updates COM lifetime handling and release documentation. |
src/windows/wslcsession/WSLCSessionFactory.h |
Removes session-destruction callback configuration. |
src/windows/wslcsession/WSLCSessionFactory.cpp |
Installs service references and enables process-exit waiting. |
src/windows/wslcsession/WSLCSession.h |
Adds capability-aware creation and service-reference ownership. |
src/windows/wslcsession/WSLCProcessIO.h |
Declares locks for consumable I/O handles. |
src/windows/wslcsession/WSLCProcessIO.cpp |
Serializes I/O handle retrieval. |
src/windows/wslcsession/WSLCProcessControl.h |
Tracks process-registry lifetime weakly. |
src/windows/wslcsession/WSLCProcessControl.cpp |
Revises unregistering and terminal-channel shutdown. |
src/windows/wslcsession/WSLCNetworkMetadata.h |
Tracks IPv6 network enablement. |
src/windows/wslcsession/WSLCContainer.h |
Adds weak session resolution and persistent cached properties. |
src/windows/wslcsession/main.cpp |
Bases server exit on WRL module object counts. |
src/windows/wslcsession/EventStore.h |
Adopts the constructor-safe COM runtime wrapper. |
src/windows/WslcSDK/WslcsdkPrivate.h |
Stores capabilities and versioned session interfaces. |
src/windows/WslcSDK/wslcsdk.def |
Exports capability-setting APIs. |
src/windows/WslcSDK/winrt/wslcsdk.idl |
Exposes capability collections and new errors. |
src/windows/WslcSDK/winrt/ContainerSettings.h |
Declares capability properties and backing storage. |
src/windows/WslcSDK/winrt/ContainerSettings.cpp |
Converts WinRT capability collections into SDK settings. |
src/windows/wslc/tasks/NetworkTasks.cpp |
Maps the IPv6 CLI flag into network options. |
src/windows/wslc/tasks/ContainerTasks.cpp |
Parses capabilities and ignores missing forced-removal targets. |
src/windows/wslc/services/NetworkService.cpp |
Forwards IPv6 enablement to the session API. |
src/windows/wslc/services/NetworkModel.h |
Adds IPv6 creation options. |
src/windows/wslc/services/ContainerService.cpp |
Passes capability additions and drops to the launcher. |
src/windows/wslc/services/ConsoleService.cpp |
Uses wide characters for detach sequences. |
src/windows/wslc/commands/NetworkCreateCommand.cpp |
Registers the IPv6 argument. |
src/windows/wslc/commands/ContainerRunCommand.cpp |
Registers repeatable capability arguments. |
src/windows/wslc/commands/ContainerCreateCommand.cpp |
Registers repeatable capability arguments. |
src/windows/wslc/arguments/ArgumentDefinitions.h |
Defines capability and IPv6 CLI arguments. |
src/windows/service/inc/WSLCCompat.idl |
Adds a versioned capability-aware compatibility interface. |
src/windows/service/inc/wslc.idl |
Extends internal options, errors, and handle documentation. |
src/windows/service/exe/WSLCSessionManager.h |
Tracks marshaled references and host-process lifetime. |
src/windows/service/exe/WSLCSessionManager.cpp |
Implements GIT reference handling and process tracking. |
src/windows/service/exe/WslCoreVm.h |
Shares ownership of the VM crash event. |
src/windows/service/exe/WslCoreVm.cpp |
Updates crash-event ownership and nested-virtualization warnings. |
src/windows/service/exe/WslCoreInstance.h |
Shares ownership of OOBE completion events. |
src/windows/service/exe/WslCoreInstance.cpp |
Releases the instance lock during cancellable OOBE waits. |
src/windows/service/exe/WslCoreGuestNetworkService.cpp |
Retries progressively smaller ephemeral port ranges. |
src/windows/service/exe/MirroredNetworking.cpp |
Stops port tracking before releasing GNS resources. |
src/windows/service/exe/LxssUserSession.h |
Adds a timezone-listener stop event. |
src/windows/service/exe/LxssUserSession.cpp |
Uses event-driven timezone-thread shutdown. |
src/windows/service/exe/LxssInstance.h |
Adds process-creation synchronization and shared OOBE events. |
src/windows/service/exe/HcsVirtualMachine.h |
Adopts the constructor-safe COM runtime wrapper. |
src/windows/inc/wslc_schema.h |
Includes capabilities in container inspection data. |
src/windows/inc/docker_schema.h |
Serializes IPv6 and capability settings. |
src/windows/common/wslutil.cpp |
Names capability errors and OpenVMM error context. |
src/windows/common/WslCoreFilesystem.cpp |
Supports opening encrypted VHD files. |
src/windows/common/WSLCContainerLauncher.h |
Declares capability configuration methods. |
src/windows/common/WSLCContainerLauncher.cpp |
Marshals capability lists into creation options. |
src/windows/common/wslc/models/ContainerModel.h |
Stores requested container capabilities. |
src/windows/common/svccomm.cpp |
Enables interactive warnings for stderr pipes. |
src/windows/common/RuntimeClass.h |
Handles module accounting after constructor exceptions. |
src/windows/common/OpenVmmVirtualMachineBackend.h |
Exposes shared termination and crash events. |
src/windows/common/OpenVmmVirtualMachineBackend.cpp |
Updates event ownership and OpenVMM error contexts. |
src/windows/common/IVirtualMachineBackend.h |
Defines shared-event ownership and crash-path availability. |
src/windows/common/HcsVirtualMachineBackend.h |
Updates event ownership and crash-capture state. |
src/windows/common/hcs.hpp |
Separates crash-log path generation from writing. |
src/windows/common/hcs.cpp |
Writes crash logs using precomputed paths. |
src/windows/common/HandleIO.h |
Stores detach sequences as wide characters. |
src/windows/common/HandleIO.cpp |
Matches detach sequences against Unicode input. |
src/windows/common/ExecutionContext.h |
Adds the OpenVMM context flag. |
src/windows/common/DeviceHostProxy.h |
Adopts the constructor-safe COM runtime wrapper. |
src/windows/common/ConsommeNetworking.h |
Tracks IPv4 and IPv6 default routes separately. |
src/windows/common/ConsommeNetworking.cpp |
Configures family-specific guest default routes. |
src/windows/common/CMakeLists.txt |
Registers the new header and clarifies dependencies. |
src/windows/common/APICompat.h |
Declares versioned container-option conversion. |
src/windows/common/APICompat.cpp |
Converts compatibility capability arrays. |
src/shared/inc/lxinitshared.h |
Defines GPU start-hook paths and removes perf environment constants. |
src/linux/plan9/p9file.cpp |
Truncates the opened inode rather than a replaced pathname. |
src/linux/init/WslDistributionConfig.h |
Removes bundled perf configuration state. |
src/linux/init/main.cpp |
Removes perf mounts and adjusts GUI enablement selection. |
src/linux/init/init.cpp |
Dispatches the GPU start hook. |
src/linux/init/config.cpp |
Removes perf environment/mount setup and updates GUI state. |
packages.config |
Updates .NET runtime package versions. |
msipackage/package.wix.in |
Registers the new compatibility interface proxy. |
localization/strings/zh-TW/Resources.resw |
Updates Traditional Chinese diagnostics and pull wording. |
localization/strings/zh-CN/Resources.resw |
Updates Simplified Chinese diagnostics and pull wording. |
localization/strings/tr-TR/Resources.resw |
Updates Turkish diagnostics and CLI translations. |
localization/strings/sv-SE/Resources.resw |
Updates Swedish diagnostics and CLI translations. |
localization/strings/ru-RU/Resources.resw |
Updates Russian diagnostics and pull wording. |
localization/strings/pt-PT/Resources.resw |
Updates European Portuguese diagnostics and CLI translations. |
localization/strings/pt-BR/Resources.resw |
Updates Brazilian Portuguese diagnostics and CLI translations. |
localization/strings/pl-PL/Resources.resw |
Updates Polish diagnostics and CLI translations. |
localization/strings/nl-NL/Resources.resw |
Updates Dutch diagnostics and pull wording. |
localization/strings/nb-NO/Resources.resw |
Updates Norwegian diagnostics and pull wording. |
localization/strings/ko-KR/Resources.resw |
Updates Korean diagnostics and pull wording. |
localization/strings/ja-JP/Resources.resw |
Updates Japanese diagnostics and CLI translations. |
localization/strings/it-IT/Resources.resw |
Updates Italian diagnostics and CLI translations. |
localization/strings/hu-HU/Resources.resw |
Updates Hungarian diagnostics and CLI translations. |
localization/strings/fr-FR/Resources.resw |
Updates French diagnostics and CLI translations. |
localization/strings/fi-FI/Resources.resw |
Updates Finnish diagnostics and pull wording. |
localization/strings/es-ES/Resources.resw |
Updates Spanish diagnostics and CLI translations. |
localization/strings/en-US/Resources.resw |
Adds capability help/errors and networking diagnostics. |
localization/strings/en-GB/Resources.resw |
Updates British English diagnostics and pull wording. |
localization/strings/de-DE/Resources.resw |
Updates German diagnostics and CLI translations. |
localization/strings/da-DK/Resources.resw |
Updates Danish diagnostics and CLI translations. |
localization/strings/cs-CZ/Resources.resw |
Updates Czech diagnostics and CLI translations. |
intune/en-US/WSL.adml |
Documents capability restrictions under privileged-container policy. |
doc/docs/technical-documentation/boot-process.md |
Documents headers-only exposure without bundled perf. |
doc/docs/api-reference/csharp/settings-classes/containersettings.md |
Documents C# capability collections. |
doc/docs/api-reference/csharp/enumerations/error.md |
Documents new C# error values. |
doc/docs/api-reference/cpp/settings-classes/containersettings.md |
Documents C++ capability properties. |
doc/docs/api-reference/cpp/enumerations/error.md |
Documents new C++ error values. |
doc/docs/api-reference/c/structures/constants.md |
Updates the opaque container-settings size. |
doc/docs/api-reference/c/container-apis/wslcsetcontainersettingscapabilitydrops.md |
Documents the capability-drop setter. |
doc/docs/api-reference/c/container-apis/wslcsetcontainersettingscapabilityadditions.md |
Documents the capability-addition setter. |
doc/docs/api-reference/c/container-apis/index.md |
Links the new capability APIs. |
doc/docs/api-reference/c/container-apis/.pages |
Adds capability APIs to navigation. |
.pipelines/wsl-build-release-onebranch.yml |
Adds guarded manual inclusion of publishing stages. |
.pipelines/package-stage.yml |
Blocks publishing during manual validation runs. |
.pipelines/dcat-submit-job.yml |
Uses a custom pool and explicit artifact downloads. |
.pipelines/dcat-download-steps.yml |
Provides reusable filtered artifact-download steps. |
.pipelines/dcat-audience-job.yml |
Uses a custom pool and explicit submission downloads. |
Review effort: Balanced
Comment on lines
+517
to
+518
| route.DestinationPrefix = (family == AF_INET) ? LX_INIT_DEFAULT_ROUTE_PREFIX : LX_INIT_DEFAULT_ROUTE_V6_PREFIX; | ||
| route.Family = family; |
| <comment>{Locked="HKLM\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters"}{Locked="DisabledComponents"}{Locked="0xff"}</comment> | ||
| </data> | ||
| <data name="MessageMirroredNetworkingReducedPortRange" xml:space="preserve"> | ||
| <value>A tükrözött hálózatkezelés kisebb rövid élettartamú porttartományt használ ({} port helyett {}). Ez korlátozhatja az egyidejű kapcsolatok számát.</value> |
| <comment>{Locked="HKLM\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters"}{Locked="DisabledComponents"}{Locked="0xff"}</comment> | ||
| </data> | ||
| <data name="MessageMirroredNetworkingReducedPortRange" xml:space="preserve"> | ||
| <value>ミラー化されたネットワークでは、より小さなエフェメラル ポート範囲 ({} ではなく {} ポート) が使用されています。これにより、同時接続の数が制限される可能性があります。</value> |
| <comment>{Locked="HKLM\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters"}{Locked="DisabledComponents"}{Locked="0xff"}</comment> | ||
| </data> | ||
| <data name="MessageMirroredNetworkingReducedPortRange" xml:space="preserve"> | ||
| <value>미러링 네트워킹에서 더 작은 동적 포트 범위({}개 포트 대신 {}개 포트)를 사용하고 있습니다. 이로 인해 동시 연결 수가 제한될 수 있습니다.</value> |
| <comment>{Locked="HKLM\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters"}{Locked="DisabledComponents"}{Locked="0xff"}</comment> | ||
| </data> | ||
| <data name="MessageMirroredNetworkingReducedPortRange" xml:space="preserve"> | ||
| <value>Yansıtılmış ağ, daha küçük bir geçici bağlantı noktası aralığı kullanıyor ({} yerine {} bağlantı noktası). Bu, eşzamanlı bağlantı sayısını sınırlayabilir.</value> |
Collaborator
|
/azp run |
|
Azure Pipelines: 1 pipeline(s) were filtered out due to trigger conditions. |
Blue (OneBlue)
approved these changes
Oct 22, 2026
Jan Hodouš (rhsCZ)
pushed a commit
to rhsCZ/WSL
that referenced
this pull request
Nov 10, 2026
Real merge of origin/master to restore a shared merge base. Earlier sync PRs (microsoft#41952, microsoft#42020) were squash-merged, so git still saw the branches as diverged since 2026-09-15. Conflict resolution: - Files whose only feature-side changes came from the squashed sync commits take master's version. - OpenVMM-specific changes are kept on top of master: backend sources and dispatch, wslopenvmm_client linking, NuGet package, test binaries, VmGuestListener::SocketFile, nested virtualization warning, shared test helpers, and the rs_prerelease-2026-10-05 test image. Co-authored-by: Copilot <[email protected]> Copilot-Session: 9364eddb-5875-4548-9b6e-9d080b4198ba
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Draft PR to review changes made during merge conflict resolution: #42021