Skip to content

The micro-VM for AI agents — light enough to embed on your laptop, elastic enough to power an agentic cloud.

6.4 KB
Raw Blame

File formats

BoxLite keeps boxes, images, and its database under its home directory, ~/.boxlite by default.

Home directory

~/.boxlite/
├── boxes/                     # Per-Box runtime data
│   └── {box-id}/
│       ├── disks/             # disk.qcow2 (container disk), guest-rootfs.qcow2
│       ├── snapshots/         # Online and stopped snapshots by name
│       ├── .snapshot_pending  # Crash-recovery marker for stopped snapshot disk moves
│       ├── sockets/           # Unix sockets: control, guest ready, network
│       ├── shared/            # Files shared with the guest over virtio-fs
│       ├── mounts/            # Host side of shared/ (isolate_mounts, Linux)
│       ├── boot/              # Custom kernel and initramfs
│       ├── ca/                # CA for secret injection, kept from the guest
│       ├── logs/              # Shim logs and console.log (kernel, init)
│       ├── tmp/               # Shim temporary files
│       ├── shim.pid           # Shim process ID
│       ├── shim.stderr        # Shim stderr, for crash diagnostics
│       ├── exit               # Shim exit record: exit code and error details
│       └── exit.previous      # Exit record from the previous run
├── shims/                     # Shared shim cache for jailed boxes
│   └── {digest}/              # First 16 lowercase hex characters of SHA-256
│       ├── boxlite-shim       # Executable used by the jailer
│       ├── libkrunfw.*        # Bundled firmware loaded from beside the shim
│       └── .complete         # BoxLite version and build profile on separate lines
├── bases/                     # Immutable clone bases and guest rootfs cache
├── images/                    # OCI image cache
│   ├── layers/                # Layer blobs
│   ├── manifests/             # Image manifests
│   ├── configs/               # Image configs
│   ├── extracted/             # Extracted layers
│   ├── disk-images/           # Ext4 disk images that box disks overlay
│   └── local/                 # Caches for images loaded from local OCI bundles
├── volumes/                   # Named local volumes and legacy anonymous binds
│   ├── .registry.lock         # Local volume metadata/payload lock
│   ├── .staging/              # Unpublished volume creations (hidden from CRUD)
│   ├── .trash/                # Logically removed payload awaiting cleanup
│   ├── anonymous/             # Anonymous bind directories the CLI creates
│   └── {volume-id}/           # Canonical UUID directory
│       ├── .metadata.json     # id, name, and UTC creation time
│       └── _data/             # Payload exposed to boxes over virtio-fs
├── db/
│   └── boxlite.db             # SQLite: boxes, images, base disks, snapshots
├── locks/                     # Per-box lifecycle lock files
│   ├── <id>                   # Persisted box lock ID
│   └── disk/
│       └── <id>               # Disk operations, same ID in a separate namespace
├── logs/                      # Daily logs: boxlite.log.*, serve.log.*
├── tmp/                       # Temporary files for disk images being built
├── credentials.toml           # Credentials from boxlite auth login
└── .lock                      # Runtime lock file (prevents multiple instances)

Named volumes keep resource identity outside _data, so guest writes cannot alter their own id or creation metadata. Box configuration stores only the canonical volume id and mount declaration, not the resolved host path. The path is resolved again on each start. Temporary and deleted operation directories are cleaned during runtime initialization and are not returned as volumes. A physical cleanup failure is logged and retried at the next initialization; it neither restores a logically removed volume nor prevents the runtime from opening.

The jailer refreshes the completion stamp on each cache use. Runtime startup and new publications prune entries older than one hour for debug builds and seven days for release or unknown builds. Unfinished .staging.* directories expire after one hour. Jailed box startup attempts to remove any legacy boxes/{box-id}/bin/ directory.

The embedded runtime lives outside the home directory, in boxlite/runtimes/ under the platform's local data directory: ~/Library/Application Support on macOS, ~/.local/share on Linux.

QCOW2 disk images

BoxLite uses QCOW2 (QEMU Copy-On-Write version 2) for box disks.

Locations:

  • ~/.boxlite/boxes/{box-id}/disks/disk.qcow2: the container disk
  • ~/.boxlite/boxes/{box-id}/disks/guest-rootfs.qcow2: the guest root filesystem
  • ~/.boxlite/boxes/{box-id}/snapshots/{name}/disk.qcow2: the container disk snapshot for an online or stopped box. The snapshot table records its path and name.
  • ~/.boxlite/bases/{id}.qcow2: an immutable clone base, tracked in the base_disk table

Format: QCOW2, a copy-on-write image format with thin provisioning

Size: the container disk is never smaller than the image; disk_size_gb sets a larger size

Tools:

# Inspect a box's container disk
qemu-img info ~/.boxlite/boxes/{box-id}/disks/disk.qcow2

Raw ext4 images

A box's disks are copy-on-write overlays on read-only ext4 images:

  • ~/.boxlite/images/disk-images/*.ext4: an image's root filesystem, built once from its layers, behind container disks
  • ~/.boxlite/bases/{id}.ext4: the guest root filesystem cache, behind guest root filesystem disks, tracked in the base_disk table

Deleting these files while boxes exist breaks those boxes.

OCI image cache

BoxLite caches OCI images under ~/.boxlite/images/ at the layer level, so images that share layers store them once. Missing layers, manifests, and configs are downloaded again on the next pull.

SQLite database

BoxLite keeps box configuration and state (box_config, box_state), the image index (image_index), base disks (base_disk), and snapshots in one SQLite database. There are no per-box configuration files.

Location: ~/.boxlite/db/boxlite.db

Tools:

# List the tables
sqlite3 ~/.boxlite/db/boxlite.db ".tables"

Do not modify the database by hand: BoxLite owns its contents.