1. truncate -s treats a bare number as bytes, not gigabytes - typing
"50" at the size prompt (instead of "50G") silently made a 50-byte
file, which then failed mkfs.ext4 with "Device size reported to be
zero." Added normalize-size: a bare integer answer now gets a "G"
suffix appended (matching what the prompts' own defaults imply),
anything with an existing suffix passes through unchanged.
2. Every disk-creation step runs through `priv` (sudo/root), so
subvolumes and disk images always ended up root-owned - but
hermes-vm.service runs as the unprivileged hermes-vm account, which
only had read access via the "other" bits. QEMU failed to open
system.raw for read-write. Added explicit `chown hermes-vm:hermes-vm`
after every creation point (both make-subvol branches, and after
each truncate/mkfs) - also self-heals already-existing
wrongly-owned disks on a re-run, not just fresh ones.
Both confirmed live on hl-fwdesk during tonight's incident. Verified
with a unit test of normalize-size and a full sandboxed interactive
dry run of `setup` (fake sudo/btrfs/truncate/chown/mkfs.ext4) showing
the correct truncate -> chown ordering for both disks.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
QEMU's -netdev tap line never requests queues=N, so a persistent tap
created with `multi_queue` fails TUNSETIFF with EINVAL on every attach
attempt ("could not configure /dev/net/tun: Invalid argument"),
crash-looping the VM indefinitely. Confirmed live on hl-fwdesk via
`ip tuntap show` (tap flagged multi_queue, numqueues 0 - never
successfully attached).
vhost is already off in this design, so multiqueue bought nothing here
anyway - just drop the flag from tap creation instead of adding
matching queues= plumbing.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
services.hermesVm -> services.hermenix throughout. setup.sh and
migrate-docker-hermes.sh are replaced by nu/hermenix.nu (setup + migrate
subcommands), packaged as a flake output (packages.${system}.hermenix,
pkgs.writers.writeNuBin) so it's installable without cloning conventions
beyond the repo itself. Both subcommands verified end-to-end against a
sandboxed dry run (stubbed disk/cache tools, a local ssh stand-in for the
migrate path) before landing.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Two-disk (system/state) btrfs-backed QEMU VM, nftables-isolated by default,
adapted from a design provided as loose files. Adds a hermesHome option to
the host module and migrate-docker-hermes.sh so an existing flat HERMES_HOME
(e.g. from a prior Docker deployment) can be carried over intact.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>