[Lxc-users] Add additional mounts to a running LXC container?

Serge Hallyn serge.hallyn at canonical.com
Mon Apr 30 14:33:05 UTC 2012


Quoting Steve Bakke (sbakke at netzyn.com):
> Would like to give a running container additional access to directories/mounts from outside a container.  Do not want the container itself to have this ability.  Tried from outside the container, both mounting to a directory within the container and also to create a symbolic link to a container directory.  Neither approach worked - from within the container, directory was empty.
> 
> Can this be done?
> 
> Steve

It can.  You need to set up mounts propagation so that the mount done
on the host gets forwarded to the container.  How to do so has been
discussed here before, and I wrote about it here:
http://s3hh.wordpress.com/2011/09/22/sharing-mounts-with-a-container/

In the comments to that, Arie links to some scripts he wrote to
do this.

Providing this support by default through a /shared is also on the
agenda for the lxc UDS discussion next week.

-serge




More information about the lxc-users mailing list