0

I have been searching everywhere for the past few days and can't seem to find the answer anywhere. I have a Asus P5E VM DO motherboard eith a Xeon processor, so both of support visualization. I'm trying to figure out how to setup PCI passthrough for my tunner cards. Both host and guest system are Ubuntu 14.04 LTS. I created the virtual machines using this guide using the [script][2] Can someone help with the step by step process to add the PCI cards? I tried following this guide but it doesn't seem to work for Ubuntu.

3
  • Erm, it's also unclear what you're trying to accomplish. Tunner card? eith? script link is missing... Please edit your question and try to be more clear.
    – Fabby
    Jan 4, 2015 at 15:55
  • AskUbuntu will only allow me to post two links per post, but the first link does have the script in question. Jan 8, 2015 at 5:59
  • You have an answer already by someone else. If this works, don't forget to click the little grey check-mark below the "0" therefore "accepting" the answer...
    – Fabby
    Jan 8, 2015 at 6:52

1 Answer 1

0

This ended up being a 2 part answer and here it is in case it will help someone else:


  1. To answer the original question, to add a PCI passthrough, it is best to use Virtual Machine Manager. Select your VM and click Open. Got to View-Details and click "Add Hardware" button. You can also accomplish the same thing via command line:

server$ virsh edit VM_name and add these lines to the XML file.

<hostdev mode='subsystem' type='pci' managed='yes'>
  <source>
    <address domain='0x0000' bus='0x01' slot='0x01' function='0x2'/>
  </source>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
</hostdev>

You can find the domain, bus, slot and function name using

lspci -t

lspci -n

  1. Now, for the above process to work, you first have to unbind the current driver from PCI card and bind it to the virtual machine driver. In my case, this was an excerpt from the lspci --v command

server$ lspci -nnv

01:01.0 Multimedia video controller [0400]: Conexant Systems, Inc. CX23880/1/2/3 PCI Video and Audio Decoder [14f1:8800] (rev 05)
    Subsystem: DViCO Corporation FusionHDTV 5 Gold [18ac:d500]
    Flags: bus master, medium devsel, latency 64, IRQ 17
    Memory at fb000000 (32-bit, non-prefetchable) [size=16M]
    Capabilities: <access denied>
    Kernel driver in use: cx8800

The instructions for unbinding in the KVM project site don't help because they reference pci-stub which is deprecated (as far as I understand). Instead do the following to unbind the driver and bind it to the VFIO driver:

server$ sudo modprobe kvm_intel
server$ sudo modprobe kvm
server$ kvm-ok
server$ modprobe vfio-pci
server$ sudo chmod 222 /sys/bus/pci/drivers/vfio-pci/new_id
server$ sudo chmod 222 /sys/bus/pci/devices/0000\:01\:01.2/driver/unbind
server$ echo 0000:01:01.2 > /sys/bus/pci/devices/0000\:01\:01.2/driver/unbind
server$ echo "14f1 8802" > /sys/bus/pci/drivers/vfio-pci/new_id

You will notice that I had to use chmod in order to get permission to unbind/bind the driver. Again, you need to do step 2 before you can do step 1.


  1. If it complains about permissions when adding the PCI passthrough, do the following

    server$ modprobe -r vfio_iommu_type1 server$ modprobe vfio_iommu_type1 allow_unsafe_interrupts=1

I found this trick here.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .