mullane.info

Four new VMs on the old laptop, and one less on svchost1

2026-11-22 · svchost2

The plan for this session was short: delete the old UniFi controller VM on svchost1, which had been shut off since the controller moved to UniFi OS Server on 2026-11-15, and then build the four VMs that had been sitting in the network plan for weeks: home-assistant and local-ai in the SERVICES zone, and vm-rhino and vm-arch in LAB. All four go on svchost2, the 2017 Precision laptop with the failing display, because it’s the only hypervisor with RAM to spare (32 GB, against 11 on each of the others).

It actually took two sessions. I closed the window on the first one partway through (a workbench limitation I’ll fix later, which also means sessions run one at a time for now), and when the agent picked it back up, the first thing it did was check what the first session had actually done. The answer was nothing. No branches, no commits, the old VM still there, svchost2 still running only the controller. It had read the docs and found the reservations, and stopped right before the part where it was supposed to ask me about sizes. So that’s where we started again.

Deleting the old controller was the easy bit, and the agent checked the new one first, which I’d asked for: the service was up, all six devices (three APs, three switches) were connected, the certificate was good until February, and there were 23 nightly backups on mediarr, the newest from that morning. Then virsh undefine --nvram --remove-all-storage, plus the cloud-init seed and serial logs it left behind. There was also a commented-out host key for the old VM in known_hosts on both desktom and laptom, kept for the rollback, so that went too. The rollback section of the controller’s README now says what’s true: there is no warm standby anymore, and recovery means rebuilding a VM and restoring the newest backup from mediarr. The APs and switches keep working without a controller in the meantime, which is (sort of) the point of having them.

For the sizes, the agent proposed 4 GiB for Home Assistant, 3 for the local-ai frontend and 5 each for the two LAB machines, which with the controller’s 6 adds up to 23 GiB and leaves about 6 for a games VM later. I took it. I also took its other recommendations: Home Assistant as a container under rootless Podman on Arch like everything else (no add-on store, but it gets the same weekly updates and backups as the rest of the fleet), and vm-rhino and vm-arch as plain Arch VMs for now, since their desktops only matter once Guacamole exists, and that’s the www work I’ve scheduled last. The one place I didn’t take its recommendation was Thread. It suggested deciding later; I’d rather Home Assistant have its own border router, so it’ll get one.

Then the first snag. svchost2 had only ever hosted CORE guests, so it had one bridge and nothing tagged. The switch port was already carrying the SERVICES and LAB VLANs, so the agent copied the pattern from svchost0: a VLAN subinterface on top of the main bridge, enslaved to its own bridge per zone, and a libvirt network on each. That part was painless, and it doesn’t touch the main bridge or the running controller. But the VM build script had network=lan hardcoded, which meant every VM it had ever built started life in CORE. svchost0 got around this once by building in CORE and moving the VM afterwards, and the controller migration taught us that moving a cloud-init VM can strand its network config, because cloud-init matches the interface by MAC. So the script now takes the network as an optional seventh argument, and the VMs booted straight into their own zones and picked up their reserved addresses on the first try.

The second thing was a step that had been prose all along. Since 2026-11-13, every VM is supposed to have an owner account and the smart-card sudo endpoint, because before that, once the agent’s sudo became temporary, nobody could get root on the VMs at all. The fix back then was an offline virt-customize pass with the VM shut down, and the skill described it in a paragraph rather than a command. The agent turned it into common/vm-owner-setup.sh instead, which runs on the VM while cloud-init’s build-time sudo still exists: it adds my account with a random initial password (copied into secrets and shredded on the VM, never printed), the wheel sudoers file, the temporary-sudo toggle and the fleet-sudo endpoint. Then, once the rest of the root work is done, --drop-standing-sudo removes cloud-init’s permanent grant. After that, sudo -n true asks for a password on all four, which is what it should do. No downtime, no guestfs, and next time it’s one command instead of a paragraph.

The smallest snag was cosmetic, and I only mention it because it looked alarming. The fleet-sudo installer ends by printing the effective PermitRootLogin, and on all four new VMs it printed nothing. That turned out to be the readout, not the setting: current OpenSSH prints PermitRootLogin in mixed case from sshd -T, and the script was matching the lowercase form. The setting itself was correct (forced commands only). It matches case-insensitively now.

While all this was building, I asked about the Thread radio: how much range matters, whether there’s a device limit, and whether I should buy three radios, one passed through to the VM and two on Raspberry Pis around the house. The answer was to start with one. Thread is a mesh, and anything mains-powered on it (plugs, bulbs, most switches) acts as a router, so the border router only needs a decent link to one of them rather than to every device. A basement radio is only a problem until there are a few powered Thread devices, and a short USB extension cable to get it away from the laptop is the cheap fix. The limits are 32 routers per network and some tens of battery-powered children per router, which comes to a few hundred devices, far more than this house will ever have. Extra border routers buy redundancy, not capacity, and they all have to share one Thread network and sit on Home Assistant’s VLAN, or someone has to route between them. Two Pis would be two more Arch hosts to keep patched, for a problem I don’t have yet. So it’s one radio and an extension cable, and maybe a Pi later if the Sunday reboots turn out to matter.

What we ended up with: svchost2 now runs five VMs, four of them new, all autostarting, all reachable from both desktom and laptom with pinned host keys, all on the weekly update schedule, and none of them with standing sudo for the agent. Home Assistant itself isn’t installed yet, because that needs a backup drop on mediarr, a certificate and firewall rules, which belong to other repos and other sessions, so they’re in the hand-off notes instead. The old controller on svchost1 is gone, and svchost1 is back to hosting just the identity provider, with a lot of free RAM it didn’t have this morning.