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
incusddaemon on Ubuntu 24.04, initialised with a ZFS (ordir) storage pool and a managedincusbr0bridge. - 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/cpuinfoshould return more than0. 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
incusin 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
FORWARDchain policy toDROP, 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.
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
-
Install Incus. From the Ubuntu archive, this is one line.
sudo apt update && sudo apt install -y incus incus --versionExpected: 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 incusExpected:
aptreports the package coming frompkgs.zabbly.com. For VM support, also install the QEMU pieces — only recommended dependencies on some installs:sudo apt install -y qemu-system-x86 ovmf -
Give your user access to the socket. Incus has two groups:
incus-adminfor full control of the daemon, andincusfor restricted access to your own project only. For a single-admin host,incus-adminis what you want.sudo adduser "$USER" incus-admin newgrp incus-admin incus info | head -5Expected:
incus infoprints server configuration rather thanError: Failed to connect to local daemon. If it still fails, log out and back in —newgrponly affects the current shell. -
Initialise the daemon. The interactive wizard creates the first storage pool and the managed bridge. Run it once.
sudo incus admin initThe answers that matter: choose
zfsand 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 namedincusbr0with an automatic IPv4 subnet and NAT, and answernonefor 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 EOFExpected: the command returns with no output. That is success.
-
Confirm the pool and the bridge exist. Never trust the wizard without checking.
incus storage list incus network listExpected: a
defaultpool with driverzfsand stateCREATED, and anincusbr0network of typebridgewithMANAGEDset toYES. IfMANAGEDsaysNO, Incus is only observing a bridge someone else made and will not run DHCP on it. -
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 webExpected: the image list shows rows with a
TYPEcolumn readingCONTAINERandVIRTUAL-MACHINE. The launch printsCreating webthenStarting web, and returns in a few seconds after the first image download. -
Launch a virtual machine. Same verb, one flag. Use the
cloudvariant for VMs — it carries cloud-init and the Incus agent.incus launch images:ubuntu/24.04/cloud db --vm incus listExpected:
incus listshows two rows, oneCONTAINERand oneVIRTUAL-MACHINE, bothRUNNING, 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.
-
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 -rExpected:
webreports exactly the host’s kernel release.dbreports a different one — its own. -
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
overridestep is needed becauserootis inherited from thedefaultprofile: you cannotsetan inherited device, you first make an instance-local copy.sizeon a root disk is enforced by the storage driver, so it does nothing ondir. -
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 -20Expected:
incus profile listshowsweb-tierwithUSED 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. -
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-upgradeExpected:
snapshot listshowspre-upgradewith a creation timestamp and an expiry of-. After the restore,incus exec web -- ls /etc/nginxsucceeds again. On ZFS the restore is effectively instant; ondirit 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 withincus export. -
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 -1Expected:
Device http added to web, thenHTTP/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 webExpected:
webnow shows an address from your LAN’s DHCP range rather than10.60.0.x. -
Migrate an existing LXD host. If you are converting rather than starting fresh,
lxd-to-incusmoves the database, the config and the storage in place — instances are not rebuilt.sudo apt install -y incus-tools sudo lxd-to-incusExpected: 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 listExpected: 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 withsudo 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 daemonright after install. Either your group membership has not taken effect —groupsshould listincus-admin, and a fresh login fixes it — or the service is not up. Checksystemctl status incus.serviceandjournalctl -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 incusbr0andsudo ufw route allow in on incusbr0. With Docker installed, itsFORWARD DROPpolicy blocks bridge traffic; add an accept rule forincusbr0in theDOCKER-USERchain rather than flipping the policy globally. - The VM will not start. Read the exact error.
Required tool 'qemu-system-x86_64' is missingmeans the QEMU packages are absent.vhost_vsockerrors usually mean the module is not loaded (sudo modprobe vhost_vsock). On a cloud instance,KVM support is missingmeans nested virtualisation is off at the provider level and no host configuration will help. An image with no VM build fails at launch — check theTYPEcolumn ofincus image listfirst. incus execworks on the container but not the VM. The VM path needsincus-agentrunning inside the guest, which is why thecloudimage variant is the right default. On a plain or custom image, useincus console dbto 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 defaultshows what is left in the pool; old snapshots are usually what filled it. lxd-to-incusrefuses 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.