Coding agents now install packages, start databases, run test suites and open ports, usually with --dangerously-skip-permissions or its equivalent turned on. People run them in three places: their laptop, a container, or a virtual machine. This post compares the last two, because that is the choice every agent platform makes, us included.
The one-line difference
A container is a group of processes on the host's kernel, fenced off with namespaces and cgroups. A microVM has its own kernel, running on virtual hardware provided by a small hypervisor such as Firecracker. Every other difference follows from that.
| Container | microVM | |
|---|---|---|
| Kernel | Shared with the host | Its own |
| Security boundary | Syscall surface of the host kernel | Hypervisor and a few virtual devices |
| systemd, cron, real services | Awkward | Just works |
| Docker inside | Needs privileged mode or tricks | Just works |
| Start time | Milliseconds | Seconds to boot, milliseconds from a snapshot |
| Memory overhead | Almost none | A guest kernel per VM |
| Snapshot running memory | Possible (CRIU), fragile | Built into the hypervisor |
Isolation: the agent is the untrusted code
With a container, every syscall the agent makes goes straight to the host kernel. A kernel bug becomes a way out of the container and onto the host, next to everyone else's containers. With a microVM, the agent's syscalls go to its own kernel. To escape, it has to break the hypervisor through a handful of emulated devices, which is a much smaller target. Firecracker was built by AWS for exactly this: running strangers' code side by side for Lambda.
If you are the only person on the machine, this matters less. If you are renting machines to strangers, as we are, it is the whole game.
Agents want a whole computer
The less obvious reason is capability. Ask an agent to "set up Postgres and run the migrations" and it will reach for apt install and systemctl start. Ask it to "test the Docker build" and it needs a Docker daemon. In a container, both are workarounds. In a VM, they're Tuesday:
root@me:~# systemctl is-active docker postgresql cron
active
active
active
Every workaround is a place where the agent gets stuck, retries, burns tokens, and finally asks you for help.
Snapshots: the part that changes the economics
Agents are idle most of the time: waiting for you, for CI, for the next prompt. Paying for idle hours adds up, but stopping the machine throws away its memory. Because a microVM's whole state is a memory file plus a small state file, the hypervisor can save it and restore it. We wrote up how we put a VM to sleep in 3 seconds and wake it in 0.04, with every process still running.
Where containers still win
- Density. No guest kernel per instance, so you can pack far more of them on a box.
- Cold start. A container starts in milliseconds. A VM boots in seconds unless you restore it from a snapshot.
- Short, trusted jobs. If the code is yours and it runs for ten seconds, a container is simpler.
For agents that run unreviewed code for hours, want root, and sit idle in between, we think a microVM is the right shape. That's why every Yurt VM is one.
Questions
Is a container enough to sandbox an AI agent?
For your own trusted code on your own machine, often yes. For unreviewed code from an agent with root, a VM puts a separate kernel between the agent and the host, which is a much smaller attack surface.
Can you run Docker inside a microVM?
Yes. A microVM has its own kernel, so Docker, systemd and other services run as they would on a normal server.
Are microVMs slower to start than containers?
A cold boot takes seconds, a container starts in milliseconds. Restoring a microVM from a memory snapshot takes milliseconds too.
Sources
- Firecracker, read 2026-11-29
- Claude Code security, read 2026-11-29
Give your agent its own computer. Full root, its own IPv6, and it sleeps with its memory when idle. Plans from $20/month, paid back as VM time.
curl -fsSL https://getyurt.dev/install | shKeep reading
Setup
How do you run Claude Code in the cloud?
Run Claude Code on a cloud VM instead of your laptop: what machine you need, the install command, logging in without a browser, and keeping it running after you disconnect.
Safety
Is --dangerously-skip-permissions safe?
What Claude Code's --dangerously-skip-permissions flag does, what Anthropic's docs say about where to run it, what can go wrong, and a checklist for running it safely on a VM.
Engineering
How a VM sleeps in 3 seconds and wakes in 0.04
Firecracker snapshots let a Yurt VM go to sleep with its RAM saved to disk and wake in about 40 milliseconds with every process still running. Here is exactly how, including the mistakes.