Pcornel
Browse topics
Options
Recent
Favorites
Virtualization · Technical reference

PCI Passthrough · KVM / QEMU

Direct answer

Safe assignment requires firmware/IOMMU support, viable isolation groups, host driver detachment, VFIO ownership, QEMU device assignment and a working guest driver.

When to use this

Use this topic when the symptom or planned change has been narrowed to KVM / QEMU → PCI Passthrough. Establish effective host/runtime state before changing configuration.

First 30 seconds

1. libvirt <hostdev mode='subsystem' type='pci' managed='yes'> assigns devices.

2. managed=yes detaches automatically.

3. Check IOMMU groups.

4. UEFI/q35 for GPUs.

5. No migration.

Operational verification

host PCI device → vfio → QEMU → guest

Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
Common traps

Successful assignment shows a device crossed the host/guest ownership boundary, but it does not show isolation quality, reset safety, guest driver health or application acceleration.

Platform / version applicability
kvm-qemu
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformkvm-qemu
Scope / prerequisiteUse this topic when the symptom or planned change has been narrowed to KVM / QEMU → PCI Passthrough. Establish effectiv…
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

1 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Verification path Verify boundary

Hardware/firmware IOMMU → kernel IOMMU group → VFIO binding → libvirt/QEMU hostdev assignment → guest driver → device workload

Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • IOMMU enabled ≠ device isolated safely.
  • Device bound to VFIO ≠ guest successfully owns it.
  • Guest device visible ≠ workload uses it correctly.
  • Passthrough can restrict migration, snapshots or reset behavior depending on device support.
Key checks
  • virsh nodedev-list --cap pci — PCI devices
  • virsh nodedev-detach pci_0000_01_00_0 — detach to vfio
  • virsh dumpxml <vm> | grep -A5 hostdev — assigned
ReferenceWhy it matters1 section · depth on demand

Internals and state

Local intent: PCI passthrough assigns a host PCI function directly to a KVM/QEMU guest, normally through VFIO and an IOMMU, reducing emulation while increasing hardware, isolation and migration constraints.

ReferenceImportant terms & boundaries2 sections · depth on demand

What this shows and what it does not

Successful assignment shows a device crossed the host/guest ownership boundary, but it does not show isolation quality, reset safety, guest driver health or application acceleration.

In depth

PCI passthrough on plain KVM/libvirt:

virsh nodedev-list --cap pci | grep 01_00
virsh nodedev-detach pci_0000_01_00_0          # bind to vfio-pci
<hostdev mode='subsystem' type='pci' managed='yes'>
  <source><address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/></source>
</hostdev>
virsh nodedev-reattach pci_0000_01_00_0        # give back to host

managed='yes' lets libvirt detach/reattach the device automatically on VM start/stop.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor dockvm-qemu current

Authoritative/upstream documentation reviewed for bounded claims in KVM / QEMU → PCI Passthrough. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.qemu.org/docs/master/ · confidence 94%
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
kvm pci passthroughqemu pci passthroughlibvirt hostdeviommu passthrough
Embedded reference data

Quick lookup tables

KVM / QEMU → PCI Passthrough reference map

Fast operational boundaries and evidence limits for KVM / QEMU → PCI Passthrough.

BoundaryWhat to verifyEvidence limit
Definition/configExpected KVM / QEMU → PCI Passthrough definition or configuration is presentConfigured state does not prove runtime behavior
RuntimeRelevant KVM/QEMU/libvirt object or process is active without matching errorsRuntime state does not prove dependencies or guest outcome
DependencyHost CPU/memory, storage, network or device backend required by this path is healthyLocal success does not prove the next boundary
AcceptanceOriginal guest/application test succeeds after the change or observationRequired for end-to-end closure
Confirmation

Confirm action

Continue?