Lightweight MicroVM engine with dual hypervisor backends: Cloud Hypervisor (default) and Firecracker. One hypervisor process per VM, no daemon; Docker-like CLI; snapshots that clone into new identities in tens of milliseconds.
cocoon CLI ──► images: OCI (EROFS layers, direct boot) | cloudimg (qcow2, UEFI)
──► vm: create/run/console/exec ── CH or FC, COW disk, CNI/bridge NIC
──► snapshot: save/clone/restore/hibernate ── export/import across hosts
--windows path and the patched
CH/firmware forks it needs--fc trades for ~125ms
boots and <5 MiB overhead--queue-size, default 512); TSO/UFO/csum offload enabled by default--user/--password, multi-NIC Netplan v2 network-config); cidata is automatically skipped on subsequent boots--data-disk attaches additional virtio-blk disks per VM, with optional ext4 mkfs at create time, cloud-init mounts: auto-mount on cloudimg+CH (via /dev/disk/by-id/virtio-<name>), per-disk DirectIO override, and 1:1 inheritance through snapshot/clone/restore; vm clone --data-disk adds fresh disks to a clone and vm disk attach/detach hot-plugs existing raw files on a running VM (both CH only)cocoon vm console with bidirectional PTY relay, SSH-style escape sequences (~. disconnect, ~? help), configurable escape character, SIGWINCH propagationcocoon snapshot save captures a running VM’s full state (memory, disks, config); cocoon vm clone restores it as a new VM with fresh network and identity; all resources (CPU, memory, storage, NIC count) inherit verbatim from the snapshotcocoon snapshot export packages a snapshot into a portable .tar archive (.tar.gz with --gzip, sparse-aware pax headers); cocoon snapshot import restores it on another host or cluster; supports piping via stdout/stdin for direct host-to-host transfer; --to-dir writes a directory form (with snapshot.json envelope) for NFS / rsync-friendly handoffcocoon vm clone --from-dir DIR and cocoon vm restore --from-dir DIR consume any directory containing a snapshot.json envelope without first registering the snapshot in the local DB; the dir is treated as read-only so multi-VM golden-image use cases work without copyingcocoon vm status watches VM state changes in real time via fsnotify, with refresh mode (top-like) and event-stream mode (append-only, for scripting and vk-cocoon integration)create, run, start, stop, list, inspect, console, rm, debug, clone, status--log-level), log rotation (max size / age / backups)cocoon vm debug generates a copy-pasteable cloud-hypervisor command for manual debugging--fc flag selects Firecracker for OCI images: ~125ms boot, <5 MiB overhead, minimal attack surface (no UEFI, no qcow2, no Windows)Source and issue tracker: github.com/cocoonstack/cocoon. Related projects: sandbox (MicroVM sandboxes for AI agents built on cocoon), cocoon-agent (in-guest vsock agent), windows (Windows image build automation).