我正在尝试在 chroot 内运行 lxc 。
$ lxc-start -n instrument --logfile=/dev/stdout
lxc-start 20190619141851.659 ERROR lxc_cgfs - cgroups/cgfs.c:cgfs_init:2359 - cgroupfs failed to detect cgroup metadata
我尝试挂载(目标是我的 chroot 路径):
/bin/bash -c "sudo mount --bind /proc ${target}/root/proc/"
/bin/bash -c "sudo mount --bind /sys ${target}/root/sys/"
/bin/bash -c "sudo mount --bind /dev ${target}/root/dev/"
/bin/bash -c "sudo mount --bind /dev/pts ${target}/root/dev/pts"
/bin/bash -c "sudo mount --bind /sys/fs ${target}/root/sys/fs"
答案1
安装 cgroupfs-mount 并运行它似乎足以挂载所有需要的 cgroupfs 挂载。
apt install cgroupfs-mount
/usr/bin/cgroupfs-mount