Home

Incus Commands Reference

Frequently used commands for managing containers and virtual machines

What is Incus?

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.

Nested Virtualization: VMs Inside VMs

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:

  • Testing hypervisor configurations: Develop and test virtualization setups without dedicated hardware
  • Multi-layer isolation: Create sophisticated sandbox environments with multiple levels of security boundaries
  • Cloud development: Build and test cloud-native infrastructure locally by simulating multi-node clusters within VMs
  • Training and education: Provide students with full virtualization stacks for learning without requiring bare metal access
  • CI/CD pipelines: Run automated tests that require VM capabilities inside ephemeral test environments

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.

Container Management

Launch a container
incus launch images:ubuntu/22.04 container-name
Launch with specific image
incus launch images:debian/12 debian-container
Start a container
incus start container-name
Stop a container
incus stop container-name
Restart a container
incus restart container-name
Delete a container
incus delete container-name --force
Execute command in container
incus exec container-name -- command
Open shell in container
incus exec container-name -- bash
List all containers
incus list
Show container info
incus info container-name

Virtual Machine Management

Launch a VM
incus launch images:ubuntu/22.04 vm-name --vm
Start a VM
incus start vm-name
Stop a VM
incus stop vm-name
Access VM console
incus console vm-name
Launch VM with custom resources
incus launch images:ubuntu/22.04 vm-name --vm -c limits.cpu=4 -c limits.memory=4GB

File Operations

Copy file to container
incus file push /local/file container-name/path/to/destination
Copy file from container
incus file pull container-name/path/to/file /local/destination
Edit file in container
incus file edit container-name/path/to/file

Snapshots & Backups

Create snapshot
incus snapshot container-name snapshot-name
List snapshots
incus info container-name
Restore snapshot
incus restore container-name snapshot-name
Delete snapshot
incus delete container-name/snapshot-name
Export container
incus export container-name /path/to/backup.tar.gz
Import container
incus import /path/to/backup.tar.gz

Networking

List networks
incus network list
Show network details
incus network show incusbr0
Create network
incus network create mynetwork
Attach container to network
incus network attach mynetwork container-name eth0
Set static IP
incus config device set container-name eth0 ipv4.address=10.0.0.100

Configuration

Show container config
incus config show container-name
Set CPU limit
incus config set container-name limits.cpu=2
Set memory limit
incus config set container-name limits.memory=2GB
Set autostart
incus config set container-name boot.autostart=true
Edit full config
incus config edit container-name

Storage

List storage pools
incus storage list
Create storage pool
incus storage create pool-name dir source=/path/to/storage
Create storage volume
incus storage volume create pool-name volume-name
Attach volume to container
incus storage volume attach pool-name volume-name container-name /mount/path

Images

List available images
incus image list images:
Search for images
incus image list images: ubuntu
List local images
incus image list
Copy image locally
incus image copy images:ubuntu/22.04 local: --alias ubuntu22
Delete local image
incus image delete image-fingerprint

Profiles

List profiles
incus profile list
Show profile
incus profile show default
Create profile
incus profile create myprofile
Apply profile to container
incus profile add container-name myprofile
Edit profile
incus profile edit myprofile
Note: Replace 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.