Architecture


High-Level Shape

Jerboa is a client/daemon system:

On Linux, the default transport is a Unix socket. On Windows, the client boots and dials a daemon running inside a dedicated WSL2 distro.

Main Components

CLI

Path: cmd/jerboa/

Responsibilities:

Daemon

Path: cmd/jerboad/

Responsibilities:

VM Layer

Path: internal/vm/

Backends:

QEMU enables KVM automatically when /dev/kvm is accessible, and otherwise falls back to TCG emulation with a warning. Firecracker requires KVM.

Capabilities:

Image Layer

Path: internal/image/

The daemon stores images by digest under ~/.jerboa/images/ and keeps name/tag references separately.

The build path:

  1. client prepares build context
  2. client streams it to daemon
  3. daemon resolves mkfs
  4. daemon writes the image into its own store

Each newly built image includes a 4 MiB embedded boot filesystem partition for the kernel, reducing new image size versus the older 12 MiB layout. Existing images keep the layout they were built with.

Networking

Paths:

Current model:

Important constraints:

Desktop Agent

Paths:

A loopback HTTP/SSE facade over the daemon’s JSON-RPC API, used as the backend sidecar by the Jerboa Desktop app. Every request requires a bearer token (JERBOA_AGENT_TOKEN); REST endpoints cover VMs, images, networks, DNS, nodes, and daemon lifecycle (start/stop/ensure via WSL on Windows), and SSE endpoints stream the serial console and a VM/daemon event feed. It holds no state of its own — it dials the same daemon endpoint and rendezvous file as the CLI.

Compose

Path: internal/compose/

The compose package only parses and orders stack definitions. The CLI command layer drives the actual orchestration through the daemon and client-side volume store.

Windows Support

Paths:

Windows support is not a native daemon port. Instead:

Config Resolution

Path: internal/config/

Supported config schema:

hypervisor = "qemu"

[daemon]
endpoint = "unix:///var/run/jerboad.sock"
distro = "jerboa"
jerboad_path = "/usr/local/bin/jerboad"
token = "..."

The jerboa config subcommand currently edits only hypervisor, but the code reads the full schema.

Guest Injection Paths

Environment variables and static network configuration are injected through fw_cfg using:

Recent code and docs use the opt/uni/* keys; older opt/jerboa/* names are stale.

Persistence

Client-owned local state:

Daemon-owned state:

VM persistence backends:

Volumes are raw TFS disk images created (sparse) on the client and labeled by the daemon. They are formatted lazily on first attach, or pre-populated up front with jerboa volume seed: the client streams a package subtree to the daemon, which builds a children-only Nanos manifest and runs mkfs to write the files into the volume’s filesystem. This lets a volume carry initialized data (e.g. a database cluster that cannot be initialized inside the single-process unikernel) before it is ever mounted.

Tests And CI

The repo currently contains:

CI also builds release binaries, a WSL distro rootfs artifact, and benchmark jobs for QEMU and Firecracker boot paths.