USB Passthrough


Mettbrot

Recommended Posts

Hey everyone.

 

I have a problem with my DVB usb device. I use ubuntu 14.04 created via the VM Manager. In the normal configuration, the device is not showing up in ubuntus lsusb, just a device called

Bus 001 Device 003: ID 0409:55aa NEC Corp. Hub

I have tried with these two devices:

Bus 001 Device 003: ID 14f7:0500 TechniSat Digital GmbH DVB-PC TV Star HD
Bus 001 Device 002: ID 0ccd:0097 TerraTec Electronic GmbH Cinergy T RC MKII

Altering the XML to something I found about usb 2.0 passthrough seems to partially fix this problem:

    <controller type='usb' index='0' model='ich9-ehci1'>

    <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x7'/>

    </controller>

    <controller type='usb' index='0' model='ich9-uhci1'>

    <master startport='0'/>

    <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0' multifunction='on'/>

    </controller>

 

Now the second device (DVB-T) shows up and loads the driver, but unfortunately not the DVB-S device (which is more important to me)...

 

Maybe you have an idea, here is my XML:

<domain type='kvm' id='2'>
  <name>Ubuntu14</name>
  <uuid>833c4977-51c4-256d-d001-925165cb32e6</uuid>
  <memory unit='KiB'>1048576</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-i440fx-2.1'>hvm</type>
    <boot dev='hd'/>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
  </features>
  <clock offset='localtime'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='yes'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/mnt/user/Apps/vmimages/Ubuntu14/Ubuntu14.qcow2'/>
      <backingStore/>
      <target dev='hda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/Installation/Betriebssysteme/Ubuntu/ubuntu-14.04-desktop-amd64.iso'/>
      <backingStore/>
      <target dev='hdc' bus='ide' tray='open'/>
      <readonly/>
      <alias name='ide0-1-0'/>
      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
    </disk>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <alias name='usb0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <alias name='usb0'/>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0' multifunction='on'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'>
      <alias name='pci.0'/>
    </controller>
    <controller type='ide' index='0'>
      <alias name='ide0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <filesystem type='mount' accessmode='passthrough'>
      <source dir='/mnt/user/Aufnahmen'/>
      <target dir='aufnahmen'/>
      <alias name='fs0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </filesystem>
    <interface type='bridge'>
      <mac address='52:54:00:0b:52:21'/>
      <source bridge='br0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/1'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/1'>
      <source path='/dev/pts/1'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <input type='tablet' bus='usb'>
      <alias name='input0'/>
    </input>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='5900' autoport='yes' websocket='5700' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='vmvga' vram='16384' heads='1'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <vendor id='0x0ccd'/>
        <product id='0x0097'/>
        <address bus='1' device='2'/>
      </source>
      <alias name='hostdev0'/>
    </hostdev>
    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <vendor id='0x14f7'/>
        <product id='0x0500'/>
        <address bus='1' device='3'/>
      </source>
      <alias name='hostdev1'/>
    </hostdev>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </memballoon>
  </devices>
</domain>

 

Thank you!  :)

Link to comment

Any idea for this? Anything else I can try?

 

When I change the usb controllers to:

    <controller type='usb' index='0' model='nec-xhci'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x7'/>
    </controller>

i get a

unable to onitialize libusb: -99

on lsusb on the Ubuntu guest.

Link to comment
  • 2 weeks later...

Sweet, thanks in advance :)

 

Ok, so I tried this on my system with the nec controller and it does in fact work for me, but since I don't have the DVB device you have, I can't do an apples to apples test.

 

So when you are in the guest VM after using the controller, run the following commands:

 

lspci

 

and

 

lsusb

 

Please copy / paste their output here for me.

Link to comment

Yea I read about this controller and that it should be able to support both usb 1 and usb 2 without the need of the multifunction dual controler thing (uhci + ehci)

Here are the outputs:

lspci

00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03)
00:02.0 VGA compatible controller: VMware SVGA II Adapter
00:03.0 Unclassified device [0002]: Red Hat, Inc Virtio filesystem
00:04.0 Ethernet controller: Red Hat, Inc Virtio network device
00:05.0 SCSI storage controller: Red Hat, Inc Virtio block device
00:06.0 Unclassified device [00ff]: Red Hat, Inc Virtio memory balloon

 

lsusb

unable to initialize libusb: -99

which I read is short for "no USB controllers detected"...

 

maybe this will help:

dmesg | grep -i hcd
[    1.406538] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.406602] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.406628] uhci_hcd: USB Universal Host Controller Interface driver

 

Could the problem be that I installed ubuntu with the other controller in the xml? I think the create VM tab creates a controller without any spec, juts like

<controller type='usb' index='0'>

Link to comment

Yea I read about this controller and that it should be able to support both usb 1 and usb 2 without the need of the multifunction dual controler thing (uhci + ehci)

Here are the outputs:

lspci

00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03)
00:02.0 VGA compatible controller: VMware SVGA II Adapter
00:03.0 Unclassified device [0002]: Red Hat, Inc Virtio filesystem
00:04.0 Ethernet controller: Red Hat, Inc Virtio network device
00:05.0 SCSI storage controller: Red Hat, Inc Virtio block device
00:06.0 Unclassified device [00ff]: Red Hat, Inc Virtio memory balloon

 

lsusb

unable to initialize libusb: -99

which I read is short for "no USB controllers detected"...

 

maybe this will help:

dmesg | grep -i hcd
[    1.406538] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.406602] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.406628] uhci_hcd: USB Universal Host Controller Interface driver

 

Could the problem be that I installed ubuntu with the other controller in the xml? I think the create VM tab creates a controller without any spec, juts like

<controller type='usb' index='0'>

Definitely could be the problem. That or your guest VM doesn't have the kernel driver inside it for that usb 3 controller.

 

Remove the other USB controller in your xml so the NEC one is the only one that remains and give that a shot.

Link to comment

I had it removed. Is there a way inside ubuntu to rigger reinstallation of the hardware? (or re-recognation)?

?  Not sure what you're asking here. To confirm, you stopped the VM, edited the XML (removing the old USV controller from it) and started up the VM again, right?

 

After doing all that, if typing in lspci in the VM doesn't reveal the NEC controller you added to the XML, chances are the guests kernel doesn't have that driver built into it.  I know USB 3 support through QEMU is relatively new, and I don't know if that was backported to older linux kernel versions or not. What version of Ubuntu are you running?

Link to comment

Sorry if I wasn't clear enough. I removed

    <controller type='usb' index='0' model='ich9-ehci1'>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
    <master startport='0'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0' multifunction='on'/>
    </controller>

and added

    <controller type='usb' index='0' model='nec-xhci'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x7'/>
    </controller>

When I then start the VM I have the output from above. I have Ubuntu 14.04 running. The DVB device is usb 2.0 this is all I need :)

I am on unRaid 14.0b if that helps.

Link to comment

Sorry if I wasn't clear enough. I removed

    <controller type='usb' index='0' model='ich9-ehci1'>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
    <master startport='0'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0' multifunction='on'/>
    </controller>

and added

    <controller type='usb' index='0' model='nec-xhci'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x7'/>
    </controller>

When I then start the VM I have the output from above. I have Ubuntu 14.04 running. The DVB device is usb 2.0 this is all I need :)

I am on unRaid 14.0b if that helps.

Ok, well if the usb device you have is only usb 2, you don't need the NEC controller as that is a USB 3 controller.

 

I will need to test Ubuntu later to see this for myself. It's going to be tough though since I don't have a DVB unit.

Link to comment

Thanks for the response. I thought it would work since somewhere it said that it supports all three usb 1/2/3 in one device. I thought one reason for the device not to show up could have been the dual controllers in the usb 1/2 setting before. Maybe later today I can try with the newest Ubuntu version and the usb 1/2 Controllers from the beginning...

Link to comment

Thanks for the response. I thought it would work since somewhere it said that it supports all three usb 1/2/3 in one device. I thought one reason for the device not to show up could have been the dual controllers in the usb 1/2 setting before. Maybe later today I can try with the newest Ubuntu version and the usb 1/2 Controllers from the beginning...

 

Please let us know how testing on this goes.  Unfortunately I just don't have time to build and test something like this right now, especially when I don't have the same USB device as you to confirm it works.  I can confirm that the two different methods of creating these USB controllers work fine in my test environment and show up under an lspci command from within the guest.

Link to comment

Hey!

So I installed Ubuntu 14.10 and setup the usb2 controller combination (not the nec controller) before installtion. on the first boot I could read it was trying to find the firmware for the DVBS card which is a great success! It was showing up under lsusb, everzthing great! BUT: then I installed pending system updates and manually downloaded the firmware files for the 2 cards from linuxtv.org and put the under lib/firmware. Next boot, i fire up the terminal and check lsub:

lsusb
Bus 001 Device 005: ID 0ccd:0097 TerraTec Electronic GmbH Cinergy T RC MKII
Bus 001 Device 002: ID 0627:0001 Adomax Technology Co., Ltd 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

I feel like its kidding me.

 

dmesg | grep dvb shows

dmesg | grep dvb
[   25.412306] usb 1-3: dvb_usb_v2: found a 'TerraTec Cinergy T Stick RC' in cold state
[   26.055630] usb 1-3: dvb_usb_v2: downloading firmware from file 'dvb-usb-af9015.fw'
[   26.196781] usb 1-3: dvb_usb_v2: found a 'TerraTec Cinergy T Stick RC' in warm state
[   26.588495] dvb-usb: found a 'Technisat SkyStar USB HD (DVB-S/S2)' in cold state, will try to load a firmware
[   26.736544] usb 1-3: dvb_usb_v2: will pass the complete MPEG2 transport stream to the software demuxer
[   26.778634] dvb-usb: downloading firmware from file 'dvb-usb-SkyStar_USB_HD_FW_v17_63.HEX.fw'
[   27.008125] usbcore: registered new interface driver dvb_usb_technisat_usb2
[   27.592502] usb 1-3: dvb_usb_v2: schedule remote query interval to 500 msecs
[   27.592507] usb 1-3: dvb_usb_v2: 'TerraTec Cinergy T Stick RC' successfully initialized and connected
[   27.592610] usbcore: registered new interface driver dvb_usb_af9015
[   28.667443] dvb-usb: generic DVB-USB module successfully deinitialized and disconnected.
[   28.675159] usb 1-3: dvb_usb_v2: usb_bulk_msg() failed=-71
[   28.675511] usb 1-3: dvb_usb_af9015: rc query failed=-71
[   28.798572] usb 1-3: dvb_usb_v2: 'TerraTec Cinergy T Stick RC' successfully deinitialized and disconnected
[   29.729023] usb 1-3: dvb_usb_v2: found a 'TerraTec Cinergy T Stick RC' in warm state
[   30.230101] usb 1-3: dvb_usb_v2: will pass the complete MPEG2 transport stream to the software demuxer
[   30.279388] usb 1-3: dvb_usb_v2: schedule remote query interval to 500 msecs
[   30.279391] usb 1-3: dvb_usb_v2: 'TerraTec Cinergy T Stick RC' successfully initialized and connected

 

so it is showing up but not as dvb device.. (also not under tvheadend)

Any ideas?

Link to comment

Hey!

So I installed Ubuntu 14.10 and setup the usb2 controller combination (not the nec controller) before installtion. on the first boot I could read it was trying to find the firmware for the DVBS card which is a great success! It was showing up under lsusb, everzthing great! BUT: then I installed pending system updates and manually downloaded the firmware files for the 2 cards from linuxtv.org and put the under lib/firmware. Next boot, i fire up the terminal and check lsub:

lsusb
Bus 001 Device 005: ID 0ccd:0097 TerraTec Electronic GmbH Cinergy T RC MKII
Bus 001 Device 002: ID 0627:0001 Adomax Technology Co., Ltd 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

I feel like its kidding me.

 

dmesg | grep dvb shows

dmesg | grep dvb
[   25.412306] usb 1-3: dvb_usb_v2: found a 'TerraTec Cinergy T Stick RC' in cold state
[   26.055630] usb 1-3: dvb_usb_v2: downloading firmware from file 'dvb-usb-af9015.fw'
[   26.196781] usb 1-3: dvb_usb_v2: found a 'TerraTec Cinergy T Stick RC' in warm state
[   26.588495] dvb-usb: found a 'Technisat SkyStar USB HD (DVB-S/S2)' in cold state, will try to load a firmware
[   26.736544] usb 1-3: dvb_usb_v2: will pass the complete MPEG2 transport stream to the software demuxer
[   26.778634] dvb-usb: downloading firmware from file 'dvb-usb-SkyStar_USB_HD_FW_v17_63.HEX.fw'
[   27.008125] usbcore: registered new interface driver dvb_usb_technisat_usb2
[   27.592502] usb 1-3: dvb_usb_v2: schedule remote query interval to 500 msecs
[   27.592507] usb 1-3: dvb_usb_v2: 'TerraTec Cinergy T Stick RC' successfully initialized and connected
[   27.592610] usbcore: registered new interface driver dvb_usb_af9015
[   28.667443] dvb-usb: generic DVB-USB module successfully deinitialized and disconnected.
[   28.675159] usb 1-3: dvb_usb_v2: usb_bulk_msg() failed=-71
[   28.675511] usb 1-3: dvb_usb_af9015: rc query failed=-71
[   28.798572] usb 1-3: dvb_usb_v2: 'TerraTec Cinergy T Stick RC' successfully deinitialized and disconnected
[   29.729023] usb 1-3: dvb_usb_v2: found a 'TerraTec Cinergy T Stick RC' in warm state
[   30.230101] usb 1-3: dvb_usb_v2: will pass the complete MPEG2 transport stream to the software demuxer
[   30.279388] usb 1-3: dvb_usb_v2: schedule remote query interval to 500 msecs
[   30.279391] usb 1-3: dvb_usb_v2: 'TerraTec Cinergy T Stick RC' successfully initialized and connected

 

so it is showing up but not as dvb device.. (also not under tvheadend)

Any ideas?

Try the NEC controller again. Let's see if that changes anything.

Link to comment

GREAT SUCCESS!  ;D

 

It had nothing to do with the usb controller. It works just fine with the usb2 controller.

dmesg | grep dvb
[    8.868551] dvb-usb: found a 'Technisat SkyStar USB HD (DVB-S/S2)' in cold state, will try to load a firmware
[    8.876178] dvb-usb: downloading firmware from file 'dvb-usb-SkyStar_USB_HD_FW_v17_63.HEX.fw'
[    9.133212] usbcore: registered new interface driver dvb_usb_technisat_usb2
[    9.631803] usb 1-3: dvb_usb_v2: found a 'TerraTec Cinergy T Stick RC' in warm state
[   11.420752] dvb-usb: generic DVB-USB module successfully deinitialized and disconnected.
[   11.501970] usbcore: registered new interface driver dvb_usb_af9015
[   14.882976] usb 1-3: dvb_usb_v2: found a 'TerraTec Cinergy T Stick RC' in warm state
[   15.152678] usb 1-3: dvb_usb_v2: will pass the complete MPEG2 transport stream to the software demuxer
[   15.284279] usb 1-3: dvb_usb_v2: schedule remote query interval to 500 msecs
[   15.284282] usb 1-3: dvb_usb_v2: 'TerraTec Cinergy T Stick RC' successfully initialized and connected
______________________________________________________________________________________

[  520.805251] dvb-usb: found a 'Technisat SkyStar USB HD (DVB-S/S2)' in warm state.
[  520.806203] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.
[  520.810237] dvb-usb: MAC address: 00:08:c9:f0:3b:69
[  521.196976] dvb-usb: schedule remote query interval to 100 msecs.
[  521.210881] dvb-usb: Technisat SkyStar USB HD (DVB-S/S2) successfully initialized and connected.

 

The problem was this:

When the device is loaded it is found in cold state (no firmware) as the dmesg states and loads the firmware. Now the device is disconnected in order to be reconnected and found in warm state. This did not work for my card as the device gets a new device ID from unraid and thus being not recognized by the vm:

 

before vm boot (unraid):

Bus 001 Device 002: ID 0ccd:0097 TerraTec Electronic GmbH Cinergy T RC MKII
Bus 001 Device 003: ID 14f7:0500 TechniSat Digital GmbH DVB-PC TV Star HD

after vm boot (unraid)

Bus 001 Device 002: ID 0ccd:0097 TerraTec Electronic GmbH Cinergy T RC MKII
Bus 001 Device 004: ID 14f7:0500 TechniSat Digital GmbH DVB-PC TV Star HD

 

note that the first DVB device stays at the same id during vm boot.

 

To reattach the (new) device to the vm i had to create a XML file just with the hostdev definitions and load it in unraid via:

virsh attach-device Ubuntu14.10 /boot/config/technisat.xml

This is where I added the line in the dmesg above.

 

Now my questions are:

[*]Is there a way for unraid to give the same device always the same device ID and not a new one everytime it (re)connects?

[*]If not: Do you have any idea how I can automate the process of reattaching the device in unraid  if the vm guest system (ubuntu) is booted?

 

Thanks for your support so far, I am very happy now.  :)

Link to comment

GREAT SUCCESS!  ;D

 

It had nothing to do with the usb controller. It works just fine with the usb2 controller.

dmesg | grep dvb
[    8.868551] dvb-usb: found a 'Technisat SkyStar USB HD (DVB-S/S2)' in cold state, will try to load a firmware
[    8.876178] dvb-usb: downloading firmware from file 'dvb-usb-SkyStar_USB_HD_FW_v17_63.HEX.fw'
[    9.133212] usbcore: registered new interface driver dvb_usb_technisat_usb2
[    9.631803] usb 1-3: dvb_usb_v2: found a 'TerraTec Cinergy T Stick RC' in warm state
[   11.420752] dvb-usb: generic DVB-USB module successfully deinitialized and disconnected.
[   11.501970] usbcore: registered new interface driver dvb_usb_af9015
[   14.882976] usb 1-3: dvb_usb_v2: found a 'TerraTec Cinergy T Stick RC' in warm state
[   15.152678] usb 1-3: dvb_usb_v2: will pass the complete MPEG2 transport stream to the software demuxer
[   15.284279] usb 1-3: dvb_usb_v2: schedule remote query interval to 500 msecs
[   15.284282] usb 1-3: dvb_usb_v2: 'TerraTec Cinergy T Stick RC' successfully initialized and connected
______________________________________________________________________________________

[  520.805251] dvb-usb: found a 'Technisat SkyStar USB HD (DVB-S/S2)' in warm state.
[  520.806203] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.
[  520.810237] dvb-usb: MAC address: 00:08:c9:f0:3b:69
[  521.196976] dvb-usb: schedule remote query interval to 100 msecs.
[  521.210881] dvb-usb: Technisat SkyStar USB HD (DVB-S/S2) successfully initialized and connected.

 

The problem was this:

When the device is loaded it is found in cold state (no firmware) as the dmesg states and loads the firmware. Now the device is disconnected in order to be reconnected and found in warm state. This did not work for my card as the device gets a new device ID from unraid and thus being not recognized by the vm:

 

before vm boot (unraid):

Bus 001 Device 002: ID 0ccd:0097 TerraTec Electronic GmbH Cinergy T RC MKII
Bus 001 Device 003: ID 14f7:0500 TechniSat Digital GmbH DVB-PC TV Star HD

after vm boot (unraid)

Bus 001 Device 002: ID 0ccd:0097 TerraTec Electronic GmbH Cinergy T RC MKII
Bus 001 Device 004: ID 14f7:0500 TechniSat Digital GmbH DVB-PC TV Star HD

 

note that the first DVB device stays at the same id during vm boot.

 

To reattach the (new) device to the vm i had to create a XML file just with the hostdev definitions and load it in unraid via:

virsh attach-device Ubuntu14.10 /boot/config/technisat.xml

This is where I added the line in the dmesg above.

 

Now my questions are:

[*]Is there a way for unraid to give the same device always the same device ID and not a new one everytime it (re)connects?

[*]If not: Do you have any idea how I can automate the process of reattaching the device in unraid  if the vm guest system (ubuntu) is booted?

 

Thanks for your support so far, I am very happy now.  :)

 

So glad you were able to get this working and definitely interesting on the "how" side of things.  So far we haven't figured out a way to force USB devices to always get the same device IDs.  We are working on making device attachment both easier and something you should be able to do while the VM is running, but for now, you'll have to continue doing it the way you are.

Link to comment
  • 4 months later...

Hi jonp,

 

Hoping you can help me with an issue with my XML. I want to convert this from USB 1.1 to USB 2:

    <controller type='usb' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>

Have added model='ehci' which then forces me to change slot numbers due to other devices, but then it doesn't work.

 

Full XML from devices onwards here:

  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source file='/mnt/cache/VMs/Win7.img'/>
      <target dev='hdc' bus='virtio'/>
      <boot order='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/Software/ISOs/Windows 7/GSP1RMCHPXFRER_EN_DVD.ISO'/>
      <target dev='hda' bus='ide'/>
      <readonly/>
      <boot order='2'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/Software/virtio-win-0.1.96.iso'/>
      <target dev='hdb' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
    <controller type='scsi' index='0' model='virtio-scsi'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </controller>
    <controller type='usb' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'/>
    <controller type='pci' index='1' model='pci-bridge'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </controller>
    <controller type='pci' index='2' model='pci-bridge'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </controller>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:2a:ec:78'/>
      <source bridge='br0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/Win7.org.qemu.guest_agent.0'/>
      <target type='virtio' name='org.qemu.guest_agent.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <hostdev mode='subsystem' type='scsi' managed='no'>
      <source>
        <adapter name='scsi_host4'/>
        <address bus='0' target='0' unit='0'/>
      </source>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </hostdev>
    <hostdev mode='subsystem' type='usb' managed='yes'>
      <source>
        <vendor id='0x04fc'/>
        <product id='0x05d8'/>
      </source>
    </hostdev>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </memballoon>
  </devices>
  <qemu:commandline>
    <qemu:arg value='-device'/>
    <qemu:arg value='ioh3420,bus=pci.0,addr=1c.0,multifunction=on,port=2,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:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=01:00.1,bus=root.1,addr=00.1'/>
  </qemu:commandline>
</domain>

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.