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

Bertrand NOEL bertrand.noel.88 at gmail.com
Wed Oct 7 13:11:45 UTC 2015

Thanks it's working! I had tried rbind but in the command line. I did
not know it was possible to have it in the config.

I will go ask on Libvirt mailing list, because I was trying to get
that using libvirt-lxc, and there does not seem to exist an equivalent

2015-10-05 17:11 GMT+02:00 Serge Hallyn <serge.hallyn at ubuntu.com>:
> 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.
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users

More information about the lxc-users mailing list