Two days ago we got that new Pentium D9xx machine. Yesterday it was done, and I had Windows running on Xen running on Debian. Here’s how:
First things first: if you don’t know about virtualization, maybe you should read about it. In the server and webhosting market, it’s the future, which has begun already. At home, it will begin a little later maybe, but in our opinion, it’s unstoppable - especially if you do it all with free and open source.
Wikipedia has a nice intro about virtualization, and LinuxJournal had a good article about Xen3, which I’m covering here. Of course, use the source: both the University of Cambridge, where Xen was developed, as well as Xensource are places to start with - even if it’s only for screenshots.
If that has whetted your appetite enough, what do you need? In the case that you’re only running free software (like we do at home), nothing special - any good Linux distro, Xen of course, and enough main memory. That’s it. But if you want proprietary operating systems like at my employer’s, you need a bit more: a processor which supports virtualization out of the box. This means: only the newest Intel Pentium D9xx and Core Duos, as well as AMDs AM2 line of dual cores, or the newer Turion X2. I did all the following with a Dell Precision 380 which has a Pentium D940, 4GB of main memory, two 160GB Seagate disks, and a Philips DVD burner.
Furthermore, you need Debian. Really. It makes installing Xen so much easier, thanks to the Debian Xen Team (see also Bug #368496).
Ok, so you need Debian, or to be more precise: you need the ‘Sid’ or ‘unstable’ flavour of Debian. Now where do you get that? Here for instance. Or if you have Debian Sarge or Etch on that shiny new hardware already, simply edit your /etc/apt/sources.list - simply change ’stable’ or ‘testing’ to ‘unstable’, then ‘apt-get update’ and ‘apt-get dist-upgrade’, and you have Sid. That easy, yes. Or maybe by the time you read this, it’s in ‘testing’ (better known as ‘Etch’) already. I for my part hope it’s bug-free enough, so that it can be released together with Etch in December…
The further steps after installing Sid are covered by and on Andrew Pollock’s blog - tho now there are newer packages available already; I for instance used linux-image-2.6.16-2-xen-686 instead of the -1 he mentions. After that, you have to reboot - you just changed your kernel, so that’s one of the rare times you have to reboot Linux to get it being used. And voilà - up comes your Xen kernel together with the dom0 you edited into grub.
Ok so far - you could now go on reading the documentation or taking the examples from /etc/xen, but what helped me getting things done very fast is another blogger: read all about Windows on Xen on Jon McCune’s weblog - with his ‘winxp.xm’, which worked for me, you’ll be successful in less than a minute. As you can see here:

You see that I took KDE to start with, which takes a lot of resources for itself, so by now I’ve changed that to IceWM. The Windows machine (a server 2k3, not an XP) feels pretty happy with it tho:

And also running a second one at the same time was no big problem:

On IceWM, it looks a bit more bare, but works nonetheless:

The final “problem” was: in the beginning, I was only for a very short time thinking about setting up RAID or LVM or things like these - in fact I left the second harddisk all alone and begun to work with only one. Now I wanted the second physical harddisk in that machine formatted with NTFS, so that it could be used by these virtual Windows servers. And even that was possible: from within a virtual guest machine, I could actually format hardware on dom0 (after allowing that):

Cool. The rest is finetuning, like playing around with memory, or making virtual machines boot automagically together with Debian and Xen.
Ok, what have we achieved, and why is it an advantage over normal setups?
Well, to start with: Debian/Xen run several of these virtual machines at the same time, so you can start, stop, destroy, or even move these machines around as you wish - no sweat, and no hardware wiring are needed anymore. Second, it’s cheaper - you need only enough memory to do all this (plus in our case, you’ll need Windows licenses of course).
Why do we think that this will be successful even for home usage? Well, imagine: instead of running 2 or more instances of Windows, you could as well build strong protection layers around that operating systems - using iptables and all the good stuff which is available for free. Or you could have server-/client-scenarios. The possibilities are endless, once you begin thinking about it. Plus it’s built into the newest generation of Core Duo laptops already, and the desktops wouldn’t lag much behind.
For me, it was reading/mailing/trying out things, and after 24 hours or so, I had it working. For you, one day, it will be built into the Debian installer as just another kernel option. That is how open source works, and that is why we prefer it to anything else. The future is here - now go and make use of it.
I recently built a Pentium D930 based PC and I am planning on installing Debian/xen and also a windows_XP guest. The description in Andrew Polock’s blog indicates 32 bit kernels…what did you use for your machine? did you try the AMD64 kernel?..I am planning to try that, Any advice on pitfalls?
Thanks
Hi Ted,
yes, first I tried the 64 bit kernel, but somehow I didn’t get it running. So I thought: “Hmm ok, maybe you are missing something here, or you cannot build the initrd or whatever”, and so I went with the described way and tried the 32 bit route - which worked right away.
I’m pretty sure that by now I would get a 64 bit kernel going as well, but the machines are long gone, and they are used by our developers and QA engineers and so on - so I have to wait until I get an AMD64 machine next time.
Pitfalls? Well, disk performance for starters - if you’re writing into a flat file (or even a compressed one) instead of a real partition and file system, this slows the whole thing down on I/O intensive things.
Otherwise, it was quite ok for me - but I’m no Windows user, so I cannot say much. I think usability is something for Windows guys - AFAIK they ripped down my Xen installation after a few days, and installed VMWare (on Windows) instead. Ok with me - it’s their machine, and I only wanted a proof that it works.
cheers,
wjl aka Wolfgang Lonien
What about taking a new Windows XP(media edition), shrinking the partiton.. installing FC6, running Xen and booting your Windows partition?
I understand about the real HAL vs the virtual HAL.. and how I would have to reload a bunch of drivers and risk corrupting stuff.. but I heard someone once mention “using different hardware profiles” in Windows. Is this possible? To put Windows into a “real mode” vs “Xen HAL mode”? Could this different hardware config be controlled by a boot.ini or something? That would be ideal.. no?
Tweeks
Hello Wolfgang,
i Know the Thread is Old, but can you do some I/O Performenc Benchmarks.
Or you know any Website with Test/Benchmarks,
I want see the Difference between the Real and Virtualization Windows.
Thank you.
monstar-x
Hi!
I have installed xen on sles, with a 2000 server runing actually.
I want to take an old server that is now running (w2k3 server std)and convert to one virtualizated image on the new machine, do you know how to do this?
How about the benchmarks? My machine runs too slow on my opinion …
Thanks for the help.