15.3. PCI passthrough with virt-install
To use PCI passthrough with the virt-install parameter, use the additional
--host-device parameter.
Identify the PCI device
Identify the PCI device designated for passthrough to the guest. Thevirsh nodedev-listcommand lists all devices attached to the system. The--treeoption is useful for identifying devices attached to the PCI device (for example, disk controllers and USB controllers).virsh nodedev-list --tree
# virsh nodedev-list --treeCopy to Clipboard Copied! Toggle word wrap Toggle overflow For a list of only PCI devices, run the following command:virsh nodedev-list | grep pci
# virsh nodedev-list | grep pciCopy to Clipboard Copied! Toggle word wrap Toggle overflow Each PCI device is identified by a string in the following format (where 8086 is a variable that in this case represents Intel equipment, and **** is a four digit hexadecimal code specific to each device):pci_8086_****
pci_8086_****Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note
Comparinglspcioutput tolspci -n(which turns off name resolution) output can assist in deriving which device has which device identifier code.Add the device
Use the PCI identifier output from thevirsh nodedevcommand as the value for the--host-deviceparameter.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Complete the installation
Complete the guest installation. The PCI device should be attached to the guest.