Is it possible to run a Windows partition as a VM?

13

2

My laptop is setup as dual boot between Windows 7 (64-bit) and Ubuntu Linux (64-bit). Because I spend most of my work time in Linux I need a Windows 7 VM to be able to use Microsoft Office tools, etc. But my laptop only has a 256 GB SSD so having a Windows 7 bootable partition and a VM takes up quite a lot of space.

Is there any way of running the Windows 7 partition as a VM from Linux without converting it to an .IMG file, ideally with KVM? If no, are there any other options that could help me?

parsley72

Posted 2012-04-22T22:14:28.787

Reputation: 940

Answers

2

I have a fair bit of experience switching between booting a Windows partition natively and running it as a VM. First of all, hardware and driver support were NOT an issue for me, nor was it necessary to uninstall VMware Tools when booting in a physical context.

That aside, it sounds like a great idea, but product activation is where it really falls down. One is not supposed to have to reactivate Windows every time Windows switches between P and V, but it is not foolproof. Windows and Office both will occasionally ask to be re-activated due to alleged hardware changes. Once, after switching between physical and virtual modes, my properly licensed installation of Windows 7 deactivated itself with a bit of fanfare due to an alleged "activation exploit." These issues would be avoided, or at least rendered trivial, if they occurred in a KMS environment.

When I upgraded to a 300GB SSD, I brought my Windows partition over as a VMDK and never booted it natively again. Windows 7 seems to perform better virtualized on an SSD than natively on an HDD, and the sparse image that I use now consumes less disk space than the old partition.

Executive Summary: Yes, it can be done; drivers are less of a problem than you expect, and Windows activation is more of a problem than you expect. If you don't really need to run Windows on bare metal, I'd suggest converting your partition to a VHD or VMDK and running it only as a VM.

Miles Erickson

Posted 2012-04-22T22:14:28.787

Reputation: 1 079

The only real reason I want to run Windows on bare metal is so I can play World Of Tanks, but I can't really use that as a reason to get a bigger SSD from work... – parsley72 – 2012-04-29T23:18:12.013

3

I don't have any experience with KVM myself, but for VirtualBox, VMWare and Parallels this will work.

It takes several reboots of the W7 VM to recognize the new (virtual) hardware and you will have to install the Guest Additons/VMWare Tools/device drivers, whatever your virtualization software calls it.

Be warned that switching back to using the partition "natively" may not be possible anymore after you have used the partition in a VM.

Even if you can go back it will again take several reboots to recognize the new hardware and you will probably have to de-install the virtualization software in the VM.

I strongly recommend you make a full (image) backup of your laptop before you start experimenting with this.

Tonny

Posted 2012-04-22T22:14:28.787

Reputation: 19 919

-1

You might try a sparse image file. These are .IMG files of a fixed size that don't take up space on your disk until they actually contain data.

See http://blog.allanglesit.com/2011/03/linux-kvm-managing-disk-images/

Edit: after re-reading your post I see that your question is very much like How can I run an existing WinXP partition (dual boot machine) inside KVM?

dwurf

Posted 2012-04-22T22:14:28.787

Reputation: 293

No good. A sparse file still will contain the data for the Win7 install which will be 20+ GB at a minimum (including swap and hibernation files). – Tonny – 2012-04-22T22:27:12.443

Yeah, I've currently got a Win7 VM setup using qcow2 but once you install Microsoft Office, Visual Studio, etc. it still gets to be a significant size (~33GB). – parsley72 – 2012-04-22T22:34:58.073

@dwurf: Win7 will probably be able to boot without the 2 hardware profiles trick described in the articles you refer to. Win7 supports most common disk-controllers natively, including the ones emulated by current virtualization software. Still needs to do a full hardware re-detect every time you switch between VM and native. – Tonny – 2012-04-22T22:42:35.203