Return to Level1Techs.com

Booting from an already existing Windows Partition in KVM/virt-manager


#1

Is this possible and if so how would I do that?


#2

Yes.

0.) Install the “ovmf” package. Fedora-based distros call it “edk2-ovmf”.
1.) (Re)start libvirtd
2.) Create a new virtual machine using virt-manager
3.) “Import existing disk”
4.) “Provide the existing storage path”
5.) Select the Windows storage pool, or if the Windows disk is not already part of a storage pool, do it now.
5.1) “+”
5.2) “Name” it whatever you want
5.3) “Type” = disk: Physical Disk device
5.4) “Target path” = /dev
5.5) “Source path” = Linux device name for the Windows block device
6) ???
7.) Ensure target device is SATA/SCSI, not virtio or IDE
8.) Boot using UEFI, not BIOS


#3

I dont think this works. To clarify i have a windows Partition in addition to my linux partition on the same drive. So I would have to passthrough /dev/sda1 and I would
need a way to somehow passrthough / add a Efi Partition with a Bootloader.


#4

@tobias_6626 Have you tried it yet?

Whether running Windows on a different disk or the same disk does not matter. What @imhigh.today mentioned is not hardware pass through.

Unless I am missing something here, please give it a try and then report back whether it worked or not.


#5

The problem is that I cant select a Partition in step 5 (only sda instead of sda2).


#6

Did you make sure that sda2 is not mounted. Your fstab may have it set to auto mount at start up.

Close Virt Manager, do a sudo umount /dev/sda2 and then try to select it in Virt Manager again.

It also may be that you lack the permissions (your user is not in the right group) to look at the partitions of the device.

Also take a look at the following. Everything that you can do in Virt Manager, you can do from the command line with scripts.

https://www.stderr.nl/Blog/Software/Windows/Windows7-under-qemu.html