Archive for September 2008
23
Running an Ubuntu Hardy Xen domU under a CentOS dom0
1 Comment | Posted by admin in Virtualisation
As pretty much always with Linux there’s more than one way to do this, but here’s how I got a nicely working para-virtualized Ubuntu Hardy domU running under a CentOS 5.2 dom0:
- Install hardy under an HVM using the standard ISO
- Boot into your new hardy install and run
sudo apt-get install linux-image-xen(make sure you have universe enabled) - Add appropriate settings to your /boot/grub/menu.lst – here’s what I added:
title Ubuntu 8.04.1, kernel 2.6.24-19-xen
root (hd0,0)
kernel /vmlinuz-2.6.24-19-xen root=/dev/mapper/dsk-root ro
initrd /initrd.img-2.6.24-19-xen
- Add a console on xvc0:
sed -e 's/tty1/xvc0/' /etc/event.d/tty1 | sudo tee /etc/event.d/xvc0 - Power off your Ubuntu VM
- On your CentOS dom0, alter the Xen VM configuration file to boot using pygrub, very basic example below:
bootloader = '/usr/bin/pygrub'
memory = 1024
name = "ubuntu-test"
vif = [ '' ]
disk = [ 'phy:/dev/san1/ubuntu-test,xvda1,w']
- Restart your Hardy VM and enjoy massively improved performance
One thing missing from the para-virtualized VM is VNC support – you have to use the console via the ‘xm console’ command.
The procedure should be similar for Citrix XenServer, although it will involve some messing with the xe vm-param-set command rather than editing the config file. When I have a chance I’ll document this too.
Update, 30/9/08:
To enable a VNC console, do the following as well as the above:
- Add the framebuffer drivers into the initramfs
echo "fbcon" | sudo tee -a /etc/initramfs-tools/modules
echo "vga16fb" | sudo tee -a /etc/initramfs-tools/modules
sudo sed -ie 's/^blacklist vga16fb$/#&/' /etc/modprobe.d/blacklist-framebuffer
- Re-generate the initramfs
sudo update-initramfs -u -k all
- Alter your grub menu.lst to include the boot options console=tty1 vga=normal (best done via the defoptions line, I tend to remove quiet and splash from here too)
Reboot, and you can now use a VNC console as well as the Xen xm console command.
Installing trac today, I realised there wasn’t any obvious way to change the date format, and all bugs report dates were showing in MM/dd/yy format – less than ideal for us here in the UK.
Fortunately, after some Googling, I found the way to alter this is to add the following to your Location tags in the Apache config:
PythonOption TracLocale en_GB
(Replacing en_GB with the appropriate locale for you).
This unfortunately doesn’t help if you have a trac installation which is likely to be used by people in multiple locales – if anyone knows of a way to achieve this a comment would be appreciated.
Dave Cancel has a good article on the merits of using Amazon S3 as a content delivery network. He evaluated CacheFly, EdgeCast, Amazon S3 and Nginx running on Amazon EC2 – and found Amazon S3 performed the worst.
I know quite a few people either using or considering Amazon S3 as a CDN – this test would suggest that it’s perhaps not the best strategy. In fairness to Amazon S3, I think the performance would have been shown to be greater had he used the option of additionally having the file on S3 Europe, and had visitors dynamically sent to the correct location via DNS. Of course, it could be argued that one of the points of using a CDN is that you don’t have to do that sort of thing yourself. As far as I’m aware S3 has no option for global load balancing.
Some of you may have heard about the kerfuffle surrounding poor Perl performance on Red Hat 5/CentOS 5 – it got a bit of attention on reddit/digg. Red Hat had been issuing hot fixes to people who complained, but now Karanbir Singh has created an updated Perl package.
This issue should be fixed in RHEL/CentOS 5.3, but until then, if you’re experiencing slowness I’d advise installing this – after appropriate testing on staging/UAT servers of course.
The final version of Django 1.0 has been released. Debian packages are available from the unstable repository and these should install cleanly on Ubuntu too.
As I noted previously with the Alpha releases, an RPM for RHEL5/Centos can be built by doing:
python setup.py bdist_rpm
Note you’ll need an updated MySQL-python library installed, which can be found below.
MySQL-python-1.2.2-1.x86_64.rpm
If you’re not using a 64bit server, you can download this source RPM and rebuild via rpmbuild –rebuild:

