[Lxc-users] Sharing a single rootfs between multiple containers

Vallevand, Mark K Mark.Vallevand at UNISYS.com
Wed Apr 17 20:13:28 UTC 2013


I would like to create my containers to share a single rootfs directory.

I create a master container using lxc-create using my variation of the ubuntu template and my config file.  I also install additional programs into the rootfs.

At this point, I have a program using liblxc which does the work of starting the containers.

The program reads the master container config into a struct lxc_conf.  It makes changes to the NIC hwaddrs to make them unique, but otherwise the config is left unchanged.  The program then calls lxc_start to execute the program that needs to run in the container.  A large number of containers are started like this.  The only issue I have is you cannot have more than one lxc_start active until the container is running.  So, start them serially.  Additionally, I needed to set lxc.console=none, which is what I wanted anyway.  And, for some reason, you need to have a /var/lib/lxc/containername directory.

So, are there any problems that might arise doing it this way?

Regards.
Mark K Vallevand   Mark.Vallevand at Unisys.com<mailto:Mark.Vallevand at Unisys.com>
May you live in interesting times, may you come to the attention of important people and may all your wishes come true.
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20130417/bbd29183/attachment.html>


More information about the lxc-users mailing list