Skip to content

Run system containers and VMs with Incus on Ubuntu 24.04

This guide walks you through installing Incus on Ubuntu 24.04 and running a system container and a virtual machine side by side on one host, with storage, limits, profiles and snapshots in place. You will also publish a service from a container and migrate an existing LXD install across with lxd-to-incus.

This guide shows you how to run system containers and virtual machines on one Ubuntu 24.04 host with Incus, the container and virtual machine manager maintained by the Linux Containers project. A system container is a full Linux userland with its own init and its own package manager, sharing the host’s kernel, while a virtual machine boots a kernel of its own. Most teams run a separate tool for each of those, and if you are already on LXD, Canonical’s container manager, you are wondering how much of what you know survives a move. You can use one tool for both shapes, because Incus drives containers and virtual machines from a single daemon, a single incus command and a single API, and nearly all your lxc habits carry over. By the end you will have a container and a virtual machine running side by side, with storage, limits, profiles, snapshots and a service published to the outside world.

What you’ll accomplish

  • A working incusd daemon on Ubuntu 24.04, initialised with a ZFS (or dir) storage pool and a managed incusbr0 bridge.
  • One system container and one virtual machine running side by side from the images: remote, both reachable over the same bridge.
  • CPU, memory and disk limits applied per instance, and a profile that carries shared settings to every instance that needs them.
  • Manual and scheduled snapshots, with a restore you have actually tested.
  • A service inside a container reachable from outside the host, via a proxy device or a bridged NIC.
  • A tested path for migrating an existing LXD host to Incus without rebuilding instances.

Prerequisites

  • An Ubuntu 24.04 host with sudo, and enough disk to hold a storage pool — 30 GB free is a comfortable floor for a couple of instances.
  • For VMs: hardware virtualisation enabled — grep -c -E 'vmx|svm' /proc/cpuinfo should return more than 0. On a cloud instance that means nested virtualisation, which many providers do not offer on smaller shapes.
  • For a ZFS pool: sudo apt install -y zfsutils-linux. Back it with a whole spare block device (best), or let Incus create a sparse file under /var/lib/incus/disks (fine for a lab, easy to outgrow).
  • Honest note on packaging. Ubuntu 24.04 carries incus in universe — fine for most uses, but the archive moves slowly, so you get the version current at release plus security fixes. Debian 12 has it in backports. For current Incus, or feature releases rather than the LTS line, use the Zabbly repository maintained by the upstream project lead. Pick one source per host and do not mix them.
  • Incus and Docker on the same host is a known irritant: Docker sets the FORWARD chain policy to DROP, which silently kills traffic across the Incus bridge.

How it works

One daemon, incusd, owns everything: the instance database, the storage pools, the managed networks and the image cache. The incus CLI is a thin client that talks to it over a Unix socket at /var/lib/incus/unix.socket, or over HTTPS on port 8443 if you deliberately expose it. Access is entirely a question of which group can open that socket.

Architecture diagram of one Incus host showing the incus client talking to the incusd daemon, which manages a storage pool and the incusbr0 bridge, and runs a system container sharing the host kernel alongside a QEMU virtual machine with its own kernel, with a proxy device forwarding a host port into the container and a snapshot and profile panel on the right

The split between the two instance types is what to internalise. A container is namespaces and cgroups: it shares the host kernel, starts in about a second, and costs roughly the RAM its processes use. A VM is QEMU with UEFI firmware and virtio devices: it boots its own kernel, so you can load modules, run a different kernel version, or hand someone a machine they can genuinely break without touching yours. The price is a second kernel resident in memory and a slower start. Same incus launch, one extra --vm flag.

The images: remote is the second difference from LXD habits. Incus ships with images: pointed at the Linux Containers image server — Debian, Ubuntu, Alpine, Rocky, Arch and a long tail of others, in both container and VM builds. There is no Canonical-operated ubuntu: remote by default. Images come in variants: default is minimal, and cloud bakes in cloud-init, which is what you want when provisioning with user-data — see our cloud-init guide for VMs.

Storage is where the backend choice bites. On dir, a snapshot is a full directory copy and a launch is a full image unpack. On zfs or btrfs, both are copy-on-write: a snapshot costs only the blocks that later diverge, and launching the tenth container from a cached image is nearly free. Choose dir only for a throwaway host.

Step-by-step

  1. Install Incus. From the Ubuntu archive, this is one line.

    sudo apt update && sudo apt install -y incus
    incus --version

    Expected: a version number such as 6.0.5. If you want the current upstream build instead, use the Zabbly repository and re-run the install:

    sudo mkdir -p /etc/apt/keyrings
    sudo curl -fsSL https://pkgs.zabbly.com/key.asc -o /etc/apt/keyrings/zabbly.asc
    sudo sh -c 'cat > /etc/apt/sources.list.d/zabbly-incus-stable.sources <<EOF
    Enabled: yes
    Types: deb
    URIs: https://pkgs.zabbly.com/incus/stable
    Suites: $(. /etc/os-release && echo ${VERSION_CODENAME})
    Components: main
    Architectures: $(dpkg --print-architecture)
    Signed-By: /etc/apt/keyrings/zabbly.asc
    EOF'
    sudo apt update && sudo apt install -y incus

    Expected: apt reports the package coming from pkgs.zabbly.com. For VM support, also install the QEMU pieces — only recommended dependencies on some installs:

    sudo apt install -y qemu-system-x86 ovmf
  2. Give your user access to the socket. Incus has two groups: incus-admin for full control of the daemon, and incus for restricted access to your own project only. For a single-admin host, incus-admin is what you want.

    sudo adduser "$USER" incus-admin
    newgrp incus-admin
    incus info | head -5

    Expected: incus info prints server configuration rather than Error: Failed to connect to local daemon. If it still fails, log out and back in — newgrp only affects the current shell.

  3. Initialise the daemon. The interactive wizard creates the first storage pool and the managed bridge. Run it once.

    sudo incus admin init

    The answers that matter: choose zfs and let it create a new pool; give it a real block device if you have one (/dev/sdb), otherwise accept the loop file and set a size you can live with. Accept a new local bridge named incusbr0 with an automatic IPv4 subnet and NAT, and answer none for IPv6 unless you route it. Say no to exposing the server over the network unless you will manage it remotely today.

    For automation, skip the wizard entirely and feed it YAML:

    cat <<'EOF' | sudo incus admin init --preseed
    config: {}
    networks:
      - name: incusbr0
        type: bridge
        config:
          ipv4.address: 10.60.0.1/24
          ipv4.nat: "true"
          ipv6.address: none
    storage_pools:
      - name: default
        driver: zfs
        config:
          size: 40GiB
    profiles:
      - name: default
        devices:
          root:
            path: /
            pool: default
            type: disk
          eth0:
            name: eth0
            network: incusbr0
            type: nic
    EOF

    Expected: the command returns with no output. That is success.

  4. Confirm the pool and the bridge exist. Never trust the wizard without checking.

    incus storage list
    incus network list

    Expected: a default pool with driver zfs and state CREATED, and an incusbr0 network of type bridge with MANAGED set to YES. If MANAGED says NO, Incus is only observing a bridge someone else made and will not run DHCP on it.

  5. Launch a system container. Check which image types exist first, then launch.

    incus image list images:ubuntu/24.04
    incus launch images:ubuntu/24.04 web

    Expected: the image list shows rows with a TYPE column reading CONTAINER and VIRTUAL-MACHINE. The launch prints Creating web then Starting web, and returns in a few seconds after the first image download.

  6. Launch a virtual machine. Same verb, one flag. Use the cloud variant for VMs — it carries cloud-init and the Incus agent.

    incus launch images:ubuntu/24.04/cloud db --vm
    incus list

    Expected: incus list shows two rows, one CONTAINER and one VIRTUAL-MACHINE, both RUNNING, both with an address on your bridge subnet:

    +------+---------+----------------------+------+-----------------+-----------+
    | NAME |  STATE  |         IPV4         | IPV6 |      TYPE       | SNAPSHOTS |
    +------+---------+----------------------+------+-----------------+-----------+
    | db   | RUNNING | 10.60.0.183 (enp5s0) |      | VIRTUAL-MACHINE | 0         |
    +------+---------+----------------------+------+-----------------+-----------+
    | web  | RUNNING | 10.60.0.42 (eth0)    |      | CONTAINER       | 0         |
    +------+---------+----------------------+------+-----------------+-----------+

    The VM’s IP appears a beat later: it is reported by the agent inside the guest, which must finish booting first.

  7. Prove the kernel difference. This is the one-line demonstration of what you just built.

    incus exec web -- uname -r
    incus exec db -- uname -r
    uname -r

    Expected: web reports exactly the host’s kernel release. db reports a different one — its own.

  8. Apply resource limits. Containers take these live; VMs take memory changes live if the guest supports ballooning and CPU changes on next start.

    incus config set web limits.cpu 2
    incus config set web limits.memory 2GiB
    incus config device override web root size=20GiB
    incus config show web --expanded | grep -E 'limits|size'

    Expected: the three keys echo back. The override step is needed because root is inherited from the default profile: you cannot set an inherited device, you first make an instance-local copy. size on a root disk is enforced by the storage driver, so it does nothing on dir.

  9. Create a profile for the settings you will repeat. A profile is a named bundle of config keys and devices, applied to every instance that lists it. Instances can carry several; later profiles win.

    incus profile create web-tier
    incus profile set web-tier limits.memory 2GiB
    incus profile set web-tier boot.autostart true
    incus profile add web web-tier
    incus config show web --expanded | head -20

    Expected: incus profile list shows web-tier with USED BY 1, and the expanded config shows the inherited keys. Edit the profile later and every attached instance picks up the change on restart — this is how you avoid setting the same six keys on forty containers.

  10. Snapshot, then actually restore. Incus groups snapshot operations under their own subcommand.

    incus snapshot create web pre-upgrade
    incus snapshot list web
    incus exec web -- rm -rf /etc/nginx
    incus snapshot restore web pre-upgrade

    Expected: snapshot list shows pre-upgrade with a creation timestamp and an expiry of -. After the restore, incus exec web -- ls /etc/nginx succeeds again. On ZFS the restore is effectively instant; on dir it copies the whole rootfs.

    Automate it with two config keys, then stop thinking about it:

    incus config set web snapshots.schedule "0 3 * * *"
    incus config set web snapshots.expiry 7d
    incus config set web snapshots.pattern "auto-%d"

    Expected: nothing prints. A snapshot named auto-... appears after the next 03:00. Snapshots live in the same pool as the instance, so they protect you from mistakes, not from losing the disk. Ship real backups elsewhere with incus export.

  11. Expose a service. Install something inside the container, then choose how the outside world reaches it.

    incus exec web -- apt-get update
    incus exec web -- apt-get install -y nginx
    incus config device add web http proxy listen=tcp:0.0.0.0:8080 connect=tcp:127.0.0.1:80
    curl -sI http://localhost:8080 | head -1

    Expected: Device http added to web, then HTTP/1.1 200 OK. The proxy device runs a small forwarder on the host, so no manual NAT rules are involved and it survives instance restarts.

    When the instance should have its own address on the physical LAN instead, attach a bridged NIC to a host bridge you created yourself (with Netplan, for example) and drop the managed one:

    incus config device add web eth0 nic nictype=bridged parent=br0 name=eth0
    incus restart web
    incus list web

    Expected: web now shows an address from your LAN’s DHCP range rather than 10.60.0.x.

  12. Migrate an existing LXD host. If you are converting rather than starting fresh, lxd-to-incus moves the database, the config and the storage in place — instances are not rebuilt.

    Three-stage diagram showing an LXD install with the lxc CLI and lxdbr0 bridge, the lxd-to-incus tool stopping both daemons and copying database, config and storage paths, and the resulting Incus install with the incus CLI, incusbr0 and the incus-admin group, plus warnings that the migration is one-way and that clusters must be migrated together

    sudo apt install -y incus-tools
    sudo lxd-to-incus

    Expected: the tool prints a series of checks, lists what it found (LXD version, storage pools, instance count), asks for confirmation, then stops both daemons and migrates. Afterwards:

    incus list
    incus storage list

    Expected: every instance you had under LXD, same names and same data, now under incus; stopped instances stay stopped. Take a verified backup first — this rewrites pool metadata and there is no undo. Only once you are satisfied, remove the old install with sudo snap remove lxd. Our older LXD install walkthrough covers what the source side looked like.

Validate it works

Run the whole path in one go, from host to guest and back:

incus list
incus exec web -- systemctl is-system-running
incus exec db -- systemctl is-system-running

Expected: both RUNNING in the list, and running from both systemctl calls. degraded is common on a fresh minimal image and worth one incus exec web -- systemctl --failed to identify; it is rarely important.

Confirm the two instances can reach each other and the internet over the managed bridge:

incus exec web -- ping -c 2 10.60.0.183
incus exec web -- getent hosts deb.debian.org

Expected: two replies, and a resolved address. A ping that works while DNS fails points at the bridge’s dnsmasq being blocked by the host firewall rather than at anything inside the container.

Confirm the published service from off-host, replacing the address with your host’s:

curl -sI http://203.0.113.10:8080 | head -1

Expected: HTTP/1.1 200 OK. If it works on localhost but not from outside, the host firewall is the culprit, not Incus.

Finally, confirm the snapshot machinery is armed:

incus config get web snapshots.schedule
incus snapshot list web

Expected: your cron expression, and at least the pre-upgrade snapshot you took by hand.

Troubleshooting

  • Error: Failed to connect to local daemon right after install. Either your group membership has not taken effect — groups should list incus-admin, and a fresh login fixes it — or the service is not up. Check systemctl status incus.service and journalctl -u incus.service -n 50.
  • The container gets no IP address. Almost always the host firewall eating DHCP and DNS on the bridge. With ufw, allow both directions: sudo ufw allow in on incusbr0 and sudo ufw route allow in on incusbr0. With Docker installed, its FORWARD DROP policy blocks bridge traffic; add an accept rule for incusbr0 in the DOCKER-USER chain rather than flipping the policy globally.
  • The VM will not start. Read the exact error. Required tool 'qemu-system-x86_64' is missing means the QEMU packages are absent. vhost_vsock errors usually mean the module is not loaded (sudo modprobe vhost_vsock). On a cloud instance, KVM support is missing means nested virtualisation is off at the provider level and no host configuration will help. An image with no VM build fails at launch — check the TYPE column of incus image list first.
  • incus exec works on the container but not the VM. The VM path needs incus-agent running inside the guest, which is why the cloud image variant is the right default. On a plain or custom image, use incus console db to reach the serial console and install the agent from the mounted config drive.
  • A snapshot restore fails with a storage error. You are probably on dir, where restores are copies and can run out of space, or the instance is running and the driver wants it stopped. Stop it, restore, start. incus storage info default shows what is left in the pool; old snapshots are usually what filled it.
  • lxd-to-incus refuses to run. It names what is blocking it: LXD newer than the Incus build understands, an unsupported storage driver, or a cluster member that is unreachable. Fix the named condition rather than reaching for --ignore-version-check.

When this is the wrong approach

Incus is for machine-shaped workloads. If what you want is one process per container, built from a Dockerfile, distributed through a registry and started fresh on every deploy, you want an application container runtime — Docker or rootless Podman. Incus can run those nested inside a container with security.nesting=true, but that is nesting, not a replacement for the tooling.

If you are scheduling across a fleet, with declarative desired state, rolling updates and service discovery, you want Kubernetes. Incus clusters give you a shared API and live migration between members, but they do not reconcile a desired state: you place instances, and they stay where you put them.

If your workload is a handful of VMs and you never wanted containers, KVM with libvirt is more direct for that job, and Proxmox VE adds a web UI and integrated backup. Incus earns its place when you want both shapes under one API — dense system containers with a few genuine VMs mixed in for the workloads that need their own kernel.

If the host has no hardware virtualisation and never will, install Incus for containers and skip the VM sections; the container half works fine alone.

The authoritative references are the Incus documentation and the Zabbly package repository, which documents the repository layout and the stable-versus-daily channels.

If this is the kind of work you’d rather never own again, it’s the daily job of Managed Cloud Ops — book an infrastructure review.