In-flight internet and LXC working in libvirt

Interesting day, flying from Montreal, Quebec to Dallas, Texas for the Ubuntu Developer Summit.
I have been able to try American Airlines’ in-flight wireless, it works surprisingly well, I get a stable 80ms latency to my home server and a quick bandwidth test gives me some 100kB/s.

On a completely different topic but still somewhat related, on that same flight, I have been able to install the latest libvirt packages I uploaded this morning to my PPA.

It’s the first time I actually manage to get networking to work with LXC in libvirt using libvirt’s network configuration.

I’ll be trying to convert some of the UDS attendees so they try it out and help making it work just fine in Lucid. Having that and kvm supported by libvirt will make Ubuntu a rocking platform for virtualization/contextualization.

Quick quote from my first test (starting the container, entering it, setting up network with DHCP, pinging my home server):

root@castiana:~# sudo virsh --connect lxc:///
Welcome to virsh, the virtualization interactive terminal.

Type:  'help' for help with commands
       'quit' to quit

virsh # start shell
Domain shell started

virsh # console shell
Connected to domain shell
Escape character is ^]
root@castiana:/# dhclient3 eth0
There is already a pid file /var/run/dhclient.pid with pid 29
removed stale PID file
Internet Systems Consortium DHCP Client V3.1.1
Copyright 2004-2008 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

Listening on LPF/eth0/52:54:00:d8:9b:96
Sending on   LPF/eth0/52:54:00:d8:9b:96
Sending on   Socket/fallback
DHCPREQUEST of 192.168.122.78 on eth0 to 255.255.255.255 port 67
DHCPACK of 192.168.122.78 from 192.168.122.1
bound to 192.168.122.78 -- renewal in 1749 seconds.
root@castiana:/# ping athos.stgraber.org
PING athos.stgraber.org (24.200.46.78) 56(84) bytes of data.
64 bytes from modemcable078.46-200-24.mc.videotron.ca (24.200.46.78): icmp_seq=1 ttl=43 time=94.1 ms
^C
--- athos.stgraber.org ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 94.124/94.124/94.124/0.000 ms
root@castiana:/# ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0  17636  1772 pts/0    Ss   20:16   0:00 /bin/bash
root        29  0.0  0.0   6488   440 ?        Ss   20:16   0:00 dhclient3 eth0
root        31  0.0  0.0  14892  1028 pts/0    R+   20:16   0:00 ps aux
root@castiana:/# 

Posted in Planet Ubuntu | Leave a 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

Edubuntu 9.10 is out !!!

On this Thursday 29th of October, the Edubuntu community is extremely pleased to announce that the 9.10 release is out !!!

edubuntu logo

Some may have thought Edubuntu was kind of dead, especially after changing its name to become an Add-on, these days are over and we are happy to announce that it’s now a full distribution again and is provided as a DVD image.

The biggest changes for this release are:

  • Moving to a DVD image
  • LTSP installation working from the DVD (text mode)
  • Live (ready to use) environment with possibility to install
  • LTSP-Cluster is now packaged in Universe
  • Sabayon is working again

The release announcement can be found on the Edubuntu website along with download information: here.

It’s now time to celebrate Ubuntu’s and its derivative’s latest release, then we can start thinking of what to work on for 10.04 (Lucid Lynx) which will be a Long Term Support release.

I’d like to say a huge thank you to everyone who was involved in creating that great release and helped getting Edubuntu back to what it was if not even better. I’m sure that in the next 6 months, we’ll achieve a lot more.

An Ubuntu OpenWeek session is planned on Thursday the 5th of November at 19:00 UTC on IRC (#ubuntu-classroom) where I’ll try to explain how to get involved in that great community and what are our plans for the release to come.

Posted in Edubuntu, Planet Ubuntu | Leave a comment

Going to Linux Symposium 2009 in Montreal

Linux symposium logo

I’ll be leaving tomorrow to Montreal for a week-full of conference at the Linux Symposium 2009.

Revolution Linux will be giving two “project updates” one from Julien Desfossez about processus tracing in kernel space with his kernel module Kolumbo and another by Benoit des Ligneris and myself about what’s going on with LTSP and LTSP-Cluster.

Other than that I’ll be around at the conference all week so if you want to talk feel free to catch me or poke me on irc/mail.

Posted in Conferences, Planet Ubuntu | Leave a comment

Going to the Libre Graphics Meeting in Montreal (May 6-9)

From Wednesday the 6th of May to Saturday the 9th I’ll be attending Libre Graphics Meeting in Montreal

LGM 2009 logo

LGM 2009 is the fourth annual worldwide meeting of teams developing open source graphics applications.
Developers from projects like Scribus, Krita, Inkscape, Gimp, Blender, … will be there for hacking and discussing.

Working mainly on LTSP and LTSP-Cluster at Revolution Linux, I’ve proposed two talks (they’re yet to be accepted), the first (with Benoit St-André) on “LTSP and graphics applications” and the second on “Keeping in touch with Ubuntu”.

I hope it’ll be a good opportunity to discuss the use of graphic softwares in schools with technologies like LTSP and NX, what should be improved to make them more remote-X friendly and also more friendly for our users.

I also hope to have more people to know how Ubuntu is working so that they can use the different resources available and know how to best integrate with the way Ubuntu is developed.

Posted in Conferences, Planet Ubuntu | Leave a comment