# agent-mkosi A VM that runs [Claude Code](https://claude.com/claude-code) in the background. It is a minimal Fedora image built with [mkosi](https://github.com/systemd/mkosi). You control Claude from claude.ai/code or the Claude app (Remote Control), or log in with ssh. - **Read-only OS:** `/usr` is read-only, so Claude can't change the OS. Secure Boot verifies the UKI (kernel, initrd and command line), which holds the dm-verity hash that verifies `/usr`. - **Encrypted with a TPM:** everything that isn't read-only, such as `/etc`, `/var` and `/home`, is encrypted. The TPM unlocks it only for those signed UKIs. - **Tools in containers:** Claude runs as the user `agent`, without root, and runs its toolchains in containers with podman. - **Self-updating:** the image rebuilds weekly. A bad update rolls back by itself. ## Install Download [the disk image](https://git.plabble.org/api/packages/Job79/generic/agent/latest/agent.qcow2), resize it to the disk size you want and boot it with UEFI and a TPM. At first boot, the screen offers a recovery key for the encrypted disk and asks for a root password. Then log in as root and put your ssh key in `/home/agent/.ssh/authorized_keys` (for root: `~/.ssh/authorized_keys`), which starts sshd. Run `claude` once as `agent` to sign in. The VM then shows up in claude.ai/code and the Claude app under its hostname: `agent-` and four hex digits. To start over, run `systemctl start factory-reset.target` as root. It reboots and wipes `/etc` and `/var`, and the VM sets itself up as at first boot. ## Development ```sh mkosi genkey # local test only, CI uses the SECUREBOOT_KEY secret mkosi build ``` `mkosi.output/` then holds the disk image (`agent_.raw`) and the UKI and /usr partitions that make up an update. To build and boot a test VM (needs `qemu-kvm-core edk2-ovmf swtpm openssh-clients socat`): ```sh mkosi -f vm # opens its console: log in as root, password root mkosi ssh # in another terminal: ssh in as root ```