1

The command that is run inside an amd64 LXC container:

debootstrap --arch armhf --foreign --variant=buildd --components=main,restricted,universe,multiverse vivid /var/lib/schroot/chroots/vivid-armhf http://ports.ubuntu.com/ubuntu-ports

Eventually fails like that:

W: Failure trying to run:  mount -t proc proc /proc
W: See //debootstrap/debootstrap.log for details

The syslog on the host has this:

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"

And it's really impossible to mount:

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:/#

What needs to be added to the LXC container config to allow such mount?

1 Answer 1

0

New profile:

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

Into container config:

lxc.aa_profile = lxc-default-with-proc-mounting

Reload profiles:

sudo systemctl reload apparmor

Restart container.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .