[Lxc-users] What is the latest status for Nested Containers in Ubuntu 12.10 and 13.04

brian mullan bmullan.mail at gmail.com
Thu Apr 18 02:26:13 UTC 2013


Stephane

note:  I am using Ubuntu 13.04

Made the changes you suggested to my container config:

   - lxc.aa_profile = lxc-container-default-with-nesting
   - lxc.hook.mount = /usr/share/lxc/hooks/mountcgroups


but at that point I followed your blog post instructions (/
https://www.stgraber.org/2012/05/04/lxc-in-ubuntu-12-04-lts/)

   1. Started the parent-container
   2. Stopped LXC
   3. Checked /etc/default/lxc in the "parent-container" and saw its
   network/subnet = 10.0.3
   4. So again per your blog I changed all of the 10.0.3 to 10.0.4 subnet
   in /etc/default/lxc
   5. Restarted LXC
   6. then finally
   7. created a "child-container"
   8. started the "child-container"
   9. logged in successfully to the new "child-container"


and it worked... thank you.

However... my question now ... if you wanted to create multiple
"child-containers"

Do you have to re-edit the /etc/default/lxc file and manually change the IP
network/subnet each time ...
or is there a way to have it automated so each new "child-contianer" is
allocated a good Network/Subnet as its created?

If someone wanted to create say 20-30 child-containers... this would become
tedious and error prone to do manually.

thanks
brian


sudo lxc-start -n parent-container
(in parent-container) sudo apt-get install lxc
(in parent-container) sudo stop lxc
(in parent-container) sudo sed -i "s/10.0.3/10.0.4/g" /etc/default/lxc
(in parent-container) sudo start lxc
(in parent-container) sudo lxc-create -n child-container -t ubuntu
(in my-host-container) sudo lxc-start -n child-container
                                                     #log into new
child-container -- successful


---------- Forwarded message ----------
From: "Stéphane Graber" <stgraber at ubuntu.com>
To: lxc-users at lists.sourceforge.net
Cc:
Date: Tue, 16 Apr 2013 19:40:01 +0200
Subject: Re: [Lxc-users] What is the latest status for Nested Containers in
Ubuntu 12.10 and 13.04
Hi,

Yes, starting with Ubuntu 12.10 we ship a
"lxc-container-default-with-nesting" profile that can be set as
lxc.aa_profile in your container config which should work fine for
nested containers.

In Ubuntu 13.04, you likely also want to add the following to your config:
lxc.hook.mount = /usr/share/lxc/hooks/mountcgroups
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20130417/aeae45b9/attachment.html>


More information about the lxc-users mailing list