Skip to content
This is the documentation for v0.3. Read the latest.
Files and environment

Files and environment

Where Dicer keeps things on the host and the client, and the environment variables it reads. Paths are the defaults; the daemon’s configuration moves the two directories with data_dir and run_dir.

The daemon’s host

Path
/usr/bin/dicerd, /usr/bin/dicerThe daemon and the command line, as the package installs them. install.sh puts them in /usr/local/bin.
/etc/dicerd/config.yamlThe daemon’s configuration. dicerd serve --config names another.
/usr/lib/systemd/system/dicerd.serviceThe service, as the package installs it. install.sh writes it to /etc/systemd/system.
/usr/lib/sysctl.d/60-dicer.confThe package’s setting turning IPv4 forwarding on. install.sh writes /etc/sysctl.d/99-dicer.conf.
/var/lib/dicerPersistent state, data_dir: kept across reboots.
/run/dicerRuntime state, run_dir: a tmpfs, which a reboot clears.
/run/dicer/dicer.sockThe API’s socket, root’s and the dicer group’s.

Everything under both directories belongs to root and is readable by root alone. Change it only through the API, which keeps it consistent.

/var/lib/dicer

/var/lib/dicer/
├── instances/<name>/
│   ├── config.yaml           the instance's definition
│   ├── overlay.img           its writable disk (sparse)
│   ├── serial.log            its console log: dicer logs
│   └── snapshots/<snapshot>/ its snapshots
├── networks/<name>.yaml      network definitions
├── allocations/<network>.yaml   which instance has which address
├── volumes/
│   ├── <name>.yaml           volume definitions
│   └── <id>/disk.raw         volume disks (sparse)
├── kernels/
│   ├── <name>.yaml           kernel definitions
│   └── <id>/vmlinux          kernels, once downloaded
├── images/<digest>/
│   ├── disk.img              the image as a read-only EROFS disk
│   └── metadata.json         its name, configuration and when it was used
├── oci-cache/                downloaded layers, shared between images
├── tmp/                      images being unpacked
├── initrd/<arch>/initrd      the guest initramfs, built from dicer-init and dicer-agent
├── bin/<hypervisor>/<version>/   the hypervisor binaries dicerd carries
└── events.jsonl              the events log: dicer events

Most of the space goes to instance disks, volumes and images. Disks are sparse, so ls -l shows their size, and du what they take.

/run/dicer

/run/dicer/
├── dicer.sock                the API
└── instances/<id>/           one per instance that is running, or was since boot
    ├── state.json            its state: pid, address, how it last ended
    ├── hypervisor.sock       the hypervisor's API
    ├── vsock.sock            the channel to the guest's agent
    ├── config.img            the disk dicer-init reads its configuration from
    ├── status.img            the disk the guest reports how it ended on
    └── logs/vmm.log          the hypervisor's log: dicer logs --source hypervisor

A reboot clears it, and every instance is then stopped. config.img holds the instance’s environment and the contents of its file mounts.

Inside a guest

Path
PID 1dicer-init, which runs from the initramfs, outside the guest’s root; ps shows it as /init.
/usr/local/bin/dicer-agentThe agent dicer exec, dicer cp and health checks go through.
/etc/systemd/system/dicer-agent.service, dicer-exit.serviceUnits added to a guest that boots systemd.
/dev/vda … /dev/vddThe image, the instance’s disk, and the configuration and status disks.
/dev/vde onwardsVolumes, in the order they are mounted.

The client

Path
~/.config/dicer/remotes.yamlRemotes, and which is current. The directory is $DICER_CONFIG_DIR if set, otherwise dicer in the user’s configuration directory.

Environment variables

Command line

Variable
DICER_REMOTEThe remote commands go to, a name or an address, unless --remote is given. See Remote access.
DICER_CONFIG_DIRWhere remotes are kept.
DICER_DEBUGSet to 1 or true to trace every call to the daemon on standard error, as --debug does.
NO_COLORSet to anything to turn colour off. Output that is not to a terminal never has any.

-e KEY, without a value, passes the shell’s value of KEY to a guest.

Daemon

Variable
PATHWhere mkfs.erofs, mkfs.ext4, mke2fs, iptables and any registry credential helpers are found.