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

3

2

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.

What is the reason KVM can't boot the block device? If I reinstall, can I still use the partition for ordinary dual-boot?

Note: I ran the VM manager as root, so it should be no permission issue.

Hanno Fietz

Posted 2009-08-14T09:28:11.443

Reputation: 1 045

At what point of the boot does it fail? Do you see it POST? – Stephen Jennings – 2009-08-14T10:25:45.753

Yes, I get the BIOS messages, a list of the harddrives, "Press F12 for boot menu", then "Booting from Hard Disk", and then, nothing. – Hanno Fietz – 2009-08-14T12:15:25.240

vista failed to find a driver for the sata in my laptop when I tried this. – Arthur Ulfeldt – 2009-08-18T22:19:53.827

Answers

1

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.

Stephen Jennings

Posted 2009-08-14T09:28:11.443

Reputation: 21 788

OK, but should I not see at least some sign that the Windows kernel was actually loaded by the VM, such as the windows logo, a "Starting up..." message, even a bluescreen? It seems to fail much earlier. – Hanno Fietz – 2009-08-14T10:16:31.470

Given your most recent comment, my only guess is that the HAL doesn't have a clue what to do in the virtualized environment. – Stephen Jennings – 2009-08-15T02:25:33.297

3

This is wrong. It is possible to boot native and from VM.

Take e look at "HOWTO: Windows XP in both VM and native" or KVM related you cold it do like described on "Booting Windows XP from raw disk with Linux KVM".

Matthias

Posted 2009-08-14T09:28:11.443

Reputation: 31

0

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.

cjs

Posted 2009-08-14T09:28:11.443

Reputation: 380

0

i would say in the windows and run "sysprep" ( this strips the HW tags and unique identifiers) then boot the vm passing the raw disk to the vm.

Pere Noel

Posted 2009-08-14T09:28:11.443

Reputation: 11

https://www.howtogeek.com/239815/why-cant-you-move-a-windows-installation-to-another-computer/ This might work, however it will de-activate your OS and is officially unsupported. So, backup first, and be wary. – music2myear – 2017-03-20T17:06:15.197

even if they do not support it you may still be able to call their support and get the activation code ( it was an automated system) but yeah backing up is a must specially both registery files . personally i would "dd" the drive into another blank drive and use that as a test . – Pere Noel – 2017-03-21T23:03:04.580