Posts tagged with: #incus

How to run Incus on Void Linux

2024-07-23

Incus is the replacement of LXD one should use. For some reason it won't work well on Void out of the box after a while, and incus start <container-name> might stop doing anything. How do we fix it?

Looking at /usr/share/doc/incus/README.voidlinux it suggests the following:

Some container configurations may require that the `CGROUP_MODE`
variable in `/etc/rc.conf` be set to `unified`.

One way to solve it is that. I did another solution however, which I found at this github issue. I did the following:

I created this Perl script, called enable_incus somewhere:

#!/usr/bin/env perl

use v5.38;

! -d '/sys/fs/cgroup/systemd' or say("Incus already enabled. Skipping."), exit;

system('sudo mkdir /sys/fs/cgroup/systemd');
system('sudo mount -t cgroup -o none,name=systemd systemd /sys/fs/cgroup/systemd');

say 'OK';

Then I edited /etc/sv/incus/run and added this line near the top:

/path/to/enable_incus

...so that my script gets executed just before incus is launched.

This fixed the problem.

I managed to restore my backed-up LXD/Incus containers!

2024-07-22

Until now I've never managed to do it. Every time LXD complained that the backup I'm trying to restore is configured in an incompatible way with our system. Different bridge interface name, static IP is out of range of this machine's network pool, and other such stuff. So I was ending up creating new LXD containers from scratch instead of restoring my backups, whenever I re-installed Linux on my laptop.

Not this time though. The backup was a tar.gz file, so I uncompressed it, edited its two configuration files in there (backup/index.yaml and backup/container/backup.yaml) to my liking, re-compressed, and managed to import it.

Incus rocks!