Repository navigation
Port initial OpenVMM integration work - #42246
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Active issues include job ownership that can terminate another VM’s shared device-host process, resource-lifecycle and networking regressions, and outdated assertions that cause an existing test to fail.
6 open issues
Share process jobs across VMs using the same device host · New Update mount identity assertions and clean up the created device · New Restore COM rundown and shared process-job cleanup · New Normalize IPv4-mapped IPv6 addresses before relay classification · New Allow the VM owner's token for persistent-memory mounts · New Convert Windows socket paths to UTF-8 · New
What changed in this PR
Ports the initial OpenVMM integration into WSL’s virtual-machine backend abstraction. Backend selection remains disabled while kernel debugging, interop integration, and testing/CI work are deferred.
Changes:
- Adds OpenVMM networking, guest-connection plumbing, resource management, and configuration validation.
- Extends host–guest disk operations to support both SCSI and virtio-blk.
- Updates backend tests, dependencies, localized errors, and boot documentation.
| File | Description |
|---|---|
| test/windows/OpenVmmVirtualMachineBackendTests.cpp | Adds configuration, capability, and shutdown checks. |
| test/windows/HcsVirtualMachineBackendTests.cpp | Updates capability expectations. |
| src/windows/service/exe/WslCoreVm.h | Makes disk operations transport-aware. |
| src/windows/service/exe/WslCoreVm.cpp | Passes disk transport information to Linux. |
| src/windows/service/exe/LxssUserSession.cpp | Uses disk attachments for resize and trim. |
| src/windows/common/wslutil.cpp | Updates the OpenVMM error-context label. |
| src/windows/common/WslInstall.h | Defines the Hypervisor Platform feature name. |
| src/windows/common/WslInstall.cpp | Adds Hypervisor Platform installation checks. |
| src/windows/common/WslCoreConfig.h | Declares the experimental OpenVMM setting. |
| src/windows/common/WslCoreConfig.cpp | Validates supported OpenVMM configurations. |
| src/windows/common/vsock.hpp | Declares AF_UNIX bridge helpers. |
| src/windows/common/vsock.cpp | Implements bridge connections and handshakes. |
| src/windows/common/VirtualMachineBackend.cpp | Adds a backend-selection helper. |
| src/windows/common/OpenVmmVirtualMachineBackend.h | Extends backend resources and lifecycle interfaces. |
| src/windows/common/OpenVmmVirtualMachineBackend.cpp | Expands networking, storage, sharing, and shutdown support. |
| src/windows/common/OpenVmmNatNetworking.h | Declares the OpenVMM NAT engine. |
| src/windows/common/OpenVmmNatNetworking.cpp | Implements guest networking and port forwarding. |
| src/windows/common/IVirtualMachineBackend.h | Extends shared backend contracts and resource types. |
| src/windows/common/HcsVirtualMachineBackend.h | Declares updated connection interfaces. |
| src/windows/common/HcsVirtualMachineBackend.cpp | Adapts HCS to the extended backend contracts. |
| src/windows/common/GuestConnector.h | Defines a serializable guest-connection abstraction. |
| src/windows/common/GuestConnector.cpp | Implements HCS and OpenVMM connection dispatch. |
| src/windows/common/ExecutionContext.h | Renames the OpenVMM context identifier. |
| src/windows/common/DeviceHostProxy.h | Changes device-host job ownership. |
| src/windows/common/DeviceHostProxy.cpp | Changes job assignment and COM shutdown handling. |
| src/windows/common/CMakeLists.txt | Registers new connection and networking sources. |
| src/shared/inc/lxinitshared.h | Extends disk and folder-mount messages. |
| src/linux/init/WSLCInit.cpp | Uses the renamed SCSI lookup helper. |
| src/linux/init/main.cpp | Adds virtio-blk discovery and transport-aware disk operations. |
| packages.config | Updates the OpenVMM dependency. |
| localization/strings/en-US/Resources.resw | Adds OpenVMM configuration errors. |
| doc/docs/technical-documentation/boot-process.md | Documents configuration requirements and limitations. |
Review effort: Balanced
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical issues allow disk authorization bypasses and unsafe VHD reuse, can expose guest services beyond localhost, and risk a shutdown deadlock.
7 open issues
Honor localhost forwarding limits for wildcard guest binds · New Avoid joining the log thread while holding the shutdown lock · New Validate the request token before attaching or reusing a disk · New Reject reuse of user-managed VHD attachments · New Update mount identity assertions and clean up the created device Refresh guest DNS servers when host connectivity changes · New Apply crash dump retention only after writing a new dump · New
5 resolved since last review
Review effort: Balanced
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved defects can block VM startup with long profile paths, owner-accessible UNC disks, or safe mode, silently omit duplicate-tagged NICs, and break guest DNS when Windows uses a local resolver.
5 open issues
7 resolved since last review
Reject reuse of user-managed VHD attachments Validate the request token before attaching or reusing a disk Avoid joining the log thread while holding the shutdown lock Honor localhost forwarding limits for wildcard guest binds Update mount identity assertions and clean up the created device Apply crash dump retention only after writing a new dump Refresh guest DNS servers when host connectivity changes
Review effort: Balanced
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 81238fed-f0a2-4cdb-8620-2284ff1b38fd
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6124d212-462d-4b14-bad5-7736bd9de175
There was a problem hiding this comment.
🔵 Needs a closer look
A COM callback lifetime cycle can retain device-host processes and proxy resources after shutdown, while LocalAppData-based socket paths can prevent VM creation for valid Windows profiles.
No open issues 🎉
1 resolved since last review
Review effort: Balanced
There was a problem hiding this comment.
🔵 Needs a closer look
COM teardown changes can leave device-host processes and compute-system handles alive after VM shutdown, while socket-path handling can prevent supported user accounts from creating OpenVMM VMs.
No open issues 🎉
Review effort: Balanced
There was a problem hiding this comment.
🔵 Needs a closer look
Shutdown no longer breaks remote COM callback references, potentially leaving the proxy and device-host process alive, while longer LocalAppData socket paths can exceed the length limit and prevent VM creation.
No open issues 🎉
Review effort: Balanced
Blue (OneBlue)
left a comment
There was a problem hiding this comment.
Change LGTM, one minor question on the networking settings, but can be resolved in a future change
| HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED), | ||
| shared::Localization::MessageOpenVmmNetworkingConflict(), | ||
| NetworkingMode != NetworkingMode::Nat && NetworkingMode != NetworkingMode::None); | ||
| if (NetworkingMode == NetworkingMode::Nat) |
There was a problem hiding this comment.
I'm a bit confused by this, doesn't openvmm only support consommé networking ? (NAT in this context is HNS-based NAT, which I don't think openvmm can support
There was a problem hiding this comment.
Will address in a follow-up. I chose NAT here to distinguish between Consomme for HCS is a separate path compared to Consomme for OpenVMM. Since, Consomme is OpenVMM's NAT implementation, I thought it made the most sense to call it NAT networking.


This ports the initial OpenVMM integration work to feature/openvmm . Backend selection remains disabled while the remaining changes are brought over.
Adds backend plumbing, NAT support, and validation for the supported OpenVMM configuration.
Missing features that will be added in a follow-up PR: