Hypervisor Backends
QuantaBox abstracts platform virtualization behind a single HypervisorBackend trait. Three concrete backends implement it -- KVM (Linux), Hyper-V (Windows), and Hypervisor.framework (macOS) -- with a TCG software fallback.
The Backend Trait #
Every backend implements a common interface:
| Method | Purpose |
|---|---|
backend_type() | Identify the backend (Kvm / HyperV / Hvf / None). |
is_available() | Whether acceleration is usable on this host. |
max_vcpus() | Maximum virtual CPUs supported. |
supports_nested_virt() | Whether nested virtualization is available. |
launch_vm() / launch_vm_with_vnc() | Build QEMU args and start the VM; return the PID. |
stop_vm(pid, force) | Graceful or forced shutdown. |
pause_vm(pid) / resume_vm(pid) | Suspend/resume execution. |
vm_status(pid) | Report running state, CPU%, and memory. |
vm_status returns a VmProcessStatus { pid, running, cpu_percent, memory_bytes }.
Detection #
Detection runs at startup and picks the first applicable backend:
| Host | Condition | Result |
|---|---|---|
| Linux | /dev/kvm exists | Kvm |
| Windows | Hyper-V optional feature is Enabled (probed via PowerShell) | HyperV |
| macOS | Always | Hvf |
| Any | None of the above | None (TCG) |
Engine Binary Discovery #
Backends prefer a bundled quantabox-vmm and fall back to qemu-system-x86_64. Search order by platform:
Linux
/usr/bin/quantabox-vmm
/usr/local/bin/quantabox-vmm
-> fallback: /usr/bin/qemu-system-x86_64, /usr/local/bin/qemu-system-x86_64
Windows
%ProgramFiles%\QuantaBox\quantabox-vmm.exe
<exe dir>\quantabox-vmm.exe
-> fallback: C:\Program Files\qemu\qemu-system-x86_64.exe,
C:\msys64\mingw64\bin\qemu-system-x86_64.exe
macOS
/opt/homebrew/bin/quantabox-vmm
/usr/local/bin/quantabox-vmm
/Applications/QuantaBox.app/Contents/MacOS/quantabox-vmm
-> fallback: /opt/homebrew/bin/qemu-system-x86_64, /usr/local/bin/qemu-system-x86_64
KVM Backend (Linux) #
- Acceleration: native KVM (
--accel kvm). - Machine/CPU:
q35machine,hostCPU (passes through host features). - SMP: built from the VM's cores x threads.
- Nested virt: supported.
- Process control:
SIGTERM(graceful) /SIGKILL(force);SIGSTOP/SIGCONTfor pause/resume; status via/proc.
Hyper-V Backend (Windows) #
- Acceleration: WHPX (
-accel whpx) when available, otherwise TCG. - Machine/CPU:
q35;hostCPU under WHPX,maxunder TCG. - Detection: PowerShell query
Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V(run without a console window). - Drives/NICs:
-driveper disk with the chosen format/bus; NIC model from config with-netdev user(NAT) includinghostfwdfor SSH when set. - Display:
-vnc localhost:<display>,websocket=<port>to feed the in-app noVNC console;-display nonefor the host window. - Shared folders / USB: virtio-9p
fsdev/virtio-9p-pci;usb-tabletplus optionalusb-hostpassthrough. - Unattended media: an autounattend floppy (Windows) or a cloud-init CD-ROM (Linux).
- Process control:
taskkill /PID <pid> [/F]; status viatasklist /FI "PID eq <pid>" /NH. - Logging: stdout/stderr are redirected to a log file in the VM's folder.
SSH Forwarding (NAT)
When ssh_host_port is set on a NAT adapter, the backend appends hostfwd=tcp::<host_port>-:22 to the first NIC's -netdev user, bound to localhost.
Shared Folders
For each share the backend emits:
-fsdev local,id=fsdev_<tag>,path=<host_path>,security_model=mapped-xattr[,readonly=on]
-device virtio-9p-pci,fsdev=fsdev_<tag>,mount_tag=<tag>
Mount tags are sanitized to alphanumerics, underscores, and hyphens.
Hypervisor.framework Backend (macOS) #
- Acceleration:
--accel hvf. - Machine/CPU:
q35on Intel,virton Apple Silicon;hostCPU. - Nested virt: not supported.
- Binary: prefers
quantabox-vmm-aarch64on Apple Silicon, elsequantabox-vmm/qemu-system-x86_64. - Process control: POSIX signals, as with KVM.
TCG Software Fallback #
When no native backend is available, QEMU runs with TCG (pure software emulation). VMs still run, but slowly. quantabox status reports Hypervisor: None in this case.
Hypervisor: None in the status output, check the Troubleshooting page for instructions on enabling hardware acceleration.Engine Identifiers #
The core uses the constants ENGINE_NAME = "QuantaVirt Engine" and VMM_BINARY = "quantabox-vmm" when locating and labelling the execution engine.