[lxc-users] Mounts in shared folder not seen in container
Serge Hallyn
serge.hallyn at ubuntu.com
Mon Oct 5 15:11:59 UTC 2015
Quoting Bertrand NOEL (bertrand.noel.88 at gmail.com):
> Hi,
> 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
> /shared/
> └── mount1
> └── file
>
> # On the container
> tree /shared
> /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.
You want rbind (recursive bind), just bind is only the mount itself.
More information about the lxc-users
mailing list