chroot.dev: an OpenBSD VM over ssh in under a second
ssh chroot.dev new -n web -w gives you an OpenBSD VM that answers ssh
in about 600 ms. The whole interface is commands over
ssh(1). It runs on my
OpenBSD port to Firecracker,
and it's open now as a beta, by invitation, with a 14-day trial.
The recording is real time against the live service. It creates a VM, starts httpd(8) in it, serves it over HTTPS, copies the running VM and removes both.
Why I wanted a disposable OpenBSD machine
Getting an OpenBSD machine today means a long-lived VM, a cloud image or QEMU on your own box. openbsd.amsterdam does the long-lived VM well, on OpenBSD's excellent vmm(4)/vmd(8), and if that is what you need, go there. I have VMs there and the service is very good.
What I kept missing while working on the port was a machine I could treat like a process: create it from a script, break it, copy it before the risky step, throw it away. With the kernel booting in ~30 ms, there was no reason for a new VM to take longer than the ssh handshake.
What a session looks like
$ ssh chroot.dev new -n web -w
web 10.201.0.6
ssh in 621 ms
$ ssh vm+web@chroot.run
web$ uname -a
OpenBSD web 8.0 MICROVM#10 amd64
You log in as puffy, in group wheel, with
doas(1) and no password. Your account
keys are installed at boot and root can't log in over ssh.
Each VM also gets https://NAME.chroot.run with a valid certificate.
It is private by default: ssh chroot.dev browser prints a one-time link
that logs your browser in. share picks the port behind the proxy (80
by default) and who gets in:
$ ssh chroot.dev share set-public web
$ curl https://web.chroot.run
hi g33ks =]
Every command accepts --json, and the same commands run over HTTPS with
a scoped token, so a script never has to parse a table:
$ ssh chroot.dev ls --json | jq -r '.[].name'
web
Copying a running VM, memory included
You spent an hour getting a VM right: packages, configs, a service
running. Now you want to try something that might break it, like a new
pf.conf(5), pkg_add -u or a
database migration. A disk snapshot gives you the files back, but the
copy still has to boot and every service has to come up again.
That's why cp is the part I like most. A running VM is copied with its
memory, so the copy resumes with the same processes instead of booting:
$ ssh chroot.dev cp web web2 -w
web2 10.201.0.10
ssh in 478 ms
$ ssh vm+web2@chroot.run pgrep -l httpd
53705 httpd
91719 httpd
8703 httpd
61260 httpd
76122 httpd
Nobody started httpd in web2. It came along in the memory snapshot.
Break web2 as much as you want; web is still where you left it.
How new and cp are this fast
new doesn't boot anything. Each image has a Firecracker snapshot of
a guest that already booted and is waiting for its identity. Creating a
VM restores that snapshot with the VM's own tap device, writes the
identity (hostname, network, host keys to generate, your ssh keys) into
Firecracker's
MMDS,
and resumes it. A small agent in the guest reads MMDS and applies it.
The disk is a btrfs subvolume snapshot of the image, about 20 ms.
cp pauses the source, takes a full snapshot of memory, device state and
disks, and resumes the source. The copy is restored from that snapshot
with a new identity in MMDS. The guest notices it was cloned through
the VM generation ID counter (/dev/vmgenid), and the agent applies the
new host key, hostname and address with the VM up, dropping the TCP
connections it inherited from the source.
The path a connection takes:
you --ssh/https--> edge VPS, São Paulo --VPN--> host
forwards 22/80/443 lobby: ssh commands,
keeps the client IP vm+NAME@ proxy, HTTPS proxy
Firecracker microVMs
The edge only forwards. The lobby on the host takes the commands, proxies
vm+NAME@chroot.run to the right VM and terminates HTTPS with a
*.chroot.run certificate. Outbound traffic from the VMs leaves through
the edge, never from my home connection.
What is rough, on purpose
- The host is one laptop at my home. It will go down: power, suspend, the home uplink. VMs come back after a suspend and their clock is set again, but there are no backups yet. Keep a copy of anything you care about.
- One shared IPv4. ssh has no SNI, so the edge cannot tell which VM
you want from the hostname. The name goes in the user instead:
vm+NAME@chroot.run. No IPv6 yet. - -current only, with my kernel. The guest kernel is -current with the Firecracker patches, which are not in the OpenBSD tree. -current has no errata and no syspatch(8): kernel security fixes reach your VM when I rebuild on a newer -current. The patches aren't published yet; I'll decide after the beta.
- Small limits. The trial has 1 VM, 1 cpu and 512 MiB of memory; the smallest plan, US$ 5 a month, has 3 VMs, 2 cpus and 1 GiB. amd64 only, with the edge in Brazil: expect higher latency from Europe and Asia.
After the beta
Three things are next, in no fixed order. Feedback from the beta decides which one comes first.
- Off the laptop. A dedicated host, with scheduled backups and a copy
that lives off the machine (
btrfs send). The "keep a copy" caveat above goes away. - IPv6 per VM. With an address per VM,
ssh NAME.chroot.runcan go straight to the VM, andvm+NAME@becomes optional. - An OpenBSD CI runner. Most projects that test on OpenBSD today boot QEMU inside a Linux GitHub/SourceHut runner and spend 60 to 70 s on download, boot and sync before the build starts, and Cirrus CI shut down in June 2026. A runner restored from a snapshot with the packages already installed, behind a drop-in GitHub Action, should cut most of that.
Getting an invitation
Invitations go out by hand, in small batches. Ask at
contact@chroot.dev and you get a one-time
code. The account starts on a 14-day trial; the plans are in
billing(7). The manual starts at
intro(1), the current state is at
status.chroot.dev, and the channel is
#chroot.dev on Libera.Chat.
If you try it, I want to hear what broke and what you expected new to
do that it didn't.