Files
reims-vgpu/vm
Anees IqbalandClaude 682697383b 🔥 A shutting-down boot must not delete the live boot's QMP alias
vm/boot-x86.sh and vm/boot-arm64.sh. Both rails publish their per-boot
`qmp-$STAMP.sock` under the shared name `qmp.sock`, which is what every driver
script and the loop docs resolve. Both then removed that shared name
unconditionally in `discard_clone`.

So killing one VM and starting the next immediately — the normal shape of an
A/B or a repeated repro — races: the new boot creates its symlink, the old
boot's cleanup trap then fires and deletes it. The new VM runs fine and its
socket exists under the stamped name, but every driver resolving `qmp.sock`
gets ENOENT.

This is a measurement hazard, not just an annoyance. It cost a boot here: the
page-loads driver got through login and the `settled` capture, then failed on
the first `qmp.py key` with a bare FileNotFoundError and continued. It captured
five more PNGs of an undriven screen (presents 32/64/96 against a normal
128/192/416, every verdict DARK) that look exactly like a severe guest-side
rendering defect. Nothing in the artifacts says the input never arrived.

Fix: remove the shared alias only while `readlink` still shows it naming this
boot's own socket. The stamped socket is still removed unconditionally.

Verified: `bash -n` on both scripts; the readlink guard checked directly
(matching stamp -> yes, non-matching -> no). Not verified: an actual arm64 boot
(no Apple host here) — the arm64 change is textually the same guard on the same
construct, and the x86 one is exercised by the next boot on this rail.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-28 01:04:21 +03:00
..
2026-07-26 15:24:53 +03:00

vm/ — macOS guests for the reims-vgpu pathways

crates/reims-vgpu runs three backend pathways over two guest rails. Pick the boot script for the guest you are on and the QEMU/reims-vgpu backend for the host GPU path.

Pathway Script Host accel Backend Typical device
x86 macOS / Linux Vulkan vm/boot-x86.sh KVM / OpenCore+OVMF Vulkan via metal2vulkan reims-vgpu-pci
arm64 macOS / macOS Metal vm/boot-arm64.sh HVF / vmapple Metal-direct reims-vgpu-mmio (product) or apple-gfx-mmio (Apple reference A/B)
arm64 macOS / macOS Vulkan vm/boot-arm64.sh HVF / vmapple Vulkan via metal2vulkan through MoltenVK reims-vgpu-mmio
# arm64 macOS guest on Mac host (Metal or Vulkan/MoltenVK backend)
vm/boot-arm64.sh --testing                 # agent boot: GUI + serial-to-file, hard kill, reverts
vm/boot-arm64.sh --interactive             # human boot: GUI, no time limit, reverts
vm/boot-arm64.sh --device reims-vgpu-mmio --testing
vm/boot-arm64.sh --device apple-gfx-mmio --testing   # Apple-paravirt reference (arm only)

# x86 macOS guest on Linux host
vm/boot-x86.sh --testing
vm/boot-x86.sh --device reims-vgpu-pci --testing

Both scripts use a snapshot-revert lifecycle (testing vs interactive classes; testing hard kill). QMP is a per-boot unix socket under the run dir for that pathway (scripts/qmp/qmp.py).

Networking is typically QEMU SLIRP with SSH hostfwd. Guest disks, IPSWs, OpenCore blobs, and runtime clones are gitignored - private and large; never commit them.

Layout (gitignored runtime)

Pathway-specific trees hold provisioned disks, snapshots, and per-boot clones. See the boot and provisioning scripts for where golden images and SSH setup live.

Stop a wedged guest with the pathway's shutdown helper when available (scripts/vmapple-shutdown on arm); otherwise use QMP quit plus a process kill.