You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Select the OpenVMM backend and port OpenVMM test infrastructure - #42315
Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
Tests: Added/updated if needed and all pass
Localization: All end user facing strings can be localized
Dev docs: Added/updated if needed
Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx
Detailed Description of the Pull Request / Additional comments
Backend selection
WslCoreVm creates the VM with CreateVirtualMachineBackend(), using OpenVMM when experimental.openVmm=true.
Memory features and the hosting-process name suffix are requested from the selected backend's capabilities. The guest DMA window is configured only when the backend supports it.
Networking: OpenVMM NAT adds its eth0 NIC (with the configured or generated MAC) and, with localhost forwarding, its loopback0 NIC at creation, then runs OpenVmmNatNetworking. HNS NAT networks are created only for HCS, and the guest isn't asked for the DNS tunneling hvsocket on OpenVMM.
Guest connections: process launch, the root-namespace processes, distro import/export and the instance ports connect through IVirtualMachineBackend::ConnectGuest. CreateLxProcess returns a serialized GuestConnector, which wsl.exe and wslhost.exe use for interop instead of the VM ID. The relays handle the AF_UNIX connections OpenVMM uses.
File systems:
DrvFs uses virtio-fs only on OpenVMM, with the token checks it needs to impersonate the session.
Plugin folder mounts use single-share virtio-fs devices.
Read-only virtio-fs shares are enforced by the host.
DetachDisk matches paths before reopening a VHD that the backend holds exclusively.
Console pipes (dmesg, guest telemetry, kernel debugger) grant the user access, because the OpenVMM process runs as the user. The kernel console uses virtio console on OpenVMM.
OpenVMM captures saved state into the crash dump folder.
Left out of the integration branch's WslCoreVm changes:
LxsstuOpenVmmMode() reads /p:OpenVmm=1. When it is set, LxssGenerateTestConfig() writes experimental.openVmm=true and defaults the settings OpenVMM doesn't support: no GUI apps or GPU, virtio-fs drvfs with single-share devices, and no nested virtualization.
New test markers:
OPENVMM_UNSUPPORTED_TEST_CLASS / OPENVMM_UNSUPPORTED_WSL2_TEST_METHOD skip tests under OpenVMM.
OPENVMM_TEST_CLASS tags tests that drive the OpenVMM backend directly.
BACKEND_AGNOSTIC_TEST_CLASS tags tests whose result can't depend on the VM backend.
Under OpenVMM, the generated config also turns off the Hyper-V firewall, DNS tunneling and hardware performance counters, which the service rejects for OpenVMM. DNS tunneling tests are skipped under OpenVMM.
TestConfigDefaults gains localhostForwarding and nestedVirtualization.
GetBlockDeviceInWsl() also scans /dev/vdX, because OpenVMM attaches disks over virtio-blk.
GetElevatedTestToken() moves to VirtualMachineBackendTestHelpers.h so both backend test suites can use it.
CloudTest
Every existing WSL1/WSL2 group now excludes @TestCategory='OpenVMM'.
A new wsl2-openvmm group runs the WSL2 suite on rs_prerelease-2026-10-05 with /p:OpenVmm=1, minus BackendAgnostic tests, and adds a backend dimension to the test job names.
WSL test suites
The following are skipped under OpenVMM, with a reason at each skip:
SCSI-specific mount tests
Plan 9, Mirrored and Bridged
Hyper-V firewall
HNS NAT range persistence
GUI-dependent tests
sparse VHDs
dmesg collection
Consommé tests run in NAT mode under OpenVMM.
DNS tunneling expects the Consommé gateway as the DNS server.
The VM process is openvmm.exe instead of vmmem.
Expected error codes include the OpenVmm context.
.wslconfig warning line numbers are computed instead of hard-coded.
The localhost relay test polls with a timeout instead of possibly blocking forever.
The fstab test identifies the C: virtio-fs mount through /run/wsl/virtiofs instead of the tag name.
OpenVMM backend tests
New tests, adapted to the merged backend contracts: the OpenVmm context name, callers adding CreateVm/ConfigureNetworking, VmVirtioBlkAddress slots, and host-socket files removed on destruction.
error attribution for creation and operations
the nested-virtualization user error
creation-time NAT adapters
crash-capture validation
virtio-blk boot disk reattach
the destructor draining the termination callback
persistent-memory ordering
host-socket lifetime
serving a share under an unelevated token from an elevated VM
Not ported, because they were superseded during the #42246 review:
tests consolidated into existing tests: ReservesExactPlacementsBeforeAutomaticDisks, LeavesVirtualDiskFileNamesToBackend, EnforcesDiskLimitsAndKeepsIdsVmScoped, DescribesConsoleFamiliesIndependently
GuestShutdownTerminatesProcess, covered by NotifiesWhenGuestExits
GuestShutdownCallbackCanDestroyBackend, which contradicts the interface rule that termination callbacks must not destroy the backend inline
clang-format --dry-run --Werror on all changed C/C++ files (VS 2022 LLVM): passed.
Ran cloudtest/CMakeLists.txt in CMake script mode (cmake -P): each existing WSL group excludes OpenVMM and wsl2-openvmm is generated with /p:OpenVmm=1 and the BackendAgnostic exclusion.
Not run locally: the TAEF suites, including the new OpenVMM backend tests, and an end-to-end WSL session on OpenVMM. Test setup reinstalls WSL on the host, so validation relies on the CloudTest passes, with wsl2-openvmm covering OpenVMM end to end.
Adds the /p:OpenVmm=1 test switch and OpenVMM test markers, a dedicated wsl2-openvmm CloudTest pass, OpenVMM-mode adjustments to the WSL test suites, and new OpenVMM backend tests adapted to the merged backend.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Critical blockers remain: OpenVMM defaults prevent WSL startup, network tests use unsupported DNS settings or incorrect MAC expectations, and the filesystem regression fails on a sharing violation.
Ports the test infrastructure and suite adjustments for the OpenVMM integration introduced in #42246. Backend selection remains disabled, so the new suite pass still uses HCS; direct OpenVMM backend tests create their own VMs.
Changes:
Adds OpenVMM test parameters, configuration defaults, and test-selection markers.
Introduces a dedicated CloudTest pass and backend-specific job names.
Adapts existing suites and expands backend lifecycle, resource, and error-validation tests.
File
Description
test/windows/wsl/UnitTests.cpp
Adjusts backend expectations, GUI checks, and configuration-warning tests.
test/windows/wsl/SimpleTests.cpp
Skips sparse-VHD testing under OpenVMM.
test/windows/wsl/PolicyTests.cpp
Adds backend-specific policy expectations and class tagging.
test/windows/wsl/Plan9Tests.cpp
Excludes Plan 9 tests from OpenVMM runs.
test/windows/wsl/Plan9ProtocolTests.cpp
Selects NAT networking for OpenVMM.
test/windows/wsl/NetworkTests.cpp
Adapts networking coverage and bounds relay reads with a timeout.
test/windows/wsl/MountTests.cpp
Skips unsupported disk cases and recognizes the OpenVMM process.
test/windows/wsl/InstallerTests.cpp
Tags installer tests as backend-independent.
test/windows/wsl/DrvFsTests.cpp
Adds backend-aware class selection and unsupported-case markers.
test/windows/VirtualMachineBackendTestHelpers.h
Shares the elevated-token helper between backend suites.
Creates the VM through the backend selected by experimental.openVmm and wires the OpenVMM backend into WSL: user-mode NAT networking, guest connections for process launch and interop, virtio-fs for DrvFs and plugin mounts, console pipe access for the user-run OpenVMM process, and saved-state crash capture. The OpenVMM test configuration now satisfies the backend's configuration validation.
Daman Mulye (damanm24)
changed the title
Port OpenVMM test infrastructure and test fixes
Select the OpenVMM backend and port OpenVMM test infrastructure
Nov 20, 2026
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
OpenVMM’s address-space layout prevents default-memory boot on 128-GiB hosts, while incompatible test configurations and expectations cause failures in the new backend pass.
…ows Hypervisor Platform at install
wsl --install no longer enables the Windows Hypervisor Platform for every user, since OpenVMM is opt-in. Whether OpenVMM can run depends on whether the platform reports a hypervisor, which the optional component's state does not reliably predict, so the backend no longer checks it. When OpenVMM finds no hypervisor, it fails CreateVm with "no hypervisor available", which wslopenvmm translates to ERROR_HV_NOT_PRESENT, and WSL reports a message asking the user to enable virtualization in firmware and the Windows Hypervisor Platform.
The OpenVMM backend accepted a disk or persistent memory token only if it was the VM owner's token instance. The service passes a fresh copy of the caller's token for each request, so every attach that carried a token failed with ERROR_NOT_SUPPORTED, including --mount, distribution import and resize.
OpenVMM opens these files by path as the VM owner, so the token is now ignored, as it was before the check was added. This can over-grant or refuse access when the requester and VM owner differ in elevation, unlike HCS, which grants the VM access as the requester. Attaching disks by handle opened as the requester will close that gap once OpenVMM supports it.
Run an OpenVMM boot in the HCS WSL2 pass of every test image, including images without the Windows Hypervisor Platform, to check that OpenVMM either boots or reports ERROR_HV_NOT_PRESENT rather than failing with an unrelated error. The test logs the platform's installed state, the result, and the reported error. The backend now logs the OpenVMM process exit code when the process exits during CreateVm, so a crash, such as a failed delay load of WinHvPlatform.dll, can be identified.
0.0.3-8 is built from upstream microsoft/openvmm and translates OpenVMM's errors into specific HRESULTs, including ERROR_HV_NOT_PRESENT when no hypervisor is available and Win32 errors reported as OS error codes.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
An unresolved critical authorization flaw lets unelevated callers attach administrator-only disks through an elevated VM owner, alongside OpenVMM test failures and CI coverage gaps.
With OpenVMM selected, the preceding positive swiotlb=64M and swiotlb=4096K cases cannot launch echo ok: ValidateOpenVmmSupport rejects both nonzero values. Run those success cases only under HCS, while retaining this malformed-value parser case for both backends.
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the Pull Request
Follow-up to #42246. Ports backend selection and the testing and CI changes from the OpenVMM integration branch to
feature/openvmm:experimental.openVmm=truenow creates the VM with the OpenVMM backend, with the wiring WSL needs to run on it./p:OpenVmm=1).wsl2-openvmmCloudTest pass.PR Checklist
Detailed Description of the Pull Request / Additional comments
Backend selection
WslCoreVmcreates the VM withCreateVirtualMachineBackend(), using OpenVMM whenexperimental.openVmm=true.eth0NIC (with the configured or generated MAC) and, with localhost forwarding, itsloopback0NIC at creation, then runsOpenVmmNatNetworking. HNS NAT networks are created only for HCS, and the guest isn't asked for the DNS tunneling hvsocket on OpenVMM.IVirtualMachineBackend::ConnectGuest.CreateLxProcessreturns a serializedGuestConnector, whichwsl.exeandwslhost.exeuse for interop instead of the VM ID. The relays handle the AF_UNIX connections OpenVMM uses.DetachDiskmatches paths before reopening a VHD that the backend holds exclusively.Left out of the integration branch's
WslCoreVmchanges:wsl::core::Configalready performsTest infrastructure
LxsstuOpenVmmMode()reads/p:OpenVmm=1. When it is set,LxssGenerateTestConfig()writesexperimental.openVmm=trueand defaults the settings OpenVMM doesn't support: no GUI apps or GPU, virtio-fs drvfs with single-share devices, and no nested virtualization.OPENVMM_UNSUPPORTED_TEST_CLASS/OPENVMM_UNSUPPORTED_WSL2_TEST_METHODskip tests under OpenVMM.OPENVMM_TEST_CLASStags tests that drive the OpenVMM backend directly.BACKEND_AGNOSTIC_TEST_CLASStags tests whose result can't depend on the VM backend.TestConfigDefaultsgainslocalhostForwardingandnestedVirtualization.GetBlockDeviceInWsl()also scans/dev/vdX, because OpenVMM attaches disks over virtio-blk.GetElevatedTestToken()moves toVirtualMachineBackendTestHelpers.hso both backend test suites can use it.CloudTest
@TestCategory='OpenVMM'.wsl2-openvmmgroup runs the WSL2 suite onrs_prerelease-2026-10-05with/p:OpenVmm=1, minusBackendAgnostictests, and adds abackenddimension to the test job names.WSL test suites
openvmm.exeinstead ofvmmem.OpenVmmcontext..wslconfigwarning line numbers are computed instead of hard-coded.C:virtio-fs mount through/run/wsl/virtiofsinstead of the tag name.OpenVMM backend tests
New tests, adapted to the merged backend contracts: the
OpenVmmcontext name, callers addingCreateVm/ConfigureNetworking,VmVirtioBlkAddressslots, and host-socket files removed on destruction.Not ported, because they were superseded during the #42246 review:
ReservesExactPlacementsBeforeAutomaticDisks,LeavesVirtualDiskFileNamesToBackend,EnforcesDiskLimitsAndKeepsIdsVmScoped,DescribesConsoleFamiliesIndependentlyGuestShutdownTerminatesProcess, covered byNotifiesWhenGuestExitsGuestShutdownCallbackCanDestroyBackend, which contradicts the interface rule that termination callbacks must not destroy the backend inlineSelectsBackendFromExperimentalFlag, becauseSelectVirtualMachineBackendKindwas removed as unused in Port initial OpenVMM integration work #42246Validation Steps Performed
cmake --build . -- -m(full solution, Debug x64): passed.clang-format --dry-run --Werroron all changed C/C++ files (VS 2022 LLVM): passed.cloudtest/CMakeLists.txtin CMake script mode (cmake -P): each existing WSL group excludesOpenVMMandwsl2-openvmmis generated with/p:OpenVmm=1and theBackendAgnosticexclusion.wsl2-openvmmcovering OpenVMM end to end.