Run a command in the guest over SSH. Never rejects; check exitCode.
Optionaloptions: { timeout?: number }Run a script passed via stdin (avoids command-line length limits).
Optionaloptions: { timeout?: number }Resolve a well-known guest location (CLI/agent binary, integration_tests dir).
Path to the CoW overlay this VM booted from ('' before start()). With
keepOverlay: true the overlay survives stop(), so a caller can capture
this path and adopt the overlay as a persistent disk.
Host port forwarded to the guest's SSH (22). 0 before start() / after stop().
Guest SSH user (default 'testuser').
Boot the VM: create a qcow2 overlay beside the base image (a CoW copy
when resuming a loadvmTag snapshot), allocate a host SSH port from
sshPortRange (default 2222–2299), spawn QEMU, and wait for SSH. Warm
boots also re-sync the guest wall clock from the host.
Host mutation: spawns a long-lived QEMU process (registered with the
process-exit safety net described in the module header) and writes the
overlay image into <imageDir>/overlays/.
Throws a plain Error when the base image is missing, the overlay/copy cannot be created, no port in the range is free, or SSH never becomes ready (in which case the VM is stopped first).
Graceful guest shutdown → SIGKILL fallback → overlay unlink → port release. Idempotent.
Sync repo code into the VM at /opt/edgible via rsync. Optionally run npm install and build in the guest.
Optionalopts: SyncCodeOptionsPoll until the guest answers over SSH: 30 attempts at 2s intervals for a cold boot, 6 attempts at 1s for a warm (snapshot) boot. On exhaustion the VM is stopped and a plain Error is thrown. Called by start(); exposed for callers that restart sshd in the guest.
VM lifecycle helpers (R5) — QEMU-backed VM orchestration ported from integration_tests/lib/vm/**. Node-only: exposed via @edgible-team/sdk/node (documented deviation from architecture.md "tier 3 in root" — the root build must stay browser-safe, and this code is fs/child_process-heavy).