Category Archives: Planet Revolution-Linux

State of LXC in Ubuntu 11.04

A while ago I posted about LXC and how to use it on Ubuntu 9.10, I think it’s time to update these instructions to the current state of LXC in Ubuntu 11.04.

As a quick reminder LXC stands for Linux Containers and uses the relatively recent cgroup and namespace features of the Linux kernel to offer something that’s between a chroot and a virtual machine. That’s, basically a chroot but with fine grained resource allocation, its own network stack and its own pid namespace.
LXC is very similar to OpenVZ and Linux-Vserver but doesn’t depend on kernel patches to work.

So here’s now how to get it working on Ubuntu 11.04 in a much easier way than back in Ubuntu 9.10, thanks to all the work done upstream.

To get LXC working on Ubuntu 11.04, you’ll need to do the following:

  • Install a few packages: lxc, debootstrap and bridge-utils
  • Create a bridge interface with masquerading and a local IP address
  • Create a mountpoint for the cgroup filesystem and make sure it’s mounted
  • Write a network configuration file for your container
  • Create your container (the template gets generated with the first container)

To make it even easier, I wrote the following script that you can start as root to do all the above.
It’ll add a “br-lxc” interface using the 192.168.254.0/24 network and configure masquerading.
The cgroup filesystem will be mounted at boot time in /cgroup.
A first container called natty01 will be created and started with IP 192.168.254.2 and default root password “root”.

The script is (I think) well commented and I’ve clearly indicated what’s to be run once (to setup LXC) and what’s to be run for every container you may want to create.
Script can be downloaded from: http://www.stgraber.org/download/lxc-demo.sh.

Once you have a container started, you can start playing with:

  • Attach to a VT: lxc-console –name natty01
  • Get the status: lxc-info –name natty01
  • Get the list of running processes: lxc-ps –name natty01 aux
  • Start/Stop containers: lxc-start/lxc-stop

Have fun!

Posted in Canonical voices, LXC, Planet Revolution-Linux, Planet Ubuntu | 19 Comments

More on WebLive and the Software Center integration

As Michael mentioned on Friday we now have a pretty well working WebLive integration directly in Natty’s software-center.

All you need is qtnx to be installed and an up to date Software Center.
Edubuntu 11.04 will ship with qtnx installed by default. We want to test the feature with all Edubuntu users first to see how it scales and make sure everything is stable before we consider using it for Ubuntu.

Now, quite a few people have been wondering what’s currently available on WebLive.
The complete package list is available here: http://www.stgraber.org/download/weblive-list.html (generated using the WebLive API)

It’s basically all the packages you can find in Edubuntu 10.10, Edubuntu 11.04 and Ubuntu 11.04 as well as the top-30 from the Software Center.
So if you want a package to appear on WebLive, write a review in the Software-Center and rate it.

Edubuntu WebLive

I also would like to remember everyone that you can still get full desktop session by going at: http://www.edubuntu.org/weblive

If you want to point a friend who doesn’t have the new software center to a single-app session, you can use: http://www.edubuntu.org/weblive/app/gedit (by replacing gedit by anything that’s available on WebLive).

Enjoy !

Posted in Edubuntu, Planet Revolution-Linux, Planet Ubuntu, WebLive | 2 Comments

Introducing the WebLive API

After working on it for the last two weeks, I’m proud to finally announce the WebLive API.
As a reminder, WebLive is the name used for the daemon, Drupal plugin and scripts used to run http://www.edubuntu.org/weblive
Since last week, all the code is now available here: https://launchpad.net/weblive

The API is exported over JSON and example code is available in the branch called ltsp-cluster-agent-vmmanager in the client directory. When interfacing with python, it’s recommended to use the “weblive.py” module as it’ll be updated should the JSON API change or be extended in the near future.

Exported functions are:

  • create_user(serverid, username, fullname, password, session)
  • list_everything()
  • list_locales(serverid)
  • list_packages(serverid)
  • list_servers()

The following functions are exported over authenticated XML-RPC (for management):

  • delete_user(serverid, username)
  • set_disabled(serverid,status)
  • list_users(serverid,all=False)

The main weblive instance is available at https://weblive.stgraber.org/weblive/json and is the one used by Edubuntu.

The drupal-weblive branch contains the Drupal module which is now just a client to the JSON API.

The first use of that API after the Drupal module is Natty’s software-center which since last week ships with code to connect to WebLive.
If you use up to date Natty, you’ll need to install “qtnx” from universe and then start: software-center –with-weblive

All the packages available in WebLive will then have a “Test drive” button you can click to test that app remotely from a WebLive server.

WebLive integration in software-center

The software-center integration is experimental and will hopefully be improved by the time Natty is released. As Ubuntu doesn’t ship qtnx by default, WebLive won’t be visible in the default Ubuntu install, though it’ll be for Edubuntu.

Note: It can take up to a minute to connect to a server. There’s currently no user feedback during the connection process unless you watch the terminal from which you started the software center.

The current code requires your username and hostname to be ascii lowercase alpha characters only. I posted instructions as a comment to get the development branch that doesn’t have this restriction.

Posted in Edubuntu, LTSP, Planet Revolution-Linux, Planet Ubuntu, WebLive | Tagged | 11 Comments

Edubuntu’s installer ready for 11.04

After spending the last day or so working on it, I’m proud to announce that Edubuntu finally has its long awaited fine-grained package selection in Ubiquity.

Here’s a screenshot of what will be available in Natty:

Ubiquity fine-grained package selection

With it, users can easily opt out of some of our meta-packages or individual packages.
In the future you will also be able to install extra packages this way (that aren’t installed in the live environment but are present on the DVD).

Other than this installer change, Edubuntu has also been updated to ship with a classic gnome interface by default but offer Unity as an installation option. Unity-2d will also ship by default and we’ll try to have it as fall-back of Unity for these who choose to use Unity as their desktop interface.

Enjoy !

Posted in Edubuntu, Planet Revolution-Linux, Planet Ubuntu | Tagged , | 12 Comments

First ARB-approved application available for Ubuntu 10.10

After months of reviewing the process and going through applications, the ARB approved its first application, Stefano Rivera’s suspended-sentence.


It’s now available in the Software Center for all Ubuntu 10.10 users who have the extra repository enabled.

Description: Point-and-click adventure game set on a space ship
You wake up to find yourself alone on a broken spaceship headed to a Penal Colony.
The ship seems to want you to fix it, but first you need to get out of the room.

It's an adventure game, you know how this works.
Suspended Sentence was a PyWeek.org entry, a game written in a week.

Website: http://suspended-sentence.org

We’re expecting quite a few more applications to show up on extras.ubuntu.com very soon. Hopefully the process should be a lot faster for the next few applications as we’ve now solved most issues and questions with that first one.

Posted in Planet Revolution-Linux, Planet Ubuntu | 7 Comments