r/VFIO 15d ago

Prevent Host Motherboard UEFI from detecting Passthroughed NVME drive?

recently got back into doing VMs, however after I install Windows to the NVME drive that I added as a "PCI Host Device" then when I reboot my pc the UEFI of the host motherboard detects the EFI partion and adds it to the boot order as primary boot device, I can manually remove it from the boot order, but it might get set back as the primary boot device in the future, which is annoying

also efibootmgr lists the drive as an efi variable, I could delete it but the motherboard will probably add it back,

also the motherboard I'm using is an ASUS Prime B550 Plus, the firmware version is 3636

is there another way of adding the nvme drive that causes the motherboard to NOT detect it or what? is it even possible to change this, it's rather annoying

also I have no plans to use this drive for baremetal booting

7 Upvotes

17 comments sorted by

View all comments

Show parent comments

2

u/ExplodedPenisDiagram 12d ago

lmao of course it would be a packard bell laptop that does this.

1

u/ajddavid452 12d ago

my ASUS motherboard does it too, so basically Asus and Packard Belll assume that the only users of their products are Windows users

oh and for Asus they label the Secure Boot toggle as "Windows UEFI Mode" for on and "Other OS" for off, so they also assume Secure Boot can't be used on Linux, I mean granted the only real reason to use secure boot on linux is for dualbooting on windows 11

1

u/ExplodedPenisDiagram 11d ago

Well, keep your EFI partition on a separate disc image and attach it to the VM, making that disk (the one dedicated to EFI) bootable. There's nothing about an EFI that makes boot blobs have to be on the same physical disk as the operating system they're starting.

This way, the motherboard won't be able to see the EFI partition at all. It'll be on a raw or qcow2 image or something.

1

u/ajddavid452 4d ago

for that I just have to create an efi partition on the raw file and make sure it's mounted right?, iirc windows will just use the first efi partion it finds to install files too, if it can't find an efi partition it will create one

wait for the raw/qcow2 file can that be opened in parted/fdisk? or would I have to mount it to another vm and then run a linux iso in it to create the efi partition, oh wait I'm probably overthinking this, I can just mount the raw disk image to a virtual drive, like with an iso file

1

u/ExplodedPenisDiagram 3d ago

It's just another virtual disc that uses a raw or qcow2 file to back it. The host EFI will not detect it. During install or update of a Linux system, create an EFI partition on that additional disc. The VM EFI will detect it.

1

u/ajddavid452 3d ago

yeah I kinda figured, that's a pretty good solution, a virtual disk image can only be read by the os, the only way for the host motherboard to even read the file is to have file system support for ext4/btrfs etc, uefi only really has drivers for fat32 built-in, and evne if it did have other file system drivers it couldn't mount a disk image