Frequently used commands for managing containers and virtual machines
Incus is a modern, powerful system container and virtual machine manager that enables you to run full Linux systems in isolated environments. As a community-driven fork of LXD, Incus provides a unified experience for managing both lightweight system containers and full virtual machines on a single host.
Whether you're building a private cloud infrastructure, creating isolated development environments, or spinning up quick debugging machines, Incus delivers enterprise-grade virtualization with remarkable simplicity. It's perfect for running production workloads, testing applications in clean environments, or experimenting with different operating systems without the overhead of traditional virtualization.
One of Incus's most powerful features is its support for nested virtualization. This allows you to run virtual machines inside other virtual machines, opening up possibilities that were previously complex or impossible:
With nested virtualization, you can launch an Incus VM, install Incus inside it, and create additional containers or VMs within that nested environment—all with native performance characteristics.
Common Use Cases:
Incus combines the lightweight efficiency of containers with the strong isolation of virtual machines, giving you the flexibility to choose the right tool for each workload. Below you'll find a comprehensive reference of the most frequently used Incus commands to help you get started.
incus launch images:ubuntu/22.04 container-name
incus launch images:debian/12 debian-container
incus start container-name
incus stop container-name
incus restart container-name
incus delete container-name --force
incus exec container-name -- command
incus exec container-name -- bash
incus list
incus info container-name
incus launch images:ubuntu/22.04 vm-name --vm
incus start vm-name
incus stop vm-name
incus console vm-name
incus launch images:ubuntu/22.04 vm-name --vm -c limits.cpu=4 -c limits.memory=4GB
incus file push /local/file container-name/path/to/destination
incus file pull container-name/path/to/file /local/destination
incus file edit container-name/path/to/file
incus snapshot container-name snapshot-name
incus info container-name
incus restore container-name snapshot-name
incus delete container-name/snapshot-name
incus export container-name /path/to/backup.tar.gz
incus import /path/to/backup.tar.gz
incus network list
incus network show incusbr0
incus network create mynetwork
incus network attach mynetwork container-name eth0
incus config device set container-name eth0 ipv4.address=10.0.0.100
incus config show container-name
incus config set container-name limits.cpu=2
incus config set container-name limits.memory=2GB
incus config set container-name boot.autostart=true
incus config edit container-name
incus storage list
incus storage create pool-name dir source=/path/to/storage
incus storage volume create pool-name volume-name
incus storage volume attach pool-name volume-name container-name /mount/path
incus image list images:
incus image list images: ubuntu
incus image list
incus image copy images:ubuntu/22.04 local: --alias ubuntu22
incus image delete image-fingerprint
incus profile list
incus profile show default
incus profile create myprofile
incus profile add container-name myprofile
incus profile edit myprofile
container-name, vm-name, and other placeholders with your actual instance names. Use incus --help or incus command --help for more detailed information about any command.