<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div>Hi,<br></div>I'm experiencing issues while trying to share an host path or filesystem as read only to guests (read only bind-mounts).<br><br></div>Host: Debian 8 Jessie <br>Linux deb 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt4-3 (2015-02-03) x86_64 GNU/Linux<br><br></div>LXC: stock, 1.0.6-6<br></div>Guest: Debian 8 (no systemd)<br></div>Filesystem on host: ext4<br><br></div>I'm sharing the host:<br></div>- /system <br></div>by using a custom entry in fstab-like file loaded via the container config file, i.e.:<br>/system system none ro,bind,create=dir 0 0<br><br></div><div>NB: as my "/system" path I've tested a subdirectory and even a mount point. And I've also dome some tests by using an entry in the config file with lxc.mount.entry, but with the same issues.<br><br></div>Well, the guest correctly bind-mounts the host path, but mounts it as read-write.<br></div>By simply issuing on the guest: <br></div>mount -o remount,ro /system<br></div>does the job... but ... as I understood it has to work out of the box.<br></div><div><br></div></div>An excerpt of the log obtained while starting the guest:<br>      lxc-start 1425989871.658 DEBUG    lxc_conf - remounting /system on /usr/lib/x86_64-linux-gnu/lxc/rootfs/system to respect bind or remount options<br>      lxc-start 1425989871.658 DEBUG    lxc_conf - (at remount) flags for /system was 4096, required extra flags are 0<br>      lxc-start 1425989871.658 DEBUG    lxc_conf - mountflags already was 4097, skipping remount<br>      lxc-start 1425989871.658 DEBUG    lxc_conf - mounted '/system' on '/usr/lib/x86_64-linux-gnu/lxc/rootfs/system', type 'none'<br>      lxc-start 1425989871.658 INFO     lxc_conf - mount points have been setup<br><br></div><div>Regards,<br></div>-- Marco<br><br><div><div><div><div><div><div><div><div><div><div><div><div><div><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div>