Saturday, 10 March 2012

Xen Part 7: The Move to Wheezy

The last time I tried installing guests on Xen, it didn't really pan out. I ended up with more problems than I could reasonably expect to fix in my spare time, and a lot of them were related to Debian. Yes, you heard right: problems related to Debian. For whilst Debian is a superbly stable distro (and, it just so happens, my favourite), it achieves its trademark stability through relatively lengthy testing periods. In other words, if you're running Debian squeeze, you're running relatively old software - and pertinent to this case - a relatively old kernel.

No, scrap that; it's not relatively old - it's ancient. Kernel 2.6.32 was released in December 2009, some two-and-a-quarter years ago. A few of points to note:

  1. A lot of Xen changes have been made since 2.6.32.
  2. Ubuntu Oneiric (which I'm trying to install as a guest) currently boasts kernel 3.0.0, released in July 2011. I'm rather lazily getting my dom0 kernel to double as my guest kernel, and I don't know why I expected 2.6.32 (2009) to run smoothly with Oneiric (2011-2012).
  3. The rather annoying DPMS problem I encountered (which you may recall from Part 5: Dom0 X Instability) was resolved in one of the kernel updates. 
Clearly, I needed a more recent kernel.

To understand the options available, we first need to understand the Debian distribution structure. If you're running Debian and don't know otherwise, you'll be running Debian stable (Toy Story codename: Squeeze). There are a couple of other distributions you could be running: Debian unstable and Debian testing. 

A new package version is first uploaded to unstable, where most of the big problems are ironed out. When various criteria are reached, the version is promoted to the testing distribution. This process of uploading to unstable and subsequent promotion to testing continues, until the number of bugs in testing reduces to acceptable levels. Then the release manager will promote testing to stable, and a new Debian release is announced to an expectant world.

If you want to run a more recent package version than is available in stable, you have a few options. You can:
  • Compile the package version of your choice, and handle any dependencies yourself
  • Run a mixed stable and unstable/testing distribution
  • Run an unstable/testing distribution
So, I tried the first option, compiled the latest kernel from kernel.org, spun it up under squeeze... and ran headfirst into a stone wall of problems. I also tried a few other kernels back down to 3.0, and encountered the same sorts of issues. 

That was when I decided that enough was enough: I would be moving my dom0 to Debian testing (Toy Story codename: Wheezy).

Should you also choose to do so, I ask that you to do your research first. Testing does not bear the "stable" moniker for a reason. You're likely to encounter some problems before you've even got it fully installed. Security updates aren't rolled out to testing as promptly as they are to stable. Finally, I don't know of any reasonable way to revert back to stable if you decide that the experience is proving too problematic.

That said, moving to Wheezy is elementary. First, you need to edit your /etc/apt/sources.list file to point to the Wheezy software repositories - something like this:

# Wheezy (Testing)
deb http://security.debian.org/ wheezy/updates main non-free contrib
deb-src http://security.debian.org/ wheezy/updates main non-free contrib

deb http://ftp.uk.debian.org/debian/ wheezy main non-free contrib
deb-src http://ftp.uk.debian.org/debian/ wheezy main non-free contrib

deb http://www.debian-multimedia.org/ wheezy main non-free

Then you need to upgrade your packages to the latest in Wheezy. You'll want to use dist-upgrade for this, to allow new packages to be installed and old packages to be removed (after this process, I had to re-install a number of my packages).

# apt-get update && apt-get dist-upgrade

And if that runs smoothly without a hiccup, you just got very lucky. Be ready with apt-get -f install, and be prepared to spend some time fixing some dependency breaks. You may have to download some packages and install them manually with dpkg -i --force-overwrite and such.

Note that there are better and worse times to switch to Wheezy (or unstable, Toy Story codename: Sid). You can get a feel for weather* now is a good time at Debian's weather page.

* Awful pun intended

Update 24th Oct 2012:

It's also worth pointing out a handy pre-upgrade step:

# apt-get -s dist-upgrade 

This runs a simulation of the upgrade without actually upgrading anything (it can be invaluable to know if there are any terrible dependency breaks before you actually commit to the dist-upgrade). 

Next > Guest Installation (Take #2)