Control the controllable.

Powered By Php

Mysql Logo

Powered By Apache

HOWTO: Windows XP running under Xen 3.0 on Ubuntu Dapper Drake
Posted by Joel (joelh-website at planetjoel dot com) on Friday, 30th of June, 2006 - 11:46:05 PM

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

Add a comment

Comments

All comments owned by their poster.

Name: sherman
Email: orinoko at gmail dot com
Time: 1/7/06 - 21:45:36

I take it that people who have Mobile Centrino chips (like used in the Dell Inspiron 9300) will be left out and cannot use Xen? I was very tempted to do this... I am sick of having a wasted 20gb partition 'dedicated' to xp...

Long live Ubuntu.

Name: Eric the Red
Email: not at home dot com
Time: 2/7/06 - 05:58:54

"I haven't tested the stability that heavily because my laptop has a tendency to restart while running Xen."

Yeah, I'd say it isn't very stable then.

Name: Chris
Email: chris13610 at yahoo dot co dot uk
Time: 2/7/06 - 11:32:41

Followed the install on the HowtoForge.com site, then folowed these instructions.

All works up until I type 'xm create winxp'. Xen complains that there is no file called '/usr/lib/xen/boot/hvmloader'. It is right. The file is neither in that location nor anywhere else on the machine.

Spec: Dell 430SC, 512Mb RAM, Pentium D 920, Ubuntu Desktop 64bit Version 6.06, Xen 3.02

Any idea where I should get this file from?

Thanks for the howto.

Name: Joel
Email:
Time: 2/7/06 - 17:02:52

Did you install Xen 3.0.2 ? I'm not sure whether its in 3.0.1 . If it hasn't been installed correctly the file is in the unpacked install directory in install/usr/lib/xen/boot/hbmloader .

Name: Bill
Email: billquinn1 at earthlink dot net
Time: 3/7/06 - 05:45:19

I don't use Xen but VM server does a great job of this. Check for tutorials on the Ubuntu forums. I,m using the Vista beta but XP should work fine as well.

Name: d0nk3y
Email: heydonkey at gmail dot com
Time: 4/7/06 - 14:58:35

OT but it appears you use a Vaio.

Would you mind me asking what model and how you find Dapper running on? ACPI etc?

Thanks!

Name: aenertia
Email: aenertia at aenertia dot net
Time: 16/7/06 - 03:34:29

Okay, big question, can you use an existing windows install. My partner is in Singapore and lo and behold new laptops don't come with instalation media. She has a dell xps 1210 running dapper, and I want to install xen for her... but the big question which I have not seen answered in any of the VT + XP + Xen tutorials floating around is if you can DD or just use an existing windows partition to a) create an image to use or b) access directly.

Also I heard that there is a patch to allow nvidia to work somewhere... any joy with this?

Name: bubbaganoush
Email: troybargen at gmail dot com
Time: 15/10/06 - 10:55:56

I've got it running with xen 3.0.3 but the mouse doesn't work right.
Sometimes it doesn't even appear. Sometimes it does but it's extremely erratic and pops up all over the place randomly registering clicks like it's on crack.

Name: asian handjob
Email: ssslkd at mail dot com
Time: 19/3/07 - 17:09:52

{links:20

Name: Adam
Email: haircut at gmail dot com
Time: 18/4/07 - 20:45:52

Any idea how to start the Windows domain headless (or if this is even possible with Xen)? It doesn't seem to be able to live without the "HVMXEN" window.

Name: powerade1
Email: powerade1 at gmail dot com
Time: 2/6/07 - 18:41:34

Really nicest

Name: Stuart
Email: stuart at polonious dot com dot au
Time: 4/7/07 - 18:44:15

This example seems to focus on a new install of windows XP. I would like to do this sort of thing with an _existing windows XP install. Is this possible with Xen? Do these instructions also apply in this case?

Name: kolaloka
Email: topiarz theroundedthing post dot cz
Time: 9/9/07 - 12:07:56

Well, I fancy Xen, but for ordinary people (I am not one of them) VirtualBOX is the thing for virtualizing windows on linux. Googlefor it, it is free and opensource. Good luck.

Name:
Email: primecups_com at gmail dot com
Time: 28/9/07 - 08:57:14

AHZ

Name:
Email: primecups_com at gmail dot com
Time: 28/9/07 - 08:58:44

AHZ

Name: dkzxy
Email: yjszp at mail dot com
Time: 6/10/07 - 11:18:10

Nice site.

Name: asef
Email: asdf
Time: 1/11/07 - 13:06:24

I really wanted to like Xen but just how darned hard do they want to make it on you to get it working with Ubuntu. Gotta love the copious amounts of documentation too. Plus I'm reading that people are having mouse problems, etc. etc.

It's no wonder open source projects die or don't get adopted worth a crap. If it takes 10 hours of research just to get it working and all the parts don't exist harmoniusly, who the hell has the time for that. Most people have other business matters to attend to. VMWare rules!!

Name: Vince
Email: mvincent at jojo dot com
Time: 2/11/07 - 16:05:18

asdef,
Open projects are not crap, but people like you who advertise proprietary projects are in deed BIG CRAP.
Yes you need a certain amount of time to fix things up especially if the project's release is new... but damned, once it's on the road... let's go and dance baby!:)
Time is the sacrifice that the community has to pay to guarantee its freedom. For example who can say now ubuntu is not an alternative for xp and people can't use like they use xp??? NOT true anymore!!!! Even babies can run Ubuntu!!! See, this what TIME and CONTINUOUS efforts produce: A ROCK SOLID SYSTEM.
So if you dislike, go and your crap out of here!

Name: vasil
Email: jwbfd at mail dot com
Time: 1/12/07 - 20:26:14


Name: Dov
Email: dashford at G mail dot com
Time: 8/1/08 - 16:23:23

"""Time is the sacrifice that the community has to pay to guarantee its freedom."""

And Freedom IS the issue here !!

PS:
i have a hp dv9627cl that came "Vista ready"

it has 2 hard disks so i loaded UbuntuStudio on one and tried to replace Vista from the other with XP --- NO GO!! XP cant run it!!!!
ther are no drivers for audio card webcam usb
,yet unknown nvidia chipsets,...etc.etc
so I now run xp on Xen in Ubutu7.10 ---It all worked out of the box except for vnidia 7150M card, i had to enable the propryitary modules for that !

PS:
even the cool touch buttons and the remote control work out of the box.

open source is the foundation of free speach and a equalizer of minds and monneys, forcing the self taught and those that can aford education or degrees to compeat 1.1 with other minds

10 hours to some should be worth the same to anyone!!
unless one life is somehow worth more than another ?
that it not the world i want, but because of money it is the world i live in!!

This can change!

(there are more people without than with),
They will end up using the tools built by tool users!

those tools Work!

Name: Hi
Email: webmaster at excellservices dot com
Time: 11/2/08 - 09:21:21

zrya ti tak
webmaster@excellservices.com
zrya ti tak

Name: Warren
Email: warren at wbgraphy dot com
Time: 5/8/08 - 09:19:29

Thanks for the guide, it was a good start to add a xp domU: my sys details + cfg as follows for anyone as a guide too. The bellow worked smooth, no issues to date, just initial cfg setups.

Asus mobo, 8gig ram, quadcore, nvidia pci express g/c. Nothing else special.

Ubuntu 8.04 - 2.6.24-19-xen
xen 3.2.1 rc1-pre

kernel = "/usr/lib/xen/boot/hvmloader"
builder = 'hvm'
memory = 2048
name = "winxp"
vcpus = 2
vif = [ 'type=ioemu, bridge=xenbr0' ]
disk = [ 'tap:aio:/home/xen/domains/winxp/WinXP.img,ioemu:hda,w', 'phy:/dev/scd0,ioemu:hdc:cdrom,r' ]
device_model = '/usr/lib/xen/bin/qemu-dm'
ne2000=0
#boot='d'
boot='c'
vnc=0
vncviewer=1
sdl=1


Installed and running RDP to is very well now. Thanks again for the pointers.

Name: smoochie
Email: smoochie at hotmail dot com
Time: 30/10/08 - 10:56:26

mmmm yay for this guide I use xp to run autocad this allows me to run it in a ubuntu environment since wine doesn't work very well yet. thanks for the help!