HOWTO: Windows XP running under Xen 3.0 on Ubuntu Dapper Drake

Introduction

Xen is new virtualization technology that is just starting to become very big
mostly thanks to its speed and ease of use on linux compared to similar products. We use it on some
production servers and although the product is still young and unstable its
still very usable and is getting much better with every release. VT is new
virtualization technology supported by most Intel Dual Core processors that
enables virtual applications to be run through a new instruction set. Xen
normally requires that you have a modified guest OS that is aware it is a
virtual host and can communicate with the physical host (called the Dom0 for
Domain-0) however if you have a VT enabled chipset then Xen can launch
unmodified processes such as Windows. This article explains how to get windows going under Xen.

Windows on Xen is still very new and so there is currently very little documentation about it. I haven’t tested the stability that heavily because my laptop has a tendency to restart while running Xen. The console itself is far too slow to use directly probably because Xen was never meant to be used as Desktop virtualization software so I tend to connect over rdesktop. Will I continue using this on my laptop? No. Xen doesn’t yet support ACPI very well and I don’t think it works with the nvidia binary drivers. I think Xen windows is really useful in server environments with people using RDP. No more sharing the same RDP machine and fighting over it all day, give each person a VM! Hopefully you can get cheap licenses somehow ;-).

If your interested in getting Windows going on linux you should also check out:

  • VMware. VMware recently released their server version for free. It also supports VT technology.
  • Parallels. Parallels is more widely known bringing Windows Virtualization to the Mac. They have recently released a linux version of their product which from our early tests looks very promising. This is what I want to experiment with next.
  • Qemu. Qemu is the traditional linux virtualization software and has been around for a long time. I believe KQemu adds VT support.

Howto

You will need a VT enabled processor to get this to work. Intel Dual Cores and Intel Xeons all support this. AMD A2’s are supposed to be compatible but I don’t know whether they are supported yet. Google your processor to find out whether its supported.

First thing you will want to do is follow the guide at HowtoForge.com for
installing Xen on Dapper Drake. I installed Xen 3.0.2 instead of 3.0.1 but the guide was mostly spot on and unfortunately you still need to do all the workarounds mentioned in the guide.

You then need to ensure that VT support is enabled for your system. With my vaio laptop I didn’t need to do anything – you may need to go into the bios and enable this feature. Once booted into Xen check that VT support is enabled for Xen.

$ xm dmesg | grep VMX
(XEN) VMXON is done
(XEN) VMXON is done

If you do not see a VMXON message then Xen has not detected that VT support and you will not be able to install Windows. Check that your processor does indeed support VT and that it is enabled.

Make an image for your XP installation. You probably want to keep it fairly small and keep most of your files on the network or internet. This will take a few moments while it fills up the disk. 4096 is the number of megabytes so mine is 4 gigs, pick an appropriate size for your needs.

$ mkdir -p /var/xen/images/
$ dd if=/dev/zero of=/var/xen/images/WinXP.img bs=1M count=4096

Edit the file /etc/xen/winxp and set up something similar to this config. You may want to increase the amount of memory. Also make sure that your cdrom line points to your cdrom device (and not the /dev/cdrom symlink that doesn’t appear to work). Note boot=’d’ means boot off the cd-rom drive, once Windows is installed you change this to boot=’c’.

kernel = “/usr/lib/xen/boot/hvmloader”
builder = ‘hvm’
memory = 512
name = “winxp”
vcpus = 1
vif = [ ‘type=ioemu, bridge=xenbr0’ ]
disk = [ ‘file:/var/xen/images/WinXP.img,ioemu:hda,w’ ]
device_model = ‘/usr/lib/xen/bin/qemu-dm’
cdrom=’/dev/hda’
ne2000=0
boot=’d’

Start up the VM and cross your fingers.

xm create winxp

Here are some screenshots of it in action:

If you run into any problems here check out /var/log/xend.log to see what the problem is. One problem that I ran into was the “Integer expected” problem. I uncommented lines one by one until I found the offending line and fixed it up.

A window will appear now and the Windows installation process will begin. Then you can simply install Windows as you normally would. Here are some screenshots:

License Agreement


Weeeee installing


A problem I experienced installing the network drivers. I just ignored this and restarted. Didn’t see any problems because of it.


Windows Desktop


Connecting via rdesktop


Digg this article

Leave a Reply

Your email address will not be published. Required fields are marked *