Container runtime environment

Incus attempts to present a consistent environment to all containers it runs.

The exact environment will differ slightly based on kernel features and user configuration, but otherwise, it is identical for all containers.

File system

Incus assumes that any image it uses to create a new container comes with at least the following root-level directories:

  • /dev (empty)

  • /proc (empty)

  • /sbin/init (executable)

  • /sys (empty)

Devices

Incus containers have a minimal and ephemeral /dev based on a tmpfs file system. Since this is a tmpfs and not a devtmpfs file system, device nodes appear only if manually created.

The following standard set of device nodes is set up automatically:

  • /dev/console

  • /dev/fd

  • /dev/full

  • /dev/log

  • /dev/null

  • /dev/ptmx

  • /dev/random

  • /dev/stdin

  • /dev/stderr

  • /dev/stdout

  • /dev/tty

  • /dev/urandom

  • /dev/zero

In addition to the standard set of devices, the following devices are also set up for convenience:

  • /dev/fuse

  • /dev/net/tun

  • /dev/mqueue

Network

Incus containers may have any number of network devices attached to them. The naming for those (unless overridden by the user) is ethX, where X is an incrementing number.

Container-to-host communication

Incus sets up a socket at /dev/incus/sock that the root user in the container can use to communicate with Incus on the host.

See Communication between instance and host for the API documentation.

Mounts

The following mounts are set up by default:

  • /proc (proc)

  • /sys (sysfs)

  • /sys/fs/cgroup/* (cgroupfs) (only on kernels that lack cgroup namespace support)

If they are present on the host, the following paths will also automatically be mounted:

  • /proc/sys/fs/binfmt_misc

  • /sys/firmware/efi/efivars