VA-11: Windows KVM via DXGI Desktop Duplication + SendInput #57
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/VA-11-windows-kvm"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Phase-6 Windows parity for KVM (VA-11). Adds a Windows backend to
vervain-agent-kvmbehindcfg(target_os = "windows"), reusing the existing tile-diff streaming pipeline rather than forking it.What changed
src/windows/capture.rs): a D3D11 device duplicates the primary output; each frame is copied to a CPU-readable staging texture and read back as packed BGRA, which maps directly onto the pipeline'sPixelLayout::Bgrx. Reacquires transparently onDXGI_ERROR_ACCESS_LOST, falls back to the WARP software device when there's no GPU, and persists the duplication across frames.stream.rs::capture_raw_frameand the one-shotcapture_primary/capture_displayget Windows arms.src/windows/input.rs): absolute mouse moves (normalized over the primary monitor), buttons + wheel, andkey_eventmapping the SPA's X11 keysym names to virtual keys (named control keys) or injecting printable characters as Unicode (KEYEVENTF_UNICODE).src/windows/display.rs):EnumDisplayMonitors+GetMonitorInfoW, sameDisplayInfoshape as the Linux xrandr path (AC#3).src/windows/session.rs):WTSQueryUserToken+CreateProcessAsUserWto run KVM in the console user's session, because a Session 0 service has no interactive desktop. Detection + spawn primitive land here; the service<->helper frame/input relay is the agent-side follow-up.stream.rsis now platform-agnostic (capture backend hands in aRawFrame), andjpeg-encodermoved to a cross-platform dependency.The existing
run_desktoptunnel callscapture_changed_tiles/mouse_move/key_event, so interactive-session Windows KVM works with no agent change.Decisions
windowscrate (notwindows-sys) since DXGI/D3D11 are COM; active-session helper (chosen over in-process-only) for Session 0; DXGI-only (Win10/11 both support Desktop Duplication).Validation
Typecheck-only interim (agreed):
oci-build/check.Dockerfilepasses - fmt, clippy --deny warnings, build, the full test suite, and the Windows cross-check compiling the DXGI/SendInput/WTS backend. The runtime ACs (capture on Win10/11, input in both session contexts, multi-display parity) are validated on a real Windows host.Follow-up
Session-0 service<->helper frame/input relay (IPC); per-output DXGI capture selection by name.
Refs VA-11.