Jump to content
We're Hiring! Full Stack Developer ×

Yosemite USB Controller Passthrough issue


joelones

Recommended Posts

I've been messing around with getting Yosemite working and followed member's archedraft wonderful guide.

 

I'm just wondering why I'm having problems passing through my USB crontroller though when passing it via the same block of code in another VM works fine. The following works well with my Windows 7 VM. Copied the same into the yosemite VM but does not work. Mouse and keywork aren't responding (which are currently connected to the passthrough controller I'm trying to get working)

 

<hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x00' slot='0x13' function='0x0'/>
      </source>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x00' slot='0x13' function='0x2'/>
      </source>
    </hostdev>

 

I also tried vfio-bind method with poor results. This is what I used with the vfio-bind method and had to find code for the vfio-bind script as it is no longer available in unraid.

 

    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=00:13.0,bus=root.1,addr=00.1'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=00:13.2,bus=root.1,addr=00.2'/>

 

Here's my complete xml for the OS X VM:

 

<domain type='kvm' id='19' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  <name>OSX-Yosemite-10.10</name>
  <uuid>0ba39646-7ba1-4d41-9602-e2969a3fc26d</uuid>
  <metadata>
    <type>None</type>
  </metadata>
  <memory unit='KiB'>4194304</memory>
  <currentMemory unit='KiB'>4194304</currentMemory>
  <vcpu placement='static'>2</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='0'/>
    <vcpupin vcpu='1' cpuset='1'/>
  </cputune>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-q35-2.3'>hvm</type>
    <kernel>/mnt/cache/appdata/vmdata/yosemite/chameleon_svn2510_boot</kernel>
    <boot dev='cdrom'/>
    <bootmenu enable='yes'/>
  </os>
  <features>
    <acpi/>
  </features>
  <cpu mode='custom' match='exact'>
    <model fallback='allow'>core2duo</model>
  </cpu>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/cache/appdata/vmdata/yosemite/Yosemite.img'/>
      <backingStore/>
      <target dev='hda' bus='sata'/>
      <alias name='sata0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <controller type='usb' index='0'>
      <alias name='usb'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/>
    </controller>
    <controller type='sata' index='0'>
      <alias name='ide'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pcie-root'>
      <alias name='pcie.0'/>
    </controller>
    <controller type='pci' index='1' model='dmi-to-pci-bridge'>
      <alias name='pci.1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1e' function='0x0'/>
    </controller>
    <controller type='pci' index='2' model='pci-bridge'>
      <alias name='pci.2'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x01' function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:00:20:20'/>
      <source bridge='in0'/>
      <target dev='vnet0'/>
      <model type='e1000-82545em'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x0'/>
    </interface>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x00' slot='0x13' function='0x0'/>
      </source>
      <alias name='hostdev0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x00' slot='0x13' function='0x2'/>
      </source>
      <alias name='hostdev1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </hostdev>
    <memballoon model='none'>
      <alias name='balloon0'/>
    </memballoon>
  </devices>
  <seclabel type='none' model='none'/>
  <qemu:commandline>
    <qemu:arg value='-device'/>
    <qemu:arg value='usb-kbd'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='usb-mouse'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='isa-applesmc,osk=c'/>
    <qemu:arg value='-smbios'/>
    <qemu:arg value='type=2'/>
    <qemu:arg value='-cpu'/>
    <qemu:arg value='core2duo,vendor=GenuineIntel'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='ioh3420,bus=pci.1,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=01:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on'/>
  </qemu:commandline>
</domain>

 

I'm not sure what the implications are of using either the hostdev block or the vfio-bind method (<qemu:arg> tag). When I use the hostdev method nothing works and I do not see a USB entry in the Yosemite settings pages but if I try it with the vfio-method I do see "USB Hi-Speed Bus" deivce in the hardware page for the yosemite but the mouse/keyboard works extremely slowly and stutters.

 

It may be relate to the PCIRootUID 1 switch in the configuration file for the OS X boot loader.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...