Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Upgrade from 6.9.2 -> 6.10.RC4 USB in VM problem

Featured Replies

Hi All

 

UPDATE: Known problem from 6.10.RC1 - still a problem in RC4

 

I took the plunge and upgraded to 6.10.rc4 and I am getting this in the logfile

(My hope was to get my UI up on my local monitor again if I upgraded, - This actually resolved the local UI is now working!) 

 

But the error I have after reboot is this:

kernel: usb 1-1: usbfs: process 17779 (qemu-system-x86) did not claim interface 1 before use

Its filling up and have been running since my reboot

 

I found that my Hassio VM - running Home assistant was the cause of this since its using the USB

After stopping this VM it stopped complaining about the USB

 

Apr 13 14:38:27 SERVER kernel: br0: port 2(vnet0) entered disabled state
Apr 13 14:38:27 SERVER kernel: device vnet0 left promiscuous mode
Apr 13 14:38:27 SERVER kernel: br0: port 2(vnet0) entered disabled state
Apr 13 14:38:27 SERVER avahi-daemon[15666]: Withdrawing address record for fe80::fc27:ebff:feb8:e5c9 on vnet0.
Apr 13 14:38:27 SERVER kernel: usb 1-11: reset full-speed USB device number 4 using xhci_hcd
Apr 13 14:38:27 SERVER kernel: cdc_acm 1-11:1.0: ttyACM0: USB ACM device
Apr 13 14:38:28 SERVER kernel: usb 1-1: reset full-speed USB device number 10 using xhci_hcd
Apr 13 14:38:28 SERVER kernel: cdc_acm 1-1:1.0: ttyACM1: USB ACM device
Apr 13 14:38:28 SERVER usb_manager: Info: rc.usb_manager  vm_action Hassio 1 stopped end -
Apr 13 14:38:28 SERVER usb_manager: Info: rc.usb_manager VM Shutdown dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2421314 vm: Hassio 1 
Apr 13 14:38:28 > usb_manager: Info: rc.usb_manager VM Shutdown 0658_0200 vm: Hassio 1 

 

I am only using the USB manager plugin to control them in the VM (So I think thats the cause of the bug)

 

[Plugin] USB_Manager - Plugin Support - Unraid

 

 

I have included my diag. file here.

 

Diagnostics-20220413-1450.zip

Edited by casperse

  • Replies 67
  • Views 14.8k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • stefan.tomko
    stefan.tomko

    I followed instructions given by SimonF. I use USB manager but did not know that new feature has been added to pass device to VM in serial mode. So instead of modifying XML file, all you need to do is

  • If anyone come here to get Home assistant working in a VM running UNraid 6.10,RC4  and you don't want to start over configuring your ZIGBEE HA then do this:   https://community.home-assistan

  • stefan.tomko
    stefan.tomko

    I am having the same issue with 6.10.3. Everything works OK on 6.9.2 I am using plugin "USB devices" and somehow I feel like editing the VM code, while it may fix things, is a workaround only. Is

Posted Images

  • Author

Update: I disabled the "USB manager" plugin and selected the two USB in the Hassio VM and I still get the same error?

So this USB passthrough in VM might be related to some other problem after upgrade of Unraid?

 

Edited by casperse

  • Author

I can confirm that the USB problem is not related to the USB manager (I removed the plugin) and after a reboot I selected the USB from the VM:

image.thumb.png.9cf050585b206da507492189ca749d10.png

 

And then afterwards I get the log running forever:

Apr 13 16:45:09 UNRAID kernel: usb 1-1: usbfs: process 19810 (qemu-system-x86) did not claim interface 1 before use

 

Anyone have any way to fix this? - Would really like to keep the 6.10.rc4 but I need Home assistant to run the smart house 🙂

 

 

  • Author

Seems to be a known problem back to 6.10.rc2?

Seem strange that it works in 6.9....

 

 

  • Author

I did the insert this in the XML for Home assistant if using the Conbee2 stick!

    </memballoon> placed under this line:
	
    <serial type='dev'>
      <source path='/dev/serial/by-id/usb-0000_0000-if00'/>
      <target type='usb-serial' port='1'>
        <model name='usb-serial'/>
      </target>
      <alias name='serial1'/>
      <address type='usb' bus='0' port='4'/>
    </serial>

 

Get USB ID by console:

ls /dev/serial/by-id/

 

But even if I got the VM started then Home assistant cant access the Conbee stick?

image.png.0aad32a08a85ea8eaac92321426a9bba.png

  • casperse changed the title to Upgrade from 6.9.2 -> 6.10.RC4 USB in VM problem
  • Community Expert
12 hours ago, casperse said:

Hi All

 

UPDATE: Known problem from 6.10.RC1 - still a problem in RC4

 

I took the plunge and upgraded to 6.10.rc4 and I am getting this in the logfile

(My hope was to get my UI up on my local monitor again if I upgraded, - This actually resolved the local UI is now working!) 

 

But the error I have after reboot is this:

kernel: usb 1-1: usbfs: process 17779 (qemu-system-x86) did not claim interface 1 before use

Its filling up and have been running since my reboot

 

I found that my Hassio VM - running Home assistant was the cause of this since its using the USB

After stopping this VM it stopped complaining about the USB

 

Apr 13 14:38:27 SERVER kernel: br0: port 2(vnet0) entered disabled state
Apr 13 14:38:27 SERVER kernel: device vnet0 left promiscuous mode
Apr 13 14:38:27 SERVER kernel: br0: port 2(vnet0) entered disabled state
Apr 13 14:38:27 SERVER avahi-daemon[15666]: Withdrawing address record for fe80::fc27:ebff:feb8:e5c9 on vnet0.
Apr 13 14:38:27 SERVER kernel: usb 1-11: reset full-speed USB device number 4 using xhci_hcd
Apr 13 14:38:27 SERVER kernel: cdc_acm 1-11:1.0: ttyACM0: USB ACM device
Apr 13 14:38:28 SERVER kernel: usb 1-1: reset full-speed USB device number 10 using xhci_hcd
Apr 13 14:38:28 SERVER kernel: cdc_acm 1-1:1.0: ttyACM1: USB ACM device
Apr 13 14:38:28 SERVER usb_manager: Info: rc.usb_manager  vm_action Hassio 1 stopped end -
Apr 13 14:38:28 SERVER usb_manager: Info: rc.usb_manager VM Shutdown dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2421314 vm: Hassio 1 
Apr 13 14:38:28 > usb_manager: Info: rc.usb_manager VM Shutdown 0658_0200 vm: Hassio 1 

 

I am only using the USB manager plugin to control them in the VM (So I think thats the cause of the bug)

 

[Plugin] USB_Manager - Plugin Support - Unraid

 

 

I have included my diag. file here.

 

Diagnostics-20220413-1450.zip 306.19 kB · 0 downloads

Hi I am away at present but will look when back home around 23rd. Did you fix the issue?

  • Author

Yes thanks!

I had to do the XML changes to get the serial USB device added in the VM - and then the HA process above to change the Zigbee HA path and keeping the DB for all my existing devices 🙂 - so I am really happy to now be on 6.10.rc4 

  • 2 weeks later...
  • Community Expert
On 4/14/2022 at 12:59 PM, casperse said:

Yes thanks!

I had to do the XML changes to get the serial USB device added in the VM - and then the HA process above to change the Zigbee HA path and keeping the DB for all my existing devices 🙂 - so I am really happy to now be on 6.10.rc4 

Are you running on RC4 now? can provide output of cat /etc/libvirt/hooks/qemu and ls /etc/libvirt/hooks/qemu.d/

 

I think I am missing removal of the 6.9.2 vers updates during upgrade to 6.10 vers

 

Just checked should be removing.

Edited by SimonF

  • Author
On 4/22/2022 at 4:59 PM, SimonF said:

Are you running on RC4 now? can provide output of cat /etc/libvirt/hooks/qemu and

 

On 4/22/2022 at 4:59 PM, SimonF said:

 

I think I am missing removal of the 6.9.2 vers updates during upgrade to 6.10 vers

 

Just checked should be removing.

Yes of course, anything to help

 

#!/usr/bin/env php

<?php
#begin USB_MANAGER
if ($argv[2] == 'prepare' || $argv[2] == 'stopped'){
  shell_exec("/usr/local/emhttp/plugins/usb_manager/scripts/rc.usb_manager vm_action '{$argv[1]}' {$argv[2]} {$argv[3]} {$argv[4]}  >/dev/null 2>&1 & disown") ;
}
#end USB_MANAGER
if (!isset($argv[2]) || $argv[2] != 'start') {
        exit(0);
}

$strXML = file_get_contents('php://stdin');

$doc = new DOMDocument();
$doc->loadXML($strXML);

$xpath = new DOMXpath($doc);

$args = $xpath->evaluate("//domain/*[name()='qemu:commandline']/*[name()='qemu:arg']/@value");

for ($i = 0; $i < $args->length; $i++){
        $arg_list = explode(',', $args->item($i)->nodeValue);

        if ($arg_list[0] !== 'vfio-pci') {
                continue;
        }

        foreach ($arg_list as $arg) {
                $keypair = explode('=', $arg);

                if ($keypair[0] == 'host' && !empty($keypair[1])) {
                        vfio_bind($keypair[1]);
                        break;
                }
        }
}

exit(0); // end of script



function vfio_bind($strPassthruDevice) {
        // Ensure we have leading 0000:
        $strPassthruDeviceShort = str_replace('0000:', '', $strPassthruDevice);
        $strPassthruDeviceLong = '0000:' . $strPassthruDeviceShort;

        // Determine the driver currently assigned to the device
        $strDriverSymlink = @readlink('/sys/bus/pci/devices/' . $strPassthruDeviceLong . '/driver');

        if ($strDriverSymlink !== false) {
                // Device is bound to a Driver already

                if (strpos($strDriverSymlink, 'vfio-pci') !== false) {
                        // Driver bound to vfio-pci already - nothing left to do for this device now regarding vfio
                        return true;
                }

                // Driver bound to some other driver - attempt to unbind driver
                if (file_put_contents('/sys/bus/pci/devices/' . $strPassthruDeviceLong . '/driver/unbind', $strPassthruDeviceLong) === false) {
                        file_put_contents('php://stderr', 'Failed to unbind device ' . $strPassthruDeviceShort . ' from current driver');
                        exit(1);
                        return false;
                }
        }

        // Get Vendor and Device IDs for the passthru device
        $strVendor = file_get_contents('/sys/bus/pci/devices/' . $strPassthruDeviceLong . '/vendor');
        $strDevice = file_get_contents('/sys/bus/pci/devices/' . $strPassthruDeviceLong . '/device');

        // Attempt to bind driver to vfio-pci
        if (file_put_contents('/sys/bus/pci/drivers/vfio-pci/new_id', $strVendor . ' ' . $strDevice) === false) {
                file_put_contents('php://stderr', 'Failed to bind device ' . $strPassthruDeviceShort . ' to vfio-pci driver');
                exit(1);
                return false;
        }

        return true;
}

 

could do the list
/bin/ls: cannot access '/etc/libvirt/hooks/qemu.d/': No such file or directory?

  • Community Expert
On 4/26/2022 at 6:36 PM, casperse said:

/bin/ls: cannot access '/etc/libvirt/hooks/qemu.d/': No such file or directory?

This is fine as you are not on 6.10rc.

 

When you upgrade the entries should be removed from the qemu file and a new file created in qemu.d

  • Author
On 5/1/2022 at 2:04 PM, SimonF said:

This is fine as you are not on 6.10rc.

 

When you upgrade the entries should be removed from the qemu file and a new file created in qemu.d

I  was on RC4 I am now on RC5

Do you need anymore info or additional running commands from me? :--)

  • Community Expert
1 hour ago, casperse said:

I  was on RC4 I am now on RC5

Do you need anymore info or additional running commands from me? :--)

I dont think so. Are you seeing any issues? 

 

cat /etc/libvirt/hooks/qemu and ls /etc/libvirt/hooks/qemu.d/

 

There should be no entries in the qemu file and a file in qemu.d dir called usb_manager.

  • Author

Yes I get this no - no further problems 🙂

image.thumb.png.2e641ce958dbff02fdbeb41f97c99eb6.png

  • 2 weeks later...

Thanks for this fix, the issue still seems to be in 6.10 final, and after making the XML adjustments and the naming changes in my HA file my Zigbee is back up and running.

  • 2 weeks later...

This is definitely still an issue -- currently reading through past threads after upgrading to 6.10.2 and being flooded with the following messages and an unusable ConBee II:

May 29 10:32:30 Unraid kernel: usb 2-1.4: usbfs: process 32050 (qemu-system-x86) did not claim interface 1 before use


Solution as posted in this thread (and others) was to obtain the proper device path for the ConBee II and manually add this in to the virtual machine XML as per https://community.home-assistant.io/t/unraid-vm-conbee-ii-stick-dev-path-change-configuration-problem/411424.

 

 

Edited by nmethod

Even after the solution in the link from the previous post I still receive a flood of the error that nmethod posted above.

 

Running Unraid 6.10.2

I just tried upgrading to Unraid 6.10.2 but experiencing the same issue. Also with the USB Manager plugin. IMHO editing the XML for device mapping is quite a poor solution. I hope the Unraid developers can provide a real bug fix.

 

Luckily downgrading Unraid is a breeze, so thanks for that.

A backward step for me. Conbee II working reliably (GUI or XML edit) with Unraid 6.9.2. Can't get either option working under 6.10.2. Hoping for an easy fix in the future. In the meantime I've downgraded.

Unfortunately I have had to downgrade as well, the XML, config edits just didn't work for me (strangely nothing relevant in core.config_entries to edit). I will hopefully look to upgrade once a reliable solution is found.

  • 2 weeks later...

Looks like this is still an issue with 6.10.3

 

Is there anything else that can be tried to pass the conbee usb through without error?

9 hours ago, fgy41 said:

Looks like this is still an issue with 6.10.3

 

Is there anything else that can be tried to pass the conbee usb through without error?

 

Yeah, can firm I have this in 6.10.3 RC1 too 

  • Community Expert
3 hours ago, fgy41 said:

I was able to find a solution that worked for me.

 

https://community.home-assistant.io/t/solved-conbee-2-fails-to-connect-to-zha-ha-in-unraid-vm/431276/2#final-edit-my-solution-1

 

The post is by maxistviews (marked as Solution)

 

Note:

You will need to remove and readd the the ZHA integration. During the initial configuration of ZHA the Conbee showed up as: /dev/serial/by-id/usb-QEMU_QEMU_USB_SERIAL.....

 

Do you still pass thru the usb device or just the serial entry.

2 minutes ago, SimonF said:

Do you still pass thru the usb device or just the serial entry.

This solution has so far worked for me as well, with just the serial entry.  I feel like going from 10.1 to 10.2 broke it again and I had to redo it and I was nervous going to 10.3, but it went smoothly.  I do wish just adding the usb device would work as expected (or as I expect it to), but I guess if the serial way works for now, I'll go with it.

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...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.