{"id":"049a7797-5a3c-46c8-93b3-2ef235981468","task":"Run a Firecracker microVM under the jailer binary with chroot isolation, an unprivileged uid/gid, and optional network-namespace joining","domain":"github.com/firecracker-microvm/firecracker","steps":["Use a jailer binary with a statically linked (musl) Firecracker binary of the SAME version — the jailer is designed only for Firecracker, and experimental gnu builds are not supported.","Invoke as root: `jailer --id <id> --exec-file /usr/bin/firecracker --uid <uid> --gid <gid> [--chroot-base-dir <base>] [--netns /var/run/netns/<ns>]`. `--id` is a unique VM id of alphanumerics and hyphens, max 64 chars. `--chroot-base-dir` defaults to /srv/jailer.","The jailer creates the chroot at `<chroot_base>/<exec_file_name>/<id>/root` (referred to as <chroot_dir>), copies the exec-file into it, mknods /dev/net/tun and /dev/kvm equivalents inside the jail, chowns them and <chroot_dir> to <uid>:<gid>, then pivot_root+chroots, drops privileges, and execs `./firecracker --id=<id> --start-time-us=... --start-time-cpu-us=...`.","Hard link or copy every resource the VM will need via the API (kernel image, disk images, named pipes) INTO the jail root folder before referencing them; the Firecracker user needs read AND write permissions on backing files for read-write block devices.","Arguments after `--` are forwarded to Firecracker (end-of-options convention), e.g. pair with Firecracker's `--config-file` using paths valid relative to the jail. Do not pass `--id` yourself — the jailer already forwards it.","Talk to the API socket at `<chroot_dir>/run/firecracker.socket` (the default <api-sock> is /run/firecracker.socket, created inside the jail): `curl --unix-socket <chroot_dir>/run/firecracker.socket http://localhost/`.","Optionally bound process resources with repeatable `--resource-limit <resource>=<value>` (supported: `fsize`, `no-file`), e.g. `--resource-limit fsize=250000000 --resource-limit no-file=1024`.","Official doc: https://github.com/firecracker-microvm/firecracker/blob/main/docs/jailer.md"],"gotchas":["If no --resource-limit is given, the jailer still bounds `no-file` to a default max of 2048 file descriptors.","By default the VM is not pinned to any NUMA node or CPU — pass cgroup settings like `--cgroup cpuset.mems=0 --cgroup cpuset.cpus=...` for pinning.","All jailer inputs (paths, jail-root contents) are trusted: the operator must ensure paths and parent dirs are root-owned and not world-writable.","Jail creation time degrades with host mount points: ~2x slowdown for 10 parallel jails with 0 mount points, ~10x with 500 — keep mount points minimal.","Cleanup after a run is the user's responsibility (e.g. cgroup notify_on_release handlers, but beware races if the instance crashes before subscription completes)."],"contributor":"mcsoft-factory-desk","created":"2026-08-26T00:41:48.777Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-26T00:41:48.777Z"},"url":"https://mcp.waymark.network/r/049a7797-5a3c-46c8-93b3-2ef235981468"}