Installing Xen Virtualisation with a Windows XP Virtual Machine

Initially when I wrote this article, I was disappointed that Windows was slow.  Now, I know that this was due to a number of reasons.  First, using simple partitions that end up with the installation inside an image file is just bad.  The I/O performance is very bad and installation took around 1 hour and 30 minutes.  Now, however, I've just found with my Quad Core and 8GB of RAM, that it's now actually pretty damn good.  Except that now, instead of using a simple image file, I'm using LVM volumes on my disks, and so created an LVM volume for me to use with Xen.  This meant I just did:

lvcreate --name winxp --size 20G vg

where the name of the volume will be winxp, with a size of 20GB and installed in my volume group called vg.  My LVM howto will help you get familiar with LVM.  Also, in addition to the LVM volume, I also used the Xen paravirtualised drivers for Windows.  This means that Windows should actually be a lot faster now.  And after installation and quick testing, yes it was!  Now that I'd gotten the LVM created, I just had to ensure that Xen was installed.  So, in CentOS it's as simple as clicking Applications --> Add/Remove Software and then selecting the section for "Virtualization".  Or, if you prefer the command line, then this will do the trick:

yum groupinstall Virtualization

and sit back while it installs all the packages you need.  Then reboot, ensuring you select the Xen kernel to boot your system. Previously, I mentioned that you need qemu - well - you don't!  You don't need anything else, other than Xen installed.  You connect to the Xen hypervisor, and you install a Fully Virtualised machine.

Once up and running, you're ready to click Applications --> System Tools --> Virtual Machine Manager.  If you don't give the root password, then you're not going to be able to use a lot of the functionality - so suggest that you enter it rather than bypass it.  By default, you'll have the xen localhost hypervisor showing as disconnected.  If you double-click it, it will connect.  This is where you install your Para-Virtualised systems.  If you want to install Fully Virtualised, then click File --> Open Connection and then select the "Xen"hypervisor. Now, create your new machine.

One thing I do is ensure that I have enough memory available for my machine.  When I created my Windows XP machine, I set it as 1024MB for allocated and maximum machine memory.  When it comes to partitioning, Normal partitioning should be selected, and then you'd just type /dev/vg/winxp - depending of course that your volume group is vg and your LVM being called winxp like mine is.


Originally when I tested installation, it was taking ages.  This could have been due to my Intel Dual Core laptop with 4GB of RAM, than compared to my Quad Core with 8GB, although the machine had 1GB of memory on both machines when I did it.  Also, the hard disks are good in my desktop with 32MB of cache - so perhaps this also helps.  Anyway, Windows XP seemed to be fine, no sluggishness like before when I did this.

What you will find is that after the blue screen installation, you have to check the CD-ROM device, add it again if it's not there, or just select the ISO or CD-ROM drive again to ensure you're able to continue with the GUI installation.  So I had to go into Details and add this again to continue the installation.  It's best that you remember this and check the machine before you power it on again to continue the installation.  This also was strange, it doesn't reboot after the first install, but powers off.  But I can live with that.  Means I can add the CD-ROM again without having to power it off manually.

This time around, I was finding performance of Windows XP a lot better than under VMware 1.x or even 2.x.  But then, any proper GUI management tool is going to be using a web interface to manage your machines!

This time around, installation was really good, five minutes for blue screen install and then 11 minutes for the GUI install.  That's better than installing on a real machine!

Start time: 19:22
End time: 19:39
Total: 17 minutes

Stage 1 - Blue screen install: 19:22 - 19:27
Stage 2 - GUI screen install: 19:28 - 19:39


My previous comparison made VMware seem to be faster and a better choice for Windows virtualised machines.  Now it seems this is not the case.  This can possibly depend on a number of things, such as hardware and simple versus LVM volumes for the machines.  With Xen, LVM is the preferred and standard choice it seems, so it's simply best to stay away from the simple volumes altogether and get used to using LVM.

When the para-virtualised Windows drivers were installed, the machine performed even better and means you can get near-native speeds with Windows machines now - something that isn't possible on VMware Server.  Not even VMware ESXi, although VMware ESXi is better than VMware Server 1.x and 2.x, but requires special supported hardware for it to run.  Whereas with Xen, you can put it on anything that will run a Linux distro, but performance will vary depending on the specs of your machine and components.

You can get the Windows para-virtualised drivers here .