Home » Questions » Computers [ Ask a new question ]

How can I run an existing WinXP partition (dual boot machine) inside KVM?

How can I run an existing WinXP partition (dual boot machine) inside KVM?

I use KVM to run virtual machines on Ubuntu Jaunty and virt-manager to configure them. My machine is dual-boot, and I don't want to have to reboot for my occasional uses of Windows. So I set up a VM that uses the Windows partition's block device as a harddisk. But when I boot that, the boot just hangs forever. Booting from the Windows install CD works and the harddisk is then recognized, so reinstalling would probably work.

Asked by: Guest | Views: 319
Total answers/comments: 2
bert [Entry]

"Your existing Windows XP partition was installed assuming certain things about your hardware (your particular motherboard, CPU, chipset, etc.).

When you boot that partition inside a virtual machine, Windows sees a radically different set of hardware. Windows' installed configuration is unlikely to match the virtual hardware that KVM is presenting it, and so it will not boot. This is exactly as if you pulled a hard drive from one computer, put it in a totally different computer, and tried to boot it (this is unlikely to succeed).

It might be possible to get Windows to recognize a different hardware configuration by setting up a second hardware profile in Control Panel -> System -> Hardware -> Hardware Profiles, but for such a radical change between real hardware and virtualized hardware, probably not."
bert [Entry]

This LinuxJournal video describes how to do this with VMWare by setting up two separate hardware profiles, one for native and one for VM, and having Windows wait to boot until you've selected the appropriate hardware profile. I'm not yet clear on whether this can be done with KVM, but if it can, presumably it would use a similar technique.