# Grub2 KVM and Windows on QCOW image

## FishB8

Does anybody know if it is possible to create a copy-on-write iso image to install windows onto and boot under KVM, that can also be booted directly from GRUB2?

I would like to have a disk image for a windows install that I can open under KVM from within Linux, but also have the option to boot to the image directly from the grub menu if I need to. Has anybody tried to do this?

Also, when windows is loaded from an iso disk image, is it possible to have the harddrive use GPT partitions? I know windows throws a fit if you attempt to install directly on a GPT partition when using a BIOS based system, but does placing it within a disk image get around this issue?

EDIT: Had a brain fart. I meant QCOW image, not ISO image

----------

## Hu

No, you cannot directly boot any system installed within a qcow2.  When you run the system as a guest, the hypervisor interprets the guest disk operations into accesses within the qcow2 file.  When you boot natively, there is nothing to perform that mapping.  If you want to support both native boot and guest boot, you need to place the guest directly on a drive.  As I understand it, even placing it within a logical volume or a disk partition would not permit native boot, since you would have a partition within a partition.

Additionally, recall that the hypervisor presents different hardware to the guest, so the guest will need two sets of disk drivers.  This could also trigger reactivation if you use a version of Windows which has that misfeature.  Since you are asking about GPT, I assume you intend to use Windows Vista or Windows 7, both of which are afflicted with the activation problem.

----------

## FishB8

Thanks. That makes sense.

I had read that you can boot an OS if the OS is installed natively  on a partition / volume instead of an image. Supposedly in those cases the hypervisor actually loads the bootloader as a host. But I also knew that windows craps a brick on a GPT system, so I wondered if the same could be done with an image to get around that problem. I guess the term "OS" in this instance was side stepping all the landmines that pop up when "OS" == "Windows".

I'm building a new system and haven't used windows personally for almost 10 yrs, but I increasingly need a copy of windows for work related things and was looking into using KVM. Should still work as a host, I was just curious if the idea of being able to boot both directly and as a host was an option.

----------

## Hu

It is an option, but unless you anticipate using the Windows system in ways that perform poorly under a hypervisor, I would recommend against it.  It is a lot of extra trouble to make it work, and anything that runs well under the hypervisor should just be done there.

----------

