A thought experiment that turned into a plan: if I had an IP-KVM on the hypervisor, could an AI coding agent like Claude Code take it from a blank disk to a working Proxmox host while I watched?
The KVM gives an agent eyes and hands
The PiKVM API is plain HTTP, and it covers everything an install needs:
- Screenshots:
GET /api/streamer/snapshotreturns a JPEG of the screen, or recognised text withocr=true. - Typing:
POST /api/hid/printtypes text, andsend_keypresses single keys. - A virtual USB drive:
POST /api/msd/writeuploads an ISO, andset_paramswithcdrom=1presents it to the machine as a CD-ROM. - Power:
POST /api/atx/powerturns the machine on, off or hard-resets it (with the ATX board fitted).
There are already community MCP servers that hand these to Claude Code as tools. An agent can look at a screenshot, decide what to press, and press it.
But clicking through installers is the wrong way to do it
Driving a GUI from screenshots is slow and brittle. The better move is to need the screen as little as possible. Proxmox has had an automated installer since 8.2: you bake an answer.toml file into the ISO, and the install runs with no prompts at all.
[global]
keyboard = "en-gb"
country = "ie"
fqdn = "pve.lab.internal"
mailto = "lab@example.com"
timezone = "Europe/Dublin"
root-password-hashed = "<hash>"
root-ssh-keys = ["ssh-ed25519 AAAA..."]
reboot-mode = "power-off"
[network]
source = "from-dhcp"
[disk-setup]
filesystem = "zfs"
disk-list = ["nvme0n1", "nvme1n1"]
zfs.raid = "raid1"
[first-boot]
source = "from-iso"
ordering = "network-online"
reboot-mode = "power-off" stops the machine booting back into the installer when it’s done. The first-boot section runs a script of mine on the new system’s first boot.
The whole session
- The agent uploads the prepared ISO to the KVM and mounts it as a CD.
- It powers on and presses F8 for the boot menu.
- It reads the screenshot and picks the virtual CD.
- It watches screenshots until the machine powers itself off.
- It ejects the CD, powers on and connects over SSH.
- Everything else runs as scripts: repositories, updates, the isolated network bridge, the archive pool and the VMs.
The scripts live in a git repo. “My lab rebuilds itself from a repo” is a better thing to be able to say than “I clicked through some installers”.
The guardrails
- Unplug data disks during automated installs. The installer wipes whatever
disk-listnames. One typo and 16 TB of archive is gone. - KVM credentials are root, below the operating system. They stay on a management-network device and never go near the internet-facing honeypot.
- Power and disk actions need my approval in the agent’s permission settings.
- The agent never watches the screen of a VM with a sample in it. Malware can print text aimed at an AI that’s reading the screen. More on that next.