yonigo
yonigo

Reputation: 1087

Direct pci device assignment in a nested QEMU guest

I am running QEMU and in additional to the OS drive i am connecting it with another SATA disk through a AHCI controller like this:

-drive id=test,file=test_drive.img,if=none
-device ahci,id=ahci_test 
-device ide-drive,drive=test,bus=ahci_test.0

I want to run another VM inside that VM and use direct assignment of this disk to that VM. Is this possible? Do i need nested KVM capabilities? must i have VT-d enabled?

thanks

Upvotes: 0

Views: 1025

Answers (2)

Paolo Bonzini
Paolo Bonzini

Reputation: 1930

It doesn't work in nested KVM. The guest will never have VT-d, even if the host has it, because QEMU does not emulate the IOMMU.

Upvotes: 1

Wayne
Wayne

Reputation: 651

You can refer to Redhat's KVM guide: Assigning a PCI device.

I followed the instruction and successfully assigned a PCI device to guest before, but not sure if this works in a nested KVM environment. You can try to assign the same PCI device with identical PCI ID to the guest and nested one.

For your problems, in my memory, KVM supports nested virtualization. And if you want to use direct device assignment, enabling VT-d is a must.

Upvotes: 0

Related Questions