Hi there,
I recognized some strange behavior for mounting directories inside lxc containers from a host system. I try to mount several directories in my container configuration:
-----------------------------------------------------
# Distribution configuration
lxc.include = /usr/share/lxc/config/debian.common.conf
lxc.arch = amd64
# Container specific configuration
# see
https://www.claudiokuenzler.com/blog/1095/unable-to-start-container-lxc-4.0-failed-to-mount-permission-denied-apparmorlxc.uts.name = web02
lxc.rootfs.path = dir:/var/lib/lxc/web02/rootfs
lxc.apparmor.profile = generated
lxc.apparmor.allow_nesting = 1
# mount needed host directorys (nas) to container
lxc.mount.entry = /mnt/nas/vm/docker /var/lib/lxc/web02/rootfs/var/lib/docker none rw,bind 0 0
#lxc.mount.entry = /mnt/nas/www /var/lib/lxc/web02/rootfs/mnt/nas/www none rw,bind 0 0
lxc.mount.entry = /mnt/nas/documentation_html/site /var/lib/lxc/web02/rootfs/mnt/nas/wiki none bind 0 0
lxc.mount.entry = /mnt/nas/mp3_klassik /var/lib/lxc/web02/rootfs/mnt/nas/mp3_klassik none bind 0 0
lxc.mount.entry = /mnt/nas/mp3 /var/lib/lxc/web02/rootfs/mnt/nas/mp3 none bind 0 0
lxc.mount.entry = /mnt/nas/ebooks mnt/nas/ebooks none bind 0 0
-----------------------------------------------------
/mnt/nas is a mounted partition on my host system containing several directories the container needs access to. The problem is, that only two of the mounts lead to successful directory listings inside the container...
I tried to experiment with absolute and relative mount points, but no change. Permissions are equal on the host. Inside the container I get success messages for the mounts even when the listing shows no files:
Feb 21 18:17:04
web02.lan.webtux.de systemd[1]: mnt-nas-mp3.mount: Succeeded.
Feb 21 18:17:04
web02.lan.webtux.de systemd[1]: mnt-nas-mp3_klassik.mount: Succeeded.
I am using Debian bullseye 5.10.0-21 using lxc 4.0.6-2+deb11u1
Any ideas on that?
Thank you for helping out