在amd64 LXC容器中运行的命令:
debootstrap --arch armhf --foreign --variant=buildd --components=main,restricted,universe,multiverse vivid /var/lib/schroot/chroots/vivid-armhf http://ports.ubuntu.com/ubuntu-ports最终还是失败了:
W: Failure trying to run: mount -t proc proc /proc
W: See //debootstrap/debootstrap.log for details主机上的syslog有以下内容:
audit: type=1400 audit(1449495124.972:29): apparmor="DENIED" operation="mount" info="failed type match" error=-13 profile="lxc-container-default" name="/var/lib/schroot/chroots/vivid-armhf/proc/" pid=25739 comm="mount" fstype="proc" srcname="proc" flags="rw"
audit: type=1400 audit(1449495124.976:30): apparmor="DENIED" operation="mount" info="failed type match" error=-13 profile="lxc-container-default" name="/var/lib/schroot/chroots/vivid-armhf/proc/" pid=25739 comm="mount" fstype="proc" srcname="proc" flags="ro"这真的是不可能的:
user@vm:~$ sudo chroot /var/lib/schroot/chroots/vivid-armhf
/usr/bin/groups: cannot find name for group ID 0
I have no name!@vm:/# mount -t proc proc /proc
mount: proc is write-protected, mounting read-only
mount: cannot mount proc read-only
I have no name!@vm:/#需要向LXC容器配置中添加什么才能允许这样的挂载?
发布于 2015-12-07 14:06:24
新概况:
sudo tee /etc/apparmor.d/lxc/lxc-default-with-proc-mounting <<EOM
profile lxc-default-with-proc-mounting flags=(attach_disconnected,mediate_deleted) {
#include <abstractions/lxc/container-base>
mount fstype=proc options=ro -> /**,
}
EOM进入容器配置:
lxc.aa_profile = lxc-default-with-proc-mounting重新加载配置文件:
sudo systemctl reload apparmor重新启动容器。
https://askubuntu.com/questions/706961
复制相似问题