LXC ubuntu container fails to start

Hi all,

on my mox, the LXC Ubuntu Cosmic container from repo.turris.cz/lxc fails to start with:

root@turris:~# lxc-start -F -n ubuntu-turris
Failed to insert module ‘autofs4’: No such file or directory
Failed to insert module ‘unix’: No such file or directory
Failed to mount cgroup at /sys/fs/cgroup/systemd: Operation not permitted
[ !!! ] Failed to mount API filesystems, freezing.
Freezing execution.

Any known workaround for this?

I got it working with the following cgroup mount:

#!/bin/sh /etc/rc.common

START=90
STOP=10

start() {
mkdir -p /sys/fs/cgroup/systemd
mount -t cgroup -o none,name=systemd systemd /sys/fs/cgroup/systemd
}

Not sure though if this has any side effects…

Based on Alpine Linux and Systemd Containers (Round 2) · j2h2.com

1 Like