Looking for help with QMEU/KVM raw mode

I started using LMDE in a dual boot setup with Win10 about a year ago. The LMDE and WIN10 are on different physical drives.
Both disk drives have an EFI partition, and SecureBoot and FastBoot are not enabled in the BIOS.
I have a some Windows applications that have either no Linux counterpart or one that is awkward or missing some functionality.
So I’ve been rebooting back to Win10 when necessary, which works OK, but is a bit time-consuming.
Now I’m looking for help with QEMU/KVM to set up a VM on LMDE that uses raw mode to run my Win10 in the VM.
The intention here is to run the actual Win10 installation, not a new installation of Win10 in the VM (which I think would have licencing issues).
I found some instructions to set this up using the Leo AI tool in the Brave browser, but it doesn’t work.
Perhaps LEO was hallucinating again and either missed something or got it wrong (not the 1st time!)
I created the VM, and when trying to start it I get this error message:
BdsDxe: failed to load Boot001 “UEFI QEMU HARDDISK QM00001” from PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x0.0xFFFF.0x0): Not Found
When I search this error message, I get a lot of suggestions, which are mostly incomprehensible to me.
Does anyone have any experience doing what I have described, or have any suggestions to offer,
like “don’t do that, and here’s why”, or “here’s how to make it work”?

Otherwise, my change over to LMDE has been working very well, and I use it almost exclusively.

1 Like

I run Win7 in a virt-manager VM. I had no licence issues. I simply installed from my original Win7 DVD into the VM. It works.
My Win7 was licensed to the host machine, not to the VM, but that did not seem to matter.

1 Like

Sorry - I can’t be of much help…

I did once (10-15 years ago) get either VirtualBox or VMWare Workstation/Player, to boot my actual Windows 7 installed on a dualboot system… So I know something like that’s possible…

I think the terminology is “passthru” or “pass through” - i.e. you have to pass through your actual physical device to the VM… e.g. Windows 10 is on the 1st partition of the first storage device - on nvme0n1… Your system may be different - e.g. /dev/sda, /dev/sdb et cetera…

So you pass through /dev/nvme0n1p1 into your VM… or whatever… You should be able to get the storage devices with fdisk -l and lsblk :

╭─x@mimas ~  
╰─➤  sudo lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
nvme0n1     259:0    0 238.5G  0 disk 
├─nvme0n1p1 259:1    0   300M  0 part /boot/efi
├─nvme0n1p2 259:2    0 208.3G  0 part /
└─nvme0n1p3 259:3    0  29.8G  0 part [SWAP]
╭─x@mimas ~  
╰─➤  sudo fdisk -l
Disk /dev/nvme0n1: 238.47 GiB, 256060514304 bytes, 500118192 sectors
Disk model: PC611 NVMe SK hynix 256GB               
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 1C54B002-FA86-46EE-B4B6-FA2852D3C0C4

Device             Start       End   Sectors   Size Type
/dev/nvme0n1p1      4096    618495    614400   300M EFI System
/dev/nvme0n1p2    618496 437527720 436909225 208.3G Linux filesystem
/dev/nvme0n1p3 437527721 500118125  62590405  29.8G Linux swap

As you can see above - I don’t have any Windows partitions - as I don’t dual boot… But “fdisk -l” will give you the device path to passthrough to your KVM guest… That’s my Debian 13 machine above - I wouldn’t try and show my Ubuntu machine as it’s riddled and cluttered with shonky pseudo devices (e.g. /dev/loop30)…

I think there are people on this forum who’ve actually passed through other hardware - e.g. GPU to a VM… I’ve never tried it… I might actually try it one day…

1 Like

The data for my Win applications are on a 3rd hard-drive (NTFS). Would those apps running in the VM be able access those files?
I don’t have an original W10 installation CD, as my PC came with Win7 (I have that CD) and then I upgraded to W10.
I suppose I could make a W10 ISO file from my W10 installation, and use that to create the VM. I’ll have to research this.

1 Like

I originally specified /dev/sda2 as the device to pass though. But that is just the system partition. The boot info partition (EFI) is /dev/sda1.
One of the AI-generated hints was to specify /dev/sda, so it could find the EFI partition. Didn’t work.

2 Likes

I can mount host filesystems from within a VM running Linux. I suppose you could do it from a VM Win… I have not tried.

Theoretically yes.
I tried once to get a Win10 recovery disc to recover into a VM… I failed.
An iso might have a better chance.

1 Like

I’m not sure how Win 10 will react to hardware changes caused by the VM- might set off the reactivation. You probably need to add OVMF (UEFI firmware)
Something like -drive if=pflash,format=raw,readonly=on,file=/usr/share/OVMF/OVMF_CODE.fd
-drive if=pflash,format=raw,file=~/ovmf/OVMF_VARS.fd \

You usually need to copy OVMF_VARS.fd to a writable location first so it can save NVRAM

edited- newer version are OVMF_VARS_4M.fd & OVMF_CODE_4M.fd

3 Likes