Kapsule not working out of the box on KDE linux | cgroup

Hi all,

I’m testing KDE Linux in a virt-manager/QEMU VM and wanted to try my hand at getting Mullvad VPN daemon/GUI running on it with Kapsule instead of sysext. But I was not able to get Kapsule running on my stock KDE linux because of cgroup legacy/hybrid errors.

Command:

kap create mullvad --image kapsule:archlinux

The image cached successfully, but container creation failed:

Creation failed: Failed to run: /usr/lib/incus/incusd forklxc mullvad ...

The Incus/LXC log showed:

Unsupported cgroup layout (hybrid)
Failed to mount cgroups - unsupported cgroup layout
Failed to mount "/sys/fs/cgroup"

Before the workaround, KDE Linux showed cgroup v2:

stat -fc %T /sys/fs/cgroup
# cgroup2fs

But mount | grep cgroup also showed a v1 controller:

cgroup2 on /sys/fs/cgroup type cgroup2 (...)
net_cls on /sys/fs/cgroup/net_cls type cgroup (...)

And /proc/cmdline included:

systemd.legacy_systemd_cgroup_controller=1

I temporarily fixed it by appending these kernel args at the systemd-boot menu:

systemd.unified_cgroup_hierarchy=1 systemd.legacy_systemd_cgroup_controller=0 cgroup_no_v1=all

After that, mount | grep cgroup only showed the cgroup2 mount, and Kapsule worked:

kap rm mullvad
kap create mullvad --image kapsule:archlinux

Result:

✓ Container 'mullvad' created successfully
✓ Container created

Is KDE Linux expected to boot with systemd.legacy_systemd_cgroup_controller=1 right now, or is this likely a VM image/config bug? Since Kapsule is made for KDE Linux, I expected the default image to already use a cgroup layout that Incus/LXC accepts?

To be honest, I don’t find Kapsule to work very well myself, and I’m not able to use it. It’s a very early project that has been in heavy development, though unfortunately that’s tapered off recently.

We may end up doing something else for our “how can experts extend the system” story.

Nate, how come you are not able to use it? Is it because of your hardware?

I just posted a post about an ubuntu kapsule container being dead in the water after a reboot.
But I still like Kapsule in KDE Linux.

Flathub has a very poor and not always up-to-date collection of packages.

Don’t throw Kapsule away until you guys find a better solution.

And spunkie, for me Kapsule works out of the box in KDE Linux on real hardware.
I haven’t tried KDE Linux in a VM.