Ot: using kernel-based virtual machine to run Windows XP

Garrett Klein garrettklein at comcast.net
Wed Aug 13 14:19:23 EDT 2008


Janina,

I figured out my sound problem. Windows XP doesn't like the Ensoniq PCI 
sound card. What I had to do was start XP with that sound card, manually 
install the driver for an old ISA Soundblaster 16, then restart the vm 
with -soundhw sb16.

As to getting everything set up, you need 4 things.

1. A recent Intel or AMD processor (basically any Intel Core 2 Duo or 
AMD Athlon64 X2 on socket am2 or AMD phenom).
2. The appropriate kvm options compiled either into your kernel or as 
modules. I have kvm and kvm-amd running here.
3. The kvm program itself, which is really just a slightly modified 
version of qemu. Gentoo has it in a package called kvm, I don't know 
what Fedora or Debian/Ubuntu do in that regard.
4. A Windows XP CD. Personally I don't care to break the law, but I do 
understand the need for disgression in these things sometimes.

	Before starting the vm, you need to create a disk image with a command 
like:
kvm-img create -f qcow2 winxp.img 20G
This creates a 20 gigabyte disk image, which will only take up as much 
space on your hard disk as your'e actually using. Then to start the 
install you would do
kvm -hda winxp.img -cdrom /dev/cdrom -boot d -m 512 -net user -net nic 
-soundhw es1370 -localtime
You could also replace /dev/cdrom with the name of a .iso file.

Then, you need to have a pair of eyeballs. Note that there is one part 
of the XP installation that *requires* a mouse! It is where the Windows 
installer automatically adjusts your screen resolution ETC.

Once XP is installed, I use a little shell script to launch it

---script starts here ---

#!/bin/bash
#Shell script to start Windows XP.
#This assumes you've installed the sb16 drivers in Windows ... feel free 
to modify as appropriate.
export QEMU_AUDIO_DRV=alsa #Alsa gives much better performance than the 
default sdl audio driver
kvm -hda winxp.img -m 512 -net user -net nic -soundhw sb16 -localtime $@
--- Script ends ---
To give the keyboard and mouse focus to the kvm, use the left control 
and left alt keys, i.e. press control-alt.

I hope this helps any of you looking to run a virtual machine. It really 
does run at near native speed, although due to the crappy sound card 
Windows needs to work propperly the sound sucks ... but yeah.

Garrett

Janina Sajka wrote:
> I'd be really interested to hear how you went about setting up KVM. If
> you have a moment to write up some notes on this, I'm sure I wouldn't be
> the only one paying close attention. Thanks in advance.
>
> To my mind there are two divisions to this task; 1.) setting up the
> environment and 2.) preparing and launching the guest OS installation.
> Any light you can shed on this would be most appreciated.
>
> Janina
>
> Garrett Klein writes:
>> Has anyone gotten KVM to run Windows XP successfully? I installed it
>> fine and got JAWS set up, but sound dies randomly. ...
>
> _______________________________________________
> Speakup mailing list
> Speakup at braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
>



More information about the Speakup mailing list