当前位置: 首页 > news >正文

incus抄作业

How to install incus server on Debian 12/11

Patreon subscribers can download the PDF version here and support independent content creators.
See all FFmpeg command releated tutorials
Incus is a free and open-source project for the next-gen container management platform. It is a fork of LXD (the container hypervisor). It can manage both Linux containers and virtual machines. Let us see how to install the stable version of the Incus server on Debian 11 or 12 and deploy both containers and VMs for fun and profit.
Tutorial details
Difficulty level Intermediate
Root privileges Yes
Requirements Linux terminal
Category Incus
OS compatibility Debian Linux
Est. reading time 12 minutes

Installing incus server on Debian 12/11

Please note that you can install an Incus server using various methods. The upcoming Debian version 13.x will have a native package. The same can be installed using a backported package on a Debian 12. However, I found the Zabbly package repository stable and easier to get an up-to-date stable version.

Step 1 – Downloading zabbly keys

Type the following to download file using the curl command:
# curl -fsSL https://pkgs.zabbly.com/key.asc -o /etc/apt/keyrings/zabbly.asc

Step 2 – Configure zabbly repository

Type the following shell kung fu to make a new /etc/apt/sources.list.d/zabbly-incus-stable.sources file using EOF feature of bash/sh to match Debian 11 or 12 version automatically using the /etc/os-release file:
# bash -c 'cat <<EOF > /etc/apt/sources.list.d/zabbly-incus-stable.sources
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'

Verify it using the “bat,” “cat,” “less,” or “more“:
# cat /etc/apt/sources.list.d/zabbly-incus-stable.sources

Step 3 – Install an incus server

Update Debian repo and install it:
# apt update
# apt install incus btrfs-progs

Depending on your available Debian computer resources and Internet connection speed, downloading and installing Incus packages will take some time. So please be patient:

Installing an incus server on a Debian Linux 12 or 11

Click to enlarge

Step 4 – Adding management user to the incus-admin group

A regular user account can manage the Incus server using a particular group named ‘incus-admin.’ Hence, verify that the incus-admin group exists in the /etc/group file using the grep command:
# grep '^incus-admin' /etc/group
Outputs:
incus-admin:x:996:

If the ‘incus-admin’ group is missing on your Debian server, create it using the commandgroupadd incus-admin
Let us add an existing user named 'vivek' to the group called 'incus-admin' who you trust with access to manage your server:
# usermod -a -G incus-admin vivek
The -a option will append the user to the supplemental GROUPS mentioned by the -G option without removing the existing group membership. Otherwise, without the -a option, the user ‘vivek’ will be added to the ‘incus-admin’ group but removed from all other secondary groups. You don’t want that. Next, verify group membership on Linux using the id command and group command:
# id vivek
# groups vivek
Outputs:
vivek : vivek cdrom floppy audio dip video plugdev netdev incus-admin

Now, the user ‘vivek’ is ready to manage the incus server without needing root access all the time.

Step 5 – Configuring the newly installed Incus server

You need to specify networking, storage, and other options. You can do this both automatically with pre-seed config file and interactively. Let us do it interactively. Type:
# incus admin init
Most of the questions are self-explanatory. I accepted most defaults except for disk size and disabled IPv6 because I don’t need it for my testing purposes. But if you have dual stack IPv4+IPv6 (or IPv6-only cloud VMs), enable that option, too:

incus admin init demo

The `incus admin init` demo (click to enlarge)

Adding ufw rules for the bridge

I’m using ufw on my Debian 12, and I have configured incusbr0 as my bridge. If UFW is set to drop all unknown traffic, it will prevent traffic from going to and from the LXD bridge. To resolve this issue, you need to create rules that allow traffic to pass through the bridge and traffic that is forwarded to it. The syntax is:
$ sudo ufw allow in on incusbr0 comment 'incusbr0 for Incus'
$ sudo ufw route allow in on incusbr0 comment 'incusbr0 for Incus'
$ sudo ufw route allow out on incusbr0 comment 'incusbr0 for Incus'

Without these ufw rules, your containers will not get IP addresses from the Incus DHCP server, and there won’t be any networking. All of your containers will get errors such as:

Temporary failure resolving names

Step 6 – Installing web UI to manage the Incus server

This is an optional package, but the Incus server allows you to run containers and virtual machines locally. It also offers very flexible networking and storage akin to what’s offered in a public cloud environment. You can manage everything from the CLI or an optional package that contains a web interface. To install it, type:
# apt install incus-ui-canonical
Outputs:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:incus-ui-canonical
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 2,918 kB of archives.
After this operation, 17.7 MB of additional disk space will be used.
Get:1 https://pkgs.zabbly.com/incus/stable bookworm/main amd64 incus-ui-canonical amd64 1:6.3-202407171614-debian12 [2,918 kB]
Fetched 2,918 kB in 8s (372 kB/s)                                                                                                                                                                                                                                                        
Selecting previously unselected package incus-ui-canonical.
(Reading database ... 46504 files and directories currently installed.)
Preparing to unpack .../incus-ui-canonical_1%3a6.3-202407171614-debian12_amd64.deb ...
Unpacking incus-ui-canonical (1:6.3-202407171614-debian12) ...
Setting up incus-ui-canonical (1:6.3-202407171614-debian12) ...

Set HTTPS address and port for the web UI. The syntax is
# incus config set core.https_address :{PORT}
# incus config set core.https_address :8443
# OR #
# incus config set core.https_address {SERVER_IP}:{PORT}
# incus config set core.https_address 192.168.2.20:8443

You can list and check for open ports as follows:
# ss -tulpn | grep 8443
# lsof -i :8443

Outputs indicating that incusd listing on the 8443 port:

tcp   LISTEN 0      4096                  *:8443            *:*    users:(("incusd",pid=12700,fd=8))

You must open the tcp/8443 port using the ufw command or iptables command:
# open port 8443 for CIDR 192.168.2.0/24 #
# ufw allow from 192.168.2.0/24 to any port 8443 comment 'Open the Incus 8443 port for VLAN'

Verify and list ufw rules as follows:
# ufw status
# OR #
# iptables -S
# iptables -S | grep 8443

How to access the web UI

First, find out your Linux server's IP address. Use the ip command as follows:
# ip addr show
# If interface name is 'bro', then: #
# ip addr show br0

The following outputs shows that br0 has 192.168.2.19 IP address:

4: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000link/ether 3a:09:bb:37:8c:2c brd ff:ff:ff:ff:ff:ffinet 192.168.2.19/24 brd 192.168.2.255 scope global br0valid_lft forever preferred_lft foreverinet6 fe80::3809:bbff:fe37:8c2c/64 scope link valid_lft forever preferred_lft forever

Open the web browser and type URL:

https://{server_ip_here}:8443/
https://192.168.2.19:8443/

You will see something as follows:
web UI - image 1
To create a new certificate, click on the green “Generate” button. Next, download the incus-ui.crt and add it to the Incus trust store. Copy that file to the server:
{vivek@desktop}$ scp ~/Download/incus-ui.crt server-IP-here:
{vivek@desktop}$ scp ~/Download/incus-ui.crt 192.168.2.19:

On your server type:
# incus config trust add-certificate /path/to/incus-ui.crt
Download the incus-ui.pfx file for your browser and import it in Firefox or Chrome browser and Import it:
web UI - image 2
Restart the browser and type the URL:

https://192.168.2.19:8443/
web UI - image 3 - welcome

web UI – Click to enlarge

You can make new containers and do other management tasks easily with a web-based GUI.

 

Managing the Incus server from the CLI

Incus uses images. For example, each Linux container or VM instance is based on an image containing a basic operating system. A Linux distribution and some Incus-related information is stored in each image. Images are available from remote image stores, but you can also create your own images based on existing instances or a rootfs image. Here is how to list default image store:
$ incus remote list
The following outputs shows that the default image store is set to https://images.linuxcontainers.org:

If this is your first time running Incus on this machine, you should also run: incus admin init
To start your first container, try: incus launch images:ubuntu/22.04
Or for a virtual machine: incus launch images:ubuntu/22.04 --vm
 
+-----------------+------------------------------------+---------------+-------------+--------+--------+--------+
|      NAME       |                URL                 |   PROTOCOL    |  AUTH TYPE  | PUBLIC | STATIC | GLOBAL |
+-----------------+------------------------------------+---------------+-------------+--------+--------+--------+
| images          | https://images.linuxcontainers.org | simplestreams | none        | YES    | NO     | NO     |
+-----------------+------------------------------------+---------------+-------------+--------+--------+--------+
| local (current) | unix://                            | incus         | file access | NO     | YES    | NO     |
+-----------------+------------------------------------+---------------+-------------+--------+--------+--------+

To get a list of all remote images on a server, type:
$ incus image list {remote_name}:
$ incus image list images:
# See images for 'Ubuntu version 24.04'
$ incus image list images: 24.04
# See images for 'Alpine Linux'
$ incus image list images: alpine
# Filter by architecture (x86_64 or arm64), or type (container or virtual-machine) #
$ incus image list images: 24.04 architecture=x86_64
$ incus image list images: alpine architecture=arm64
$ incus image list images: 'alpine/3.20' architecture=arm64
$ incus image list images: 'alpine/3.20' architecture=arm64 type=container
$ incus image list images: 'alpine/3.20' architecture=arm64 type=virtual-machine

Outputs:

+----------------------------+--------------+--------+------------------------------------+--------------+-----------------+-----------+----------------------+
|           ALIAS            | FINGERPRINT  | PUBLIC |            DESCRIPTION             | ARCHITECTURE |      TYPE       |   SIZE    |     UPLOAD DATE      |
+----------------------------+--------------+--------+------------------------------------+--------------+-----------------+-----------+----------------------+
| alpine/3.20/arm64 (1 more) | 5b9713170e0a | yes    | Alpine 3.20 arm64 (20240722_13:00) | aarch64      | VIRTUAL-MACHINE | 115.36MiB | 2024/07/21 20:00 EDT |
+----------------------------+--------------+--------+------------------------------------+--------------+-----------------+-----------+----------------------+
| alpine/3.20/arm64 (1 more) | def7138fe299 | yes    | Alpine 3.20 arm64 (20240722_13:00) | aarch64      | CONTAINER       | 3.36MiB   | 2024/07/21 20:00 EDT |
+----------------------------+--------------+--------+------------------------------------+--------------+-----------------+-----------+----------------------+
| alpine/3.20/cloud/arm64    | 7a62cfb5f918 | yes    | Alpine 3.20 arm64 (20240722_13:00) | aarch64      | CONTAINER       | 20.31MiB  | 2024/07/21 20:00 EDT |
+----------------------------+--------------+--------+------------------------------------+--------------+-----------------+-----------+----------------------+
| alpine/3.20/cloud/arm64    | b479ea3a659d | yes    | Alpine 3.20 arm64 (20240722_13:00) | aarch64      | VIRTUAL-MACHINE | 139.26MiB | 2024/07/21 20:00 EDT |
+----------------------------+--------------+--------+------------------------------------+--------------+-----------------+-----------+----------------------+

Linux Containers vs. Virtual Machines (VMs) instance

In the Incus server including LXD, instances can be containers or virtual machines created from images. The main difference between Linux containers and virtual machines lies in their level of abstraction and resource utilization.

  • Linux Containers: Containers virtualize at the operating system level using various Linux kernel features. They share the host system’s kernel version but provide isolated environments for your applications. In other words, this makes containers much lighter and faster to start, as they don’t need to boot up an entire operating system. However, in some cases, isolation is less strong than with VMs, or certain hardware drivers or complex firewall rules can not be loaded inside containers. Typically, all web applications can run as Linux containers, including those that require access to certain drivers such as Nvidia for GPU-based applications. You can also easily install and use Linux containers on any virtual machine, such as those provided by AWS and other public cloud service providers. All containers are faster to start.
  • Virtual Machines (VMs): VMs virtualize an entire computer system, including the hardware, kernel, and operating system. Each VM runs independently and has its own dedicated resources. VMs do not share Linux kernel or firewall rules. This provides strong isolation, but it also incurs overhead due to the need to run multiple operating systems. In most cases, you can not run VMs on any public cloud service providers unless they turn on nested VM support for host operating systems. VMs are slower to start as they boot into OS and then load your applications.

Is Incus Docker?

No, Incus is not Docker. While both Incus and Docker are technologies used for containerization using Linux kernel features, they differ in their approach and purpose. Docker is an application-level container. It typically starts and runs a single application such as Apache or MySQL server. Docker can not create VMs. Incus, on the other hand, is primarily focused on system containers, providing a complete environment similar to a virtual machine. It can create both VMs and containers. You can actually run Docker containers within an Incus system container, but not vice versa. This is why it is helpful for building or troubleshooting environments using the Incus. Here is an image showing the primary differences between the VMs, application containers, and system containers.

Incus containers and VMs differnce

Click to enlarge

Creating your first Linux container instance from Debian image

The syntax is:
$ incus launch images:{distro_name}/{version} {container_name}
Here is how to create and start a container with configuration from config_file.yaml file:
$ incus launch images:{distro_name}/{version} {container_name} < config_file.yaml
You can create and start a container using the same size as an AWS t2.micro (1 vCPU, 1GiB of RAM) as follows to simulate your EC2 infrastructure on a local development machine:
$ incus launch images:{distro_name}/{version} {container_name} -t aws:t2.micro
Here is how to create and start a container based upon Alpine Linux version 3.20 image and name it as ‘alpine-c1’:
$ incus launch images:alpine/3.20 alpine-c1
Outputs:
Launching alpine-c1

Listing instances

The syntax is:
$ incus list
Outputs:

+-----------+---------+---------------------+------+-----------+-----------+
|   NAME    |  STATE  |        IPV4         | IPV6 |   TYPE    | SNAPSHOTS |
+-----------+---------+---------------------+------+-----------+-----------+
| alpine-c1 | RUNNING | 10.76.43.206 (eth0) |      | CONTAINER | 0         |
+-----------+---------+---------------------+------+-----------+-----------+

Running commands in instances

Do you need to run a single command such as the apk command to upgrade the instance? Or may we gain shell access? Try:
$ incus exec {name_here} -- command1
$ incus exec alpine-c1 -- sh
$ incus exec debian12-nginx -- bash

Now you can type commands as per your Linux distros. For example:
# apk update
# apk upgrade

Type ‘exit’ to exit from the instance:
Execute commands in instances or gain shell access

Attaching to instance consoles for management

Once instances created you can attach to its console for management purposes as follows:
$ incus console {name_here}
$ incus console alpine-c1

You must know username and password to login and to detach (exit) from the console, press: [ctrl]+a q.

Starting/stopping/restarting Linux containers command

Pass the {start|stop|restart} option as follows:
$ incus start {container-name}
$ incus start oracle-9
$ incus stop {container-name}
$ incus stop alpine-c1
$ incus restart {container-name}
$ incus restart gentoo

Deleting Incus containers

The command is as follows. Be careful as the Incus containers are deleted immediately without any confirmation prompt. In other words, always keep backups of your data:
$ incus delete {container-name}
$ incus delete ubuntu-www-1

You may get the following error while deleting the container:

The container is currently running, stop it first or pass –force.

To fix this:
$ incus stop ubuntu-c1 && incus delete ubuntu-c1
OR
$ incus delete alpine-u1 --force

Getting information on Incus servers and containers

Type the following command:
$ incus info
$ incus info info {container-name}
$ incus info info opensuse-c2

Pulling a file from the container

$ incus file pull {continer-nane}/{path/to/file} {/path/to/local/dest}
$ incus file pull debian-12/var/www/nginx/app/config.php .

Pushing a file to the container

$ incus file push {/path/to/file} {continer-nane}/path/to/dest/dir/
$ incus file push config.php debian-12/var/www/nginx/app/

Forwarding incoming connections to the incus Linux container

First install the nginx server inside the alpine-c1:
$ incus exec alpine-c1 -- sh
# apk update && apk upgrade && apk add nginx
# rc-update add nginx
# service nginx start
# service nginx status
### update/create the default html file for test purpose
# cat /var/www/localhost/htdocs/index.html

Sample file:

<!DOCTYPE html>
<html>
<head><title>Welcome to nginx running on Incus Container!</title>
</head>
<body>
<h1>Welcome to nginx running on Incus VM!</h1>
<p>This is a test page created by Vivek Gite and running on Alpine Linux!
</p>
</body>
</html>

Edit the /etc/nginx/http.d/default.conf as follows:

server {listen 80 default_server;listen [::]:80 default_server;location / {root /var/www/localhost/htdocs; # Directory containing your HTML filetry_files $uri $uri/index.html; # Look for the file, or index.html if it's a directory}location = /404.html {internal;}
}
Restart the nginx service:
# nginx -s reload
Finally logout from the incus instance:
# logout
Find alpine-c1 IP address:
$ incus list alpine-c1
Sample outputs:

 

+-----------+---------+---------------------+------+-----------+-----------+
|   NAME    |  STATE  |        IPV4         | IPV6 |   TYPE    | SNAPSHOTS |
+-----------+---------+---------------------+------+-----------+-----------+
| alpine-c1 | RUNNING | 10.76.43.206 (eth0) |      | CONTAINER | 0         |
+-----------+---------+---------------------+------+-----------+-----------+

You need to redirect/forward all incoming traffic on port 80 to Alpine Linux’s public IP address say 172.66.43.74 to Incus private IP address 10.76.43.206 using the iptable command or ufw command or use the incus proxy protocol. The syntax for lxd proxy protocol is:

incus config device add {container-name} {device_name_here} proxy listen=tcp:${src_IP}:${src_port} connect=tcp:${dest_ip}:${dest_port}

In this example redirect http/80 (Nginx) traffic to container named alpine-c1’s IP address:

incus config device add alpine-c1 www-reditect proxy listen=tcp:192.168.2.19:80 connect=tcp:10.76.43.206:80
## OR ##
incus config device add alpine-c1 www-reditect proxy listen=tcp:172.66.43.74:80 connect=tcp:10.76.43.206:80
## Verify it ##
incus config device list alpine-c1
incus config device show alpine-c1

Outputs:

www-reditect:connect: tcp:10.76.43.206:80listen: tcp:192.168.2.19:80type: proxy

Let us break down the incus config device add alpine-c1 www-reditect proxy listen=tcp:192.168.2.19:80 connect=tcp:10.76.43.206:80 command

  • incus config device add – Add a new device.
  • alpine-c1 – LXD container or instance vm name.
  • www-reditect – Unique name per LXD container or instance name.
  • proxy – The device type. Proxy devices allow forwarding network connections between host and instance.
  • listen=tcp:172.66.43.74:80 – Public or private IPv4/IPv6 and port to listen on (host’s IP:PORT)
  • connect=tcp:10.76.43.206:80 – Forward traffic to this Incus instance’s IP:PORT

Test it. Fire the web browser and type the url:

http://172.66.43.74
Nginx in proxy mode with Incus

Running Linux Desktop VMs

If you run Incus on a dedicated Debian Linux 11/12 server or desktop/laptop, running a Linux desktop VM (Virtual Machine) for isolated workloads is possible. For example, one can run work-related Firefox/Chrome browser on Ubuntu v24.04 desktop and OpenSUSE v15.5 KDE desktop for personal stuff isolated from your primary Debian 12 host for security and privacy reasons. Here is how to list desktop VM images:
$ incus image list images: architecture=amd64 type=virtual-machine
$ incus image list images: desktop architecture=amd64 type=virtual-machine

+------------------------------------------+--------------+--------+--------------------------------------------+--------------+-----------------+------------+----------------------+
|                  ALIAS                   | FINGERPRINT  | PUBLIC |                DESCRIPTION                 | ARCHITECTURE |      TYPE       |    SIZE    |     UPLOAD DATE      |
+------------------------------------------+--------------+--------+--------------------------------------------+--------------+-----------------+------------+----------------------+
| archlinux/desktop-gnome (3 more)         | 429cee13c544 | yes    | Archlinux current amd64 (20240723_04:18)   | x86_64       | VIRTUAL-MACHINE | 1300.22MiB | 2024/07/22 20:00 EDT |
+------------------------------------------+--------------+--------+--------------------------------------------+--------------+-----------------+------------+----------------------+
| opensuse/15.5/desktop-kde (1 more)       | 25e8870ac46e | yes    | Opensuse 15.5 amd64 (20240723_04:20)       | x86_64       | VIRTUAL-MACHINE | 857.05MiB  | 2024/07/22 20:00 EDT |
+------------------------------------------+--------------+--------+--------------------------------------------+--------------+-----------------+------------+----------------------+
| opensuse/15.6/desktop-kde (1 more)       | 875ac42d799f | yes    | Opensuse 15.6 amd64 (20240723_04:20)       | x86_64       | VIRTUAL-MACHINE | 796.49MiB  | 2024/07/22 20:00 EDT |
+------------------------------------------+--------------+--------+--------------------------------------------+--------------+-----------------+------------+----------------------+
| opensuse/tumbleweed/desktop-kde (1 more) | 5b24e05aa58f | yes    | Opensuse tumbleweed amd64 (20240723_04:20) | x86_64       | VIRTUAL-MACHINE | 871.03MiB  | 2024/07/22 20:00 EDT |
+------------------------------------------+--------------+--------+--------------------------------------------+--------------+-----------------+------------+----------------------+
| ubuntu/23.10/desktop (3 more)            | d8bcab434b91 | yes    | Ubuntu mantic amd64 (20240722_07:42)       | x86_64       | VIRTUAL-MACHINE | 1086.40MiB | 2024/07/21 20:00 EDT |
+------------------------------------------+--------------+--------+--------------------------------------------+--------------+-----------------+------------+----------------------+
| ubuntu/focal/desktop (3 more)            | 3b369d2348f2 | yes    | Ubuntu focal amd64 (20240722_07:42)        | x86_64       | VIRTUAL-MACHINE | 987.02MiB  | 2024/07/21 20:00 EDT |
+------------------------------------------+--------------+--------+--------------------------------------------+--------------+-----------------+------------+----------------------+
| ubuntu/jammy/desktop (3 more)            | 4e4c11a4d0e8 | yes    | Ubuntu jammy amd64 (20240722_07:42)        | x86_64       | VIRTUAL-MACHINE | 975.12MiB  | 2024/07/21 20:00 EDT |
+------------------------------------------+--------------+--------+--------------------------------------------+--------------+-----------------+------------+----------------------+
| ubuntu/noble/desktop (3 more)            | d5c5f8e3e465 | yes    | Ubuntu noble amd64 (20240722_07:42)        | x86_64       | VIRTUAL-MACHINE | 1094.77MiB | 2024/07/21 20:00 EDT |
+------------------------------------------+--------------+--------+--------------------------------------------+--------------+-----------------+------------+----------------------+

Make sure remote-viewer installed to see desktop console on Debian 11/12 desktop using the apt command/apt-get command $ sudo apt install virt-viewer
Here is how launce Arch Linux GNOME desktop using Incus with 4 vCPU and 8GiB RAM:
$ incus launch images:archlinux/desktop-gnome arch-desktop \
--vm \
-c security.secureboot=false \
-c limits.cpu=4 \
-c limits.memory=8GiB \
--console=vga

Please note that these desktop VM images are bigger in download size. Therefore, it will take some time to download and install them. However, once installed, you should see a remote viewer window with your desktop VM. How cool is that? There are no passwords or anything. You need to lock down these VM desktops, configure them further with passwords and a firewall, and install apps such as Firefox, like an actual Linux desktop. Then, you can start/stop VM again as follows:
$ incus stop arch-desktop
$ incus start arch-desktop --console=vga
$ incus restart arch-desktop --console=vga
$ incus info arch-desktop

Getting help about incus commands

Getting help is easy. Try the passing the --help option as follows:
$ incus --help
$ incus {command} --help
$ incus rebuild --help

Description:Command line client for Incus
 All of Incus's features can be driven through the various commands below.For help with any of those, simply call them with --help.
 Custom commands can be defined through aliases, use "incus alias" to control those.
 
Usage:incus [command]
 
Available Commands:admin       Manage incus daemoncluster     Manage cluster membersconfig      Manage instance and server configuration optionsconsole     Attach to instance consolescopy        Copy instances within or in between serverscreate      Create instances from imagesdelete      Delete instancesexec        Execute commands in instancesexport      Export instance backupsfile        Manage files in instanceshelp        Help about any commandimage       Manage imagesimport      Import instance backupsinfo        Show instance or server informationlaunch      Create and start instances from imageslist        List instancesmove        Move instances within or in between serversnetwork     Manage and attach instances to networkspause       Pause instancesprofile     Manage profilesproject     Manage projectspublish     Publish instances as imagesrebuild     Rebuild instancesremote      Manage the list of remote serversrename      Rename instancesrestart     Restart instancesresume      Resume instancessnapshot    Manage instance snapshotsstart       Start instancesstop        Stop instancesstorage     Manage storage pools and volumestop         Display resource usage info per instanceversion     Show local and remote versions
 
Flags:--all            Show less common commands--debug          Show all debug messages--force-local    Force using the local unix socket-h, --help           Print help--project        Override the source project-q, --quiet          Don't show progress information--sub-commands   Use with help or --help to view sub-commands-v, --verbose        Show all information messages--version        Print version number
 
Use "incus [command] --help" for more information about a command.

See incus home page here.

Summing up

This tutorial introduces you to the wonderful world of Linux containers and VMs using an easy-to-use server called Incus, which is a fork of LXD running on a Debian Linux version 12 or 11. Further, you learn how to configure web UI, build your first container, and redirect traffic using proxy devices, including GUI-based VMs, for testing or privacy reasons. The possibilities are endless with the Incus server. It is an all-in-one server for both sysadmins and developers. You can build or deploy a home lab in production per your workload. It is an alternative to application containers such as Docker but can do both VMs and containers. Please check the documentation page for all other options.

You can deploy Docker inside the Incus container to test your app’s build process, which is very handy for debugging using the nested container feature provided by Incus and Linux kernel.

+---------------------------------+---------+------------------------------+------+-----------+-----------+
| debian-plausible-docker         | RUNNING | 172.18.0.1 (br-3ca387d20798) |      | CONTAINER | 28        |
|                                 |         | 172.17.0.1 (docker0)         |      |           |           |
|                                 |         | 10.147.164.102 (eth0)        |      |           |           |
+---------------------------------+---------+------------------------------+------+-----------+-----------+
Patreon subscribers can download the PDF version here and support independent content creators.

🥺 Was this helpful? Please add a comment to show your appreciation or feedback.

Vivek Gite is an expert IT Consultant with over 25 years of experience, specializing in Linux and open source solutions. He writes about Linux, macOS, Unix, IT, programming, infosec, and open source. Follow his work via RSS feed.

 

 

1 comment… add one
  • LRP Apr 27, 2025 @ 18:31

    Hi Vivek,

    Best Incus tutorial I’ve read and I’ve read many.

    Thank you.

    LRP

Leave a ReplyCancel reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre> for code samples. Your comment will appear only after approval by the site admin.

Next FAQ: Shell script to monitor MariaDB replication and send email alert about server health status

Previous FAQ: How to upgrade OpenSUSE 15.5 to 15.6 using the CLI

http://www.jsqmd.com/news/861083/

相关文章:

  • 2026现阶段保山岩板选购指南:核心供应商深度评估与决策清单 - 2026年企业推荐榜
  • 长期使用中观察Taotoken账单的透明度与预测准确性
  • 扣子平台全攻略:从零开发具有视频对话能力的心理陪伴机器人(附完整代码与详细解释)
  • 【仅剩最后47套】ElevenLabs丹麦语定制声音训练包(含哥本哈根/奥胡斯/奥尔堡三地方言样本库+声学特征标注集):20年语音工程团队内部封存资料限时开放
  • 2025-2026年上海吉日搬场有限公司电话查询:搬家前请核实服务细则并签署合同 - 品牌推荐
  • 如何快速掌握ElectronBot桌面机器人:从零开始到二次开发的完整指南
  • 操作系统基础概念与架构
  • Midjourney金属渲染避坑清单(2024Q2最新):6类典型翻车案例+对应反向Prompt修复模板
  • Honey Select 2终极增强补丁:新手快速上手指南
  • 键芯造物:百元内的设计感键帽,凭什么让玩家反复回购? - 小狐狸在吃饭
  • 2025-2026年北京装修设计公司推荐:TOP5评测口碑解析环保防醛性价比高特点 - 品牌推荐
  • 2025-2026年中国办公家具十大厂家推荐:十大品牌专业评测企业采购性价比高选择指南 - 品牌推荐
  • AcFunDown终极指南:三步学会免费下载A站视频的完整教程
  • 2025-2026年国内钢轨焊接设备推荐:五款营业线焊接避免锁定轨温失控产品口碑好的评测注意事项 - 品牌推荐
  • 抖音无水印下载器:高效保存高清视频与图集的完整解决方案
  • TriPlayer:重新定义Switch后台音频的智能播放解决方案
  • AI Agent在供应链决策优化中的案例研究:需求预测与库存管理的自动协同
  • 2026 最新最全行业测评及攻略|全球/国内GEO公司排名前十,看谁在主宰AI流量时代入口? - 互联网科技品牌测评
  • 成都移动冷库技术深度解析:成都冷藏库/成都冷链冻库/成都冻库厂家/成都冻库工程/成都医药冷库/成都医药冻库/成都果蔬冻库/选择指南 - 优质品牌商家
  • AutoGen实战:微软的多Agent对话编程指南
  • 为开源工具OpenClaw配置Taotoken作为后端模型提供商
  • Windows系统终极优化神器:3步完成一键安装与系统管理
  • 2026年5月十大游戏鼠标品牌推荐:TOP10专业评测抓握防滑性价比高价格 - 品牌推荐
  • ElevenLabs河南话模型未开放的隐藏参数曝光!3个未文档化flag让合成自然度提升40%(仅限本周内可用)
  • 2026年GEO优化服务商/公司/厂家最专业靠谱推荐:国内五家知名主流头部优选服务商综合解读+GEO优化FAQ - 互联网科技品牌测评
  • 2025-2026年北京装修设计公司推荐:十大排行产品专业评测别墅定制防踩坑性价比高 - 品牌推荐
  • 淘金币自动化脚本终极指南:10分钟搞定淘宝日常任务,每天为你节省20分钟
  • 【Midjourney洛可可风格创作指南】:20年AI艺术总监亲授7大黄金参数+3类易踩雷区
  • 进程与线程管理原理
  • 2025-2026年北京家装公司推荐:TOP5排行评测新房装修避增项市场份额选择指南 - 品牌推荐