Scripts for running application tests inside Firecracker microVMs instead of containers.
These are developed on macOS but must be run on a Linux host with KVM
(/dev/kvm). Copy this directory to that host (scp -r microvm/ user@host:)
before running anything.
scripts/01-install-firecracker.sh # one-time: installs firecracker + jailer
scripts/02-fetch-image.sh # one-time: downloads a starter kernel + rootfs
scripts/03-run-vm.sh 1 # boots microVM #1
ssh -i images/id_rsa root@172.16.1.2 # test your app inside it
scripts/04-stop-vm.sh 1 # tear it down
Each vm_id (1-254) gets its own tap device and 172.16.<vm_id>.0/24
subnet, so multiple microVMs can run concurrently:
scripts/03-run-vm.sh 1
scripts/03-run-vm.sh 2
scripts/- setup and lifecycle scripts, run in numbered orderimages/- downloaded kernel/rootfs/ssh key (gitignored, created by02-fetch-image.sh)run/- per-VM runtime state: writable rootfs copy, API socket, logs, pid (gitignored)
- The rootfs downloaded by
02-fetch-image.shis Firecracker's official CI test image (Ubuntu), meant as a quick starting point. Swap in your own rootfs by dropping animages/rootfs.ext4built for your application. 03-run-vm.shsets up NAT so the guest has outbound internet access (useful forapt installwhile iterating on a test image).