[lxc-users] Mounts in shared folder not seen in container

Bertrand NOEL bertrand.noel.88 at gmail.com
Thu Oct 1 13:04:06 UTC 2015

I share a folder from host to container. That folder contains mounts.
Below is a simple usecase of what I do.

# On host
mkdir -p /shared/mount1
mount some.iso /shared/mount1

# In the config of my container
lxc.mount.entry = /shared shared none bind 0 0

# On the host
tree /shared
     └── mount1
                  └── file

# On the container
tree /shared
     └── mount1

I do see the folder and the subfolders, but not the contents of the mounts.
Is it expected behaviour? How can I share a folder containing mounts?

If I share the mount directly, and not its containing folder
(lxc.mount.entry = /shared/mount1 shared/mount1 none bind 0 0), it
works - I can see the files.
But I have lots of mount points, and they could change.

I have read that webpage [1] and discussions on this mailing list [2]
about sharing mounts. It works, but only for mounts mounted *after*
the container has started.

System is Ubuntu 14.04.3, with LXC 1.0.7

[1] https://s3hh.wordpress.com/2011/09/22/sharing-mounts-with-a-container/
[2] https://lists.linuxcontainers.org/pipermail/lxc-users/2014-February/006168.html
[2] https://lists.linuxcontainers.org/pipermail/lxc-users/2014-March/006337.html

More information about the lxc-users mailing list