How to nvme Passthtough?

Hi all <3,

sorry if this post is spam and i was to stupid to search correctly :confused:
But is there anything i need to consider when i want to pass a nvme drive through?
Can i do it the same way we pass through the gpu or do we need to load other drivers?

with kind regards

Pretty sure I asked @wendell this question on Twitter at one point. But my understanding is since it is a PCIe device, yes it’s very similar to doing Gpu pass through

3 Likes

Yep, done it plenty

1 Like

I haven’t done this yet, still waiting for my hardware to arrive, but I plan to next week.

In case it’s of interest, with QEMU it’s possible to share an NVMe drive between multiple VMs and unlike passing through the device wholesale to a VM, this retains QEMU block layer functionality. Doing this requires the use of the QEMU userspace NVMe driver (which bypasses the host kernel for faster IO) in a separate process for managing the storage using qemu-storage-daemon.

These slides are helpful for this stuff:

2 Likes

oh i saw a similar presentation from a chinese university.
But i think that is too much for me ^ ^
i am happy if i even get my vm started without crashing the system :stuck_out_tongue:

I think this mostly depends on two things: motherboard support for PCIe passthrough and then the passthrough capabilities of the virtualization software you’re using. Motherboard support would be controlled in BIOS. Once the feature is enabled you should be able to configure passthrough in the virtualization software. You pass it through to the VM. Then configure it like a normally direct-attached device.

looks like it wasn’t that simple :frowning:

do you mind to write how you have done it ? (:

Prerequisite is that the NVME is in its own IOMMU group, do not use VIFO-PCI, just add it via Virt-Manager, just like a USB controller

1 Like

Works with vfio-pci and as you mentioned without :smiley:
Windows 11 now works ^^ (beside being windows)

I’m doing this now with a W10 nvme and it just drops down to a grub line. It’s been driving me crazy