Archive for the 'xen' Category

Virtual Machine Manager for Xen

Tuesday, October 24th, 2006

XenAlthough I’ve ran CentOS on servers in the past (Open-Xchange, for example), I’ve never used Fedora much myself. Still pay attention to what they’re up to with Fedora though, as although Red Hat may be a tad slow + immobile at times due to their size, they do sometimes bring out cool tools. Their latest release of Fedora Core 6 drew me to Virtual Machine Manager, a GUI for Xen virtual machine management. I still have my Xen server sat by my feet (am kicking it now, for no particular reason!) and keep meaning to mess around with it again, and although I wouldn’t use virt-manager much with only a handful of VM’s, it looks very cool if you were running multiple VM’s, such as for web hosting. Although remote management, i.e. connecting to remote hypervisor isn’t quite up + running yet, it looks very promising.

Pre-compiled Linux distros for Xen virtual machines

Thursday, April 27th, 2006

Having spent a couple of weeks now playing with Xen, I have found it quite a struggle to find decent documentation explaining exactly how to install various Linux distros to act as virtual machines. After going through setting up Debian as my Xen server and a sample domU, any instructions on installing Gentoo, CentOS, Fedora, etc. all assumed you were already running those distros as the base distro. debootstrap could get me running Ubuntu, but that was about it and domi didn’t seem workable on Debian.

Xen SourceSo, having trawled through some Xen newsgroup posts, I stumbled across jailtime.org, which provides pre-compiled, compressed images for CentOS 4.3, Gentoo 2005.1, Slackware 10.2, Debian 3.1, Fedora Core 4 + Fedora Core 5. As I’m not running my Xen server in a production environment, I don’t have any real qualms in putting my trust in someone not to have compiled something naughty into these images, though I don’t have any reason to believe there would be! Each distro is about 100Mb-120Mb in size, and each image takes about 5 minutes to extract and configure making it very quick + easy to have multiple distros running with the minimum of fuss.

Pick an image for the distro you require, and don’t forget to check the steps involved in using each image:

A slight problem has been in that the sample configs are assuming /dev/sda to be the drive in use, and the images are pre-configured with fstab’s reflecting this, along with network configurations grabbing addresses via DHCP. After changing the Xen configs to use /dev/hda (or whatever hard drive layout you’re running) and then using ‘xm create‘ to load your new virtual machine, you’ll probably get an error thrown as the system can’t mount the drives, dropping you to a recovery console. Simply remount the drive read-write, edit fstab to reflect your hard layout, and reboot:

mount -o remount,rw /
nano /etc/ftsab
Ctrl-D

And bob’s your proverbial uncle :-) Might look at expanding on some already-available scripts to handle the automatic creation of whichever domain is required, including the downloading of the image if not already available locally, though I’m already being distracted from at least two other little coding projects at the moment!

Setting up Xen 3.0.1 on Debian

Friday, April 14th, 2006

A few people have asked what happened to my stack of Ultra 5’s and the Gentoo network servers. To be honest, I just didn’t have the time or drive! Although it was good fun at first, they were just so slow compiling source it got annoying. They’re still sat there and I occasionally play with them, but not much!

Xen Source server for virtual machinesInstead, I now have my new test server up and running based off my old Athlon XP 2800+. It’s powered by Debian at the moment rather than Gentoo as I found a wonderful guide on setting up Xen and creating your virtual machines. For those not familiar with Xen, it’s an open source server virtualisation system along the same lines as VMWare, though without all the pretty buttons to set everything up! It allows you run multiple operating systems at the same time from the one system, meaning you cut down on hardware + maintenance costs, and for situations like I’m running, means you can run multiple servers from the one machine :-)

Now that I’ve got it up and running it’s actually very, very impressive. The documentation is clear and they have very good IRC channel (##xen on Freenode), but I still spent a good while trying to get the networking going which had everyone stumped. Am good at coming up with these things! I had dom0 setup, which is your host server, and had created a couple of domU’s, your virtual machines. But, I had no networking from the virtual machines. The idea is your host system handles the routing using virtual interfaces and a network bridge, but it wasn’t working. Whenever you tried to ping anything, it would return “Destination Host Unreachable“, indicating something at least was working.

Doh!After checking through various settings, re-building virtual machines, running tcpdump to monitor traffic, etc. I finally stumbled across the problem whilst trying to manually create the bridge using the ‘/etc/xen/network-bridge‘ script. The cause? Xen looks for, and only for, a physical connection on eth0. It sets up peth0 which seems to handle the virtual routing alongside xenbr0, your network bridge. I was using eth2, not eth0, so although everything appeared fine, peth0 had no link with eth2 and so all domU virtual machines would have no network connections. Switch yer cable into eth0, bring the interface up and everything works.

Very annoying, and possibly something catching quite a few people out since there’s a number of identical problems strewn across forums, message boards and blogs. Gonna check if a bug has been filed for this, as Xen should check for which eth is active and link peth0 with it. Now that it’s resolved, I’m finding it very impressive - you simply ssh into your virtual machines as normal and since you have a standard Debian install running, can do whatever you want. Will start building on the network services over the next few days and linking the virtual machines together simulating a virtual server rack to see how Xen handles it, but it’s certainly a very powerful tool