Category Archives: LXC

sandbox 0.2 released and packaged !

Yesterday, while enjoying the snow falling outside (finally!) I went through my TODO list for sandbox and implemented most of what was on it.

Ext4 support for the copy-on-write partition

You can now have the copy-on-write stored on disk instead of RAM memory (tmpfs).
The tmpfs support is still available as an option for these who have plenty of RAM or don’t have a separate /home (due to the aufs limitation).

Nautilus extension

sandbox now has a nautilus extension which lets you start any executable binary/script directly in a sandbox.
sandbox nautilus integration

Updated GUI

The GUI is no longer showing any option by default and just “does the right thing” (in most cases).
sandbox new gui

All the options being hidden behind “Show sandbox options”.
sandbox new gui advanced

Released and packaged it

Finally, I released sandbox 0.2 (0.1 wasn’t in a packagable state) and packaged it for Ubuntu Natty Narwhal.
It’s made of 3 different packages:

  • sandbox: The command line utility and the C part.
  • sandbox-gui: The python GUI and .desktop file (Applications -> System Tools -> sandbox)
  • sandbox-nautilus: The nautilus extension, you need to restart nautilus to have it to load

The packages (for natty) can be found in my experimental PPA: https://launchpad.net/~stgraber/+archive/experimental/
and code is still available at: https://code.launchpad.net/~stgraber/+junk/sandbox

sandbox running software

For now, everything is called “sandbox” which is more of a concept than an actual project name. As it’s becoming more and more of an actual project and I’m quite bad at finding good names, I’m open for suggestions of a better name for that thing.

Update: Release 0.2.1 which auto-detect separate /home partition and fall-back to tmpfs when necessary. Packages are available for Natty (Ubuntu 11.04) and Maverick (Ubuntu 10.10).

Posted in LXC, Planet Revolution-Linux, Planet Ubuntu, Sandbox | Tagged , | Leave a comment

A week in Orlando (Ubuntu Developer Summit – Natty Narwhal)

Currently flying from Orlando, FL where I had an awesome Ubuntu Developer Summit I wanted to quickly share what happened this week.

Ubuntu and Linaro banners

I had the chance of being able to participate in plenty of very different and interesting sessions over the week.

Here’s a quick overview of my interests for the Natty development cycle.

Edubuntu
I received a LOT of feedback regarding Edubuntu. There was a lot interest for Edubuntu WebLive.
I gave a plenary on Tuesday about what’s Edubuntu, why we are doing it and what are our plans for Natty as well as announce the availability of daily Edubuntu builds on WebLive.
For Natty we mostly plan on growing our user community and getting more feedback from. Our installation process should be a lot faster and let the user choose what kind of education software he wants.
We also reviewed around 20 new applications, most of them are already available in Edubuntu in Natty, two will need to be packaged.

Containers
For this UDS, we were lucky to have Daniel Lezcano from LXC attending.
So we had a few very interesting sessions on what needs to be done to get LXC to the point where it can be used as a replacement of OpenVZ.
We also discussed how we could use containers and similar technologies on ARM and on a regular desktop as a way to sandbox applications.

Desktop in the cloud
Following my demo of Edubuntu WebLive during Tuesday’s plenary, we had two cloud track related to it.
One on how to let users test Ubuntu (awstrial) and another on the Desktop in the Cloud image. We discussed the various technologies available for remote desktop and will try to get an official desktop in the cloud image for Natty.

Community
Being an Application Review Board member, I attended the 3 sessions on the topic. We discussed the application review process as well as the technical implementation and the current limitations the ARB noticed. We should soon have a clear process for reviewing new applications and will be able to start getting new applications in Ubuntu 10.10’s extra repository.

It was really great seeing everyone, discussing and working together this week. I’m now flying to Bangor, ME for the yearly LTSP by the sea meeting, then driving back to Sherbrooke, QC to start implementing everything we discussed!

See you all in Budapest next year!

Posted in Conferences, Edubuntu, LXC, Planet Revolution-Linux, Planet Ubuntu | 1 Comment

LXC containers or extremely fast virtualization

Update: Added an hardy i386 template, mentioned the need of bridge-utils and fixed typo (s/addbr/brctl addbr/g)

This (quite long) post is about the LXC (Linux containers), an example of its usage on Karmic is provided after the introduction to contextualization.

Most of you are probably already familiar with “usual” virtualization as kvm/virtualbox/vmware/… These are now extremely fast ways to do “full” virtualization of an OS on a host running either the same OS or a completely different one.
In Ubuntu, the most widely used is probably KVM used with libvirt and virt-manager as frontend.

At Revolution Linux, we have literately hundreds of virtual machines for each of our customers and we noticed that they are all Ubuntu virtual machines running on Ubuntu hosts. Then, running them in a “full” virtualization environment adds unneeded overhead and makes resource assignment quite difficult (you can’t easily change the CPU/RAM/DISK/NIC of a running virtual machine).

So, what we are currently doing is using contextualization instead of regular virtualization.
Contextualization can (in a much simpler way) be seen as improved chroots, these “chroots” are called containers and work just like a regular virtual machine, inside them you have your own network interface, can apply disk/cpu/ram quotas and start/stop/suspend as many of them as you want.
All the quotas and restrictions can be changed on the fly without needing any restart, because it’s technically just a set of process running on the host, not a single process as with virtualization.
It also means that you can list/kill or execute a process in any of these containers, directly from the host (a container obviously can’t access another’s processes).

The technology we have been using for more then a year now has been OpenVZ (open source implementation of Virtuozo) which basically is a huge patchset on top of the Linux kernel and only exists in Ubuntu hardy (8.04 LTS).

What I’ve been looking at more recently and hope to have working correctly in Lucid (10.04 LTS) is LXC. LXC is basically the same as OpenVZ except that it’s in the upstream kernel and uses already existing kernel features such as “cgroups” for example.
LXC is also supported by libvirt although it’s not working in Karmic, that will let users play with it just like any other virtualization technology using their existing scripts and interfaces.

Here’s a quick howto to make it work on Karmic with an Ubuntu 8.04 amd64 container (I’ve had issues making Karmic to work in a container):

  • Install bridge-utils: sudo apt-get install bridge-utils
  • Install LXC from my PPA (upstream snapshot) : https://launchpad.net/~stgraber/+archive/ppa/+packages
  • Create /var/lib/lxc/: mkdir -p /var/lib/lxc/
  • amd64 template (if your computer is running Ubuntu 64bit): Get http://www.stgraber.org/download/lxc-ubuntu-8.04-amd64.tar.gz (Hardy amd64 image)
  • i386 users (if your computer is running Ubuntu 32bit): Get http://www.stgraber.org/download/lxc-ubuntu-8.04-i386.tar.gz (Hardy i386 image)
  • Uncompress it in /var/lib/lxc/ (will create an ubuntu directory containing a configuration file and a root directory)
  • Mount cgroups somewhere: sudo mkdir /dev/cgroup && mount -t cgroup none /dev/cgroup
  • Create a bridge with: sudo brctl addbr br0
  • Set an IP on the bridge: ifconfig br0 192.168.2.1 (VE will be 192.168.2.2 by default)
  • Start the VE: lxc-start -d -n ubuntu
  • Enter the VE: “lxc-console -n ubuntu” or “ssh root@192.168.2.2” (root password is “password”)

The VE (virtual environment) configuration file is in: /var/lib/lxc/ubuntu/config

Additional information can be found on:

Also, I plan to have a session about it at UDS-Lucid in Dallas

Posted in LXC, Planet Ubuntu | 19 Comments