Can I virtualize a pre-installed Windows 7?

Solution 1:

There is a section in the VirtualBox User Manual explaining how to use a real disk or partition in a virtual machine.

I tried once, and it works. The only problem I had was the video card driver: when switching from the real installation to the virtual one and back, I have to disable/enable the GuestAdditions video card driver, if i recall well (it was long time ago).

Solution 2:

I have setup KVM (the default virtualization software for ubuntu) to bring up a windows partition that I can alternately dual boot into.

Sadly, its not an awesome solution, as there are a few gotchas.

  • It wasn't trivial to setup, I had to manually modify some partition permissions and such (but there are some decent articles on this you can google for)
  • As it only works with disks and not partitions, I had to use my main disk virtually. So when it started up, I got the multi-boot GRUB menu, as if I was starting up the machine. If I were to select the same OS in the virtual instance that I was running in the physical instance, it could cause serious problems with two OSes trying to mount the same partition.
  • You need to have free space on your drive to do any of this (to even dual boot). Usually pre-installed windows instances don't leave any space for a 2nd OS, so you'd have to re-size or something just to get dual booting.

Moral of the story: its possible, but I haven't found an easy, error free way to get it working.