[Lxc-users] Ubuntu 12.04 linux-container package and init modifications

Thaddeus Hogan thaddeus at thogan.com
Thu Mar 8 03:27:30 UTC 2012


On 3/7/2012 12:16 PM, Stéphane Graber wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
>
> On 03/06/2012 11:03 PM, Fajar A. Nugraha wrote:
>> On Wed, Mar 7, 2012 at 10:45 AM, Serge Hallyn
>> <serge.hallyn at canonical.com>  wrote:
>>> Quoting Fajar A. Nugraha (list at fajar.net):
>>>> # cat /etc/init/lxc-lo.conf start on startup env container
>>>>
>>>> pre-start script if [ "x$container" != "xlxc" -a "x$container"
>>>> != "xlibvirt" ]; then stop; fi initctl start network-interface
>>>> INTERFACE=lo exit 0; end script
>>>>
>>>>
>>>> So now the modifications (both from lxcguest and my local
>>>> addition) are all new .conf files, which would be ignored if
>>>> it's not started in lxc environment. Might try 12.04 container
>>>> later.
>>> If your guest is uptodate 12.04, you should have
>>>
>>> /etc/init/network-interface-container.conf
>>>
>>> from ifupdownpackage which emits that signal for you.  You
>>> shouldn't need your own lxc-lo.conf any more.
>> What is Canonical's plan for older guests? Will
>> network-interface-container.conf be backported to lxc-guest, or
>> will manual configuration still necessary?
> Starting in 12.04 we did the necessary changes to upstart, udev,
> mountall, ifupdown, ... to be container aware. For older releases our
> template still installs lxcguest that does a similar job though a bit
> more hackish :)
>
> As Serge said, if anything doesn't start for you with a clean 12.04
> container running on 12.04, it's a bug and we want to fix it.
>
> My goal for 12.04 was to make a perfectly clean and standard Ubuntu
> system work in a container without any change whatsoever and I think
> we achieved this:
> http://www.stgraber.org/2012/03/04/booting-an-ubuntu-12-04-virtual-machine-in-an-lxc-container/
>
>
> If you're writing custom upstart jobs or other scripts, you may be
> interested by the new events and tools we introduced on all Ubuntu
> systems since 12.04:
>   - The upstart "container" event giving you CONTAINER=technology
>   - The upstart "not-container" event
>   - /bin/running-in-container that will exit 0 in a container and exit
> 1 otherwise, even it exits 0 it'll also print the technology.
>
> I added code to upstart to detect (referred above as "technology"):
>   - lxc
>   - lxc-libvirt
>   - openvz
>   - vserver
>
> Though we only really support lxc and lxc-libvirt, the rest is best
> effort and we expect people to give us patches or access to a machine.
>
> This means the upstart job below is now possible:
> start on container CONTAINER=lxc
> exec /usr/sbin/my-lxc-monitoring-service
>
>
> I hope this helped explain what we're doing in 12.04.
> I'm planning on a generic "what's new in LXC for 12.04" blog post in
> the next few days, once we've turned apparmor back on and have
> somewhat secure containers again (hopefully later today).
>
> Again, please try an up to date Ubuntu 12.04 system and report any bug
> that you see, we're trying to closely look at LXC bugs and fix them as
> soon as possible.
>
> Cheers
>
> - -- 
> Stéphane Graber
> Ubuntu developer
> http://www.ubuntu.com
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iQIcBAEBCgAGBQJPV6YHAAoJEMY4l01keS1n5icP/3UfPJcrPOA1M79z+hUZT/QT
> eDCZTe/6nCEsjPXn/Jt7agkXAI8S4RcK1qjYKm7IbgsvOT0IpR4OXEX3NdJDQuGo
> dHHEhgQfUuRQ9ndWID0bSubum4iBMJLbzSEtZUBZ3ejmtsPX/L2qWxmT1tX+xOtd
> ZJG/HmcVj78dXRXXc7rHQagljd0YZs16ZvPnO8wO6jFJlT1DsqNtATu5hUhCXNXa
> X/f7c3cTZq6Ig9HGawJRjIAjlbpoww+YgqfoduKEjEuOrLDDrBexm3AwwSRFOAMn
> RauTAveug0kFx3SHIRGw7EHZ5w9TOBHtXyfYAek3Sna8N5CEPozZ2V6gQocGQiuX
> Q6Qq8mB9xZMAekB2xnmYeBVf3DcjkNOb1h7wg6u6WunEGDHGR+jwOM25g+c2EEW8
> 1mNFc61TMfp+4GFh3djnI8i9CqMNJX7olPCgDcULuglqYx4eFYJGN8p5P1G4DhLk
> 0VETCuJywEYoLa/5xlCveqPg6nMfddgLX3bo3ELD3zKmyNifjwuh9j7Xx1RCmNIO
> D1Ga8l9MPKv0x0dI6bnbQRbq1v0kH84ZZXZrdZb+P2XYnIGZk2fXIzedj7CUDoZ9
> dMmcAaJRG3znHBckL/1I4RjZgxyUB6CdtPPn4naMeWcdkX5zpumFEc8T/jn+xsOj
> DBjf6BATJV595nPVzAF0
> =kV4d
> -----END PGP SIGNATURE-----
>
> ------------------------------------------------------------------------------
> Virtualization&  Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> _______________________________________________
> Lxc-users mailing list
> Lxc-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-users
>

I used the ubuntu template with lxc-create instead of running 
debootstrap myself. Now everything works as expected when I start the 
guest.  Thanks!

-- Thaddeus




More information about the lxc-users mailing list