Scarat Posted June 29, 2022 Share Posted June 29, 2022 Hi, first of all thank you for the great plugin. The thing that I'm trying to accomplish is regarding usbip, so my usb device is on the remote system. When there is no binded device on remote raspberry pi I see this in Unraid USB plugin. When I bind the device then in USB plugin I see the usb device and I can manually attach it. The thing is that I would like for this device to be attached automatically whenever it is discovered. Is there some setting that I'm missing? I have also found this in the settings. Is this somehow related to the functionality that I'm trying to accomplish or what is the purpose of USBIP remote Checker? Also I'm not able to make it enabled whatever settings I apply it is always grayed out. Thank you very much for your help. Quote Link to comment
SimonF Posted June 29, 2022 Author Share Posted June 29, 2022 (edited) 7 hours ago, Scarat said: Is this somehow related to the functionality that I'm trying to accomplish or what is the purpose of USBIP remote Checker? Hi I think you may be using the beta vers, Its something I have started thinking of adding, but I forgot to hide the values when I released the beta version to handle the change in state processing. It may appear in the future but currently no time frame. Edited June 29, 2022 by SimonF Quote Link to comment
crankyCowboy Posted July 1, 2022 Share Posted July 1, 2022 I have a Home Assistant VM that has a zwave device (zooz 700 stick) and a Zigbee device (sonoff zigbee plus). Both devices have the same info and show up as "silicon labs cp210x uart bridge (10c4:ea60). I can pass one through without issue, but if both are connected both get selected to pass through and I get an error stating that I can't pass duplicate devices through. Would this plugin "fix" this for me? I'm relatively new to unraid and certainly new to VMs, so take it easy on me. What settings would I ideally use if this is a viable solution? Thank you. Quote Link to comment
Eksitus Posted July 1, 2022 Share Posted July 1, 2022 2 hours ago, crankyCowboy said: I have a Home Assistant VM that has a zwave device (zooz 700 stick) and a Zigbee device (sonoff zigbee plus). Both devices have the same info and show up as "silicon labs cp210x uart bridge (10c4:ea60). I can pass one through without issue, but if both are connected both get selected to pass through and I get an error stating that I can't pass duplicate devices through. Would this plugin "fix" this for me? I'm relatively new to unraid and certainly new to VMs, so take it easy on me. What settings would I ideally use if this is a viable solution? Thank you. From my experience with this plugin, even if you don't use it for USB/IP it can act as an extension of unassigned devices (UD) plugin where you can hotplug (attach/detach) USB devices on running VMs, yet UD has limitation where it cannot handle devices with the same name. However, this plugin distinguishes the devices by their bus/id allocation and can hotplug them even when they share the same name or manufacturer info. If I'm mistaken I hope someone can correct me since I don't have an Unraid machine nearby to back up my claims, but I'm fairly confident it will solve your problem at least when it comes to hotplugging the devices (attaching them to VM after it started). Quote Link to comment
SimonF Posted July 1, 2022 Author Share Posted July 1, 2022 5 hours ago, crankyCowboy said: I have a Home Assistant VM that has a zwave device (zooz 700 stick) and a Zigbee device (sonoff zigbee plus). Both devices have the same info and show up as "silicon labs cp210x uart bridge (10c4:ea60). I can pass one through without issue, but if both are connected both get selected to pass through and I get an error stating that I can't pass duplicate devices through. Would this plugin "fix" this for me? I'm relatively new to unraid and certainly new to VMs, so take it easy on me. What settings would I ideally use if this is a viable solution? Thank you. Yes it will allow that and was one of the reason for creating the plugin as VM Manager uses the vendor and product to add to a VM where I use bus and dev to do the mapping. Do they show the same serial number? You can attach using the USB port or by the device. I have many Same make model USB sticks [email protected]:~# lsusb Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 003: ID 2109:0817 VIA Labs, Inc. USB3.0 Hub Bus 002 Device 004: ID 05e3:0749 Genesys Logic, Inc. SD Card Reader and Writer Bus 002 Device 002: ID 05e3:0626 Genesys Logic, Inc. USB3.1 Hub Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 013: ID 0781:5567 SanDisk Corp. Cruzer Blade Bus 001 Device 012: ID 0781:5567 SanDisk Corp. Cruzer Blade Bus 001 Device 033: ID 1cf1:0030 Dresden Elektronik ZigBee gateway [ConBee II] Bus 001 Device 008: ID 2109:2817 VIA Labs, Inc. USB2.0 Hub Bus 001 Device 007: ID 0781:5567 SanDisk Corp. Cruzer Blade Bus 001 Device 005: ID 05e3:0608 Genesys Logic, Inc. Hub Bus 001 Device 003: ID 1462:7d25 Micro Star International MYSTIC LIGHT Bus 001 Device 010: ID 0781:5567 SanDisk Corp. Cruzer Blade Bus 001 Device 009: ID 0781:5567 SanDisk Corp. Cruzer Blade Bus 001 Device 006: ID 05e3:0608 Genesys Logic, Inc. Hub Bus 001 Device 004: ID 0658:0200 Sigma Designs, Inc. Aeotec Z-Stick Gen5 (ZW090) - UZB Bus 001 Device 002: ID 05e3:0610 Genesys Logic, Inc. Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub [email protected]:~# Quote Link to comment
crankyCowboy Posted July 1, 2022 Share Posted July 1, 2022 @SimonF Thank you very much for the reply. I haven't installed your plugin yet, but intend to do that. Will the devices just show up like your second picture and I just click "vm attach" or "bind" in order for them to show up in the HA VM? attached are a picture of my usb devices. Thank you for your help, and for the awesome plugin. Quote Link to comment
SimonF Posted July 1, 2022 Author Share Posted July 1, 2022 8 minutes ago, crankyCowboy said: Thank you for your help, and for the awesome plugin Does lsusb -vs 001:030 | grep Serial lsusb -vs 001:029 | grep Serial provide different serial numbers, no need to share just confirm if that is the case or not. You may need to use the Beta vers so it shows the connection as the stable version was using serial number as the key for state. Also you will have to map by port as device uses the serial number to ID the device. with each entry you can specify if the device is connected automatically when you plug in or start vms etc. You should remove any mappings for the usb device in VM Manager or you can just click attach if you want a manual method. You do not need USBIP function so BIND will not show unless you enable USBIP. Example Mappings. Quote Link to comment
crankyCowboy Posted July 1, 2022 Share Posted July 1, 2022 @SimonFI have confirmed that both devices are showing different serial numbers. 1 Quote Link to comment
crankyCowboy Posted July 2, 2022 Share Posted July 2, 2022 @SimonF I installed the plugin, and then on the usb tab, I have changed the device mapping to "auto connect at usb device pluging" and also "auto connect to vm at vm start" and selected HA as my VM. However, when I start the HA VM, the devices don't appear to connect automatically uniess I manually click "VM attach". Am I doing something wrong? If I click VM attach, then they show conntected and everythign appears to work as expected (which is awesome by the way). I just don't understand why they aren't connecting automatically when the VM starts? Quote Link to comment
SimonF Posted July 2, 2022 Author Share Posted July 2, 2022 (edited) @crankyCowboyWhich version did you install. If you are on unraid < 6.10 you should see a file in /etc/libvirt/hooks called QEMU with lines added at the beginning for USB Manager'. #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 >= 6.10 you should see a file /etc/libvirt/hooks/qemu.d/USB_manager What do you get in the log? Maybe be different from below as this is the newer version(Beta). Jul 1 13:05:02 unraid usb_manager: Info: rc.usb_manager vm_action Ubuntu stopped end - Jul 1 13:05:02 unraid usb_manager: Info: rc.usb_manager VM Shutdown 002/006 vm: Ubuntu Jul 1 13:05:02 unraid usb_manager: Info: rc.usb_manager VM Shutdown 002/009 vm: Ubuntu Jul 1 13:05:08 unraid usb_manager: Info: rc.usb_manager vm_action Ubuntu prepare begin - Jul 1 13:05:09 unraid usb_manager: usb_manager virsh called Ubuntu 2 6 Device attached successfully Jul 1 13:05:09 unraid usb_manager: Info: rc.usb_manager Autoconnect Start 002/006 temp vm: Ubuntu Jul 1 13:05:09 unraid usb_manager: Info: rc.usb_manager Autoconnect Port Map Port:2-1.3 vm: Ubuntu Jul 1 13:05:09 unraid usb_manager: Info: rc.usb_manager Autoconnect Start 002/006 vm: Ubuntu Device in Use action ignored. Jul 1 13:05:09 unraid usb_manager: Info: rc.usb_manager Autoconnect for hub 002/009 Ubuntu;002;009;002/009;Auto;Hub; no Jul 1 13:05:09 unraid usb_manager: Info: rc.usb_manager Autoconnect Port Map Port:2-1.3.2 vm: Ubuntu Jul 1 13:05:09 unraid usb_manager: usb_manager virsh called Ubuntu 2 9 Device attached successfully Jul 1 13:05:09 unraid usb_manager: Info: rc.usb_manager Autoconnect Start 002/009 temp vm: Ubuntu Also are you able to show me screen prints, happy for you to PM if you dont want to share on this page. Edited July 2, 2022 by SimonF Quote Link to comment
crankyCowboy Posted July 2, 2022 Share Posted July 2, 2022 Thank you again @SimonF. I guess I'm about to display my ignorance here. I can navigate to my qemu file via terminal; however, i don't know how to view it. I should possibly also mention that in my /etc directory, I have a /libvert and a /libvert- directory. Both seem to have "hooks" within them. Not sure if that matters. I am on the beta version of the plugin, and also on unraid 6.10.0. Below is the picture that you requested as well as my usb devices (hopefully there isn't anythign in there I should have greyed out). In any case, thank you for the help. Quote Link to comment
SimonF Posted July 2, 2022 Author Share Posted July 2, 2022 1 hour ago, crankyCowboy said: Thank you again @SimonF. I guess I'm about to display my ignorance here. I can navigate to my qemu file via terminal; however, i don't know how to view it. I should possibly also mention that in my /etc directory, I have a /libvert and a /libvert- directory. Both seem to have "hooks" within them. Not sure if that matters. I am on the beta version of the plugin, and also on unraid 6.10.0. Below is the picture that you requested as well as my usb devices (hopefully there isn't anythign in there I should have greyed out). In any case, thank you for the help. If you are 6.10 cat /etc/libvirt/hooks/qemu.d/USB_Manager should show this result. [email protected]:~# cat /etc/libvirt/hooks/qemu.d/USB_Manager #!/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 ?> [email protected]:~# As you dont have devices with the same serial you can run the stable version. if you detach the devices, remove the beta version and then install the stable version. Setting should still be in place. Then try stopping and starting the VM to see if they autoconnect. Quote Link to comment
crankyCowboy Posted July 2, 2022 Share Posted July 2, 2022 @SimonF Thank you again. I uninstalled the beta version and installed the stable version. Entering the data above in terminal did yield the same results as you indicated above. When I start the VM, now the devices connect, but I'm getting a virt error now (on both devices). I have to hover to get the exact error so it's sort of hard to see, but please see the error. any suggestions or fixing it? Quote Link to comment
SimonF Posted July 2, 2022 Author Share Posted July 2, 2022 (edited) 1 hour ago, crankyCowboy said: any suggestions or fixing it Sorry I forgot to get you to remove the state file. This will rename it. Remove the plugin, run this command mv /usr/local/emhttp/state/usb.ini /usr/local/emhttp/state/usbold.ini and then reload the plugin from CA. Edited July 2, 2022 by SimonF 1 Quote Link to comment
crankyCowboy Posted July 3, 2022 Share Posted July 3, 2022 6 hours ago, SimonF said: Sorry I forgot to get you to remove the state file. This will rename it. Remove the plugin, run this command mv /usr/local/emhttp/state/usb.ini /usr/local/emhttp/state/usbold.ini and then reload the plugin from CA. @SimonF You are the best man! Thank you very much. That worked and has me back in business. I can't tell you how long I searched for a solution to this. Thank you! 1 Quote Link to comment
SimonF Posted July 10, 2022 Author Share Posted July 10, 2022 (edited) On 4/13/2022 at 1:52 PM, casperse said: Hi Again UPDATE: This seem to be a problem in the way Unraid detects the Conbee2 stick USB in 6.10 releases This would be really cool if the "USB Manager" could fix this? If the USB manager could resolve the Conbee serial ID and create the correct device path? *************************************** OLD POST *************************************** I just upgraded from 6.9.2 -> 6.10.RC4 And I only using this plugin to passthrough USB to my HAssio VM but it seems it dosent work in 6.10.RC4? 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 Again thanks for this great plugin! Thinking about rooling back it work 100% in 6.9.2 I have started to add support for mapping devices as a Serial connection to a VM. So you wont have to use the XML fix. Function works for starting/stopping VM, hotplug removal but doesnt work for hotplug add at this point due to the way i need to get the by-id name. I am using the following for testing for the XML. Will look to make the USB port configurable. $usbstr .= "<serial type='dev'> <source path='${isSerialPath}'/> <target type='usb-serial' port='1'> <model name='usb-serial'/> </target> <alias name='ua-serial${usbbus}${usbdev}'/> <address type='usb' bus='0' port='04'/> </serial>" ; <serial type='dev'> <source path='/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DEXX-if00'/> <target type='usb-serial' port='1'> <model name='usb-serial'/> </target> <alias name='ua-serial001026'/> <address type='usb' bus='0' port='04'/> </serial> Edited July 10, 2022 by SimonF 1 3 Quote Link to comment
SimonF Posted July 15, 2022 Author Share Posted July 15, 2022 (edited) Verison 2022.07.13a is now available with Serial support. Edited July 15, 2022 by SimonF Quote Link to comment
SimonF Posted July 17, 2022 Author Share Posted July 17, 2022 Version 2022.07.17 released. Support for hot plugging devices needing to use serial attach method and user definable Guest USB port. 1 Quote Link to comment
SimonF Posted July 18, 2022 Author Share Posted July 18, 2022 (edited) Version 2022.07.18a released. Reworked the USB Manager VM Hotplug page to only show available devices for Attach, and shows only devices attached to the selected VM for detach. Edited July 18, 2022 by SimonF 1 Quote Link to comment
muzo178 Posted July 20, 2022 Share Posted July 20, 2022 (edited) On 6/29/2022 at 1:52 PM, Scarat said: Hi, first of all thank you for the great plugin. The thing that I'm trying to accomplish is regarding usbip, so my usb device is on the remote system. When there is no binded device on remote raspberry pi I see this in Unraid USB plugin. When I bind the device then in USB plugin I see the usb device and I can manually attach it. The thing is that I would like for this device to be attached automatically whenever it is discovered. Is there some setting that I'm missing? I have also found this in the settings. Is this somehow related to the functionality that I'm trying to accomplish or what is the purpose of USBIP remote Checker? Also I'm not able to make it enabled whatever settings I apply it is always grayed out. Thank you very much for your help. +1 for this. It would be great if USB Manager could mount remote USBIP devices automatically if they are discovered. I have a couple of them set to attach automatically to the VM when they are available, but if I restart the remote host that has the USB devices plugged in, I have to manually attach them so that they then attach to the local VM. Amazing plugin btw. Keep up the good work.. Edited July 20, 2022 by muzo178 Quote Link to comment
SimonF Posted July 20, 2022 Author Share Posted July 20, 2022 8 hours ago, muzo178 said: +1 for this. It would be great if USB Manager could mount remote USBIP devices automatically if they are discovered. I have a couple of them set to attach automatically to the VM when they are available, but if I restart the remote host that has the USB devices plugged in, I have to manually attach them so that they then attach to the local VM. Amazing plugin btw. Keep up the good work.. Will look in to it. Quote Link to comment
SimonF Posted July 22, 2022 Author Share Posted July 22, 2022 @muzo178 @Scarat Started thinking about this. And looking to add two parts. One to detect USBIP hosts automatically and add them into the remote users list. Options to set as Manual i.e. no action or Auto. Auto would then use the frequency an action to add, remove or both, option to exclude the local host if running USBIP. Looking at this being able to run on the following Second part will be to check if that host is on and attach devices how would you like that to work, any options when connecting etc? Sample options below. Quote Link to comment
SimonF Posted July 23, 2022 Author Share Posted July 23, 2022 Release 2022.07.23 I have add the to processes to detect new hosts and check if the host is available and attach the devices. Please test @muzo178 & @Scarat and let me know if that meets your use case or you want additional function let me know. 2022.07.23 Add USBIP host finder and checker options and processing. Checker will attach a USBIP device found not connected to host already. Finder will look for devices in the local subnet using port 3240 and depending on options add or remove the host from the remote USBIP hosts, removal is for a host no longer found. Quote Link to comment
muzo178 Posted July 24, 2022 Share Posted July 24, 2022 On 7/23/2022 at 3:11 PM, SimonF said: Release 2022.07.23 I have add the to processes to detect new hosts and check if the host is available and attach the devices. Please test @muzo178 & @Scarat and let me know if that meets your use case or you want additional function let me know. 2022.07.23 Add USBIP host finder and checker options and processing. Checker will attach a USBIP device found not connected to host already. Finder will look for devices in the local subnet using port 3240 and depending on options add or remove the host from the remote USBIP hosts, removal is for a host no longer found. this is fantastic in initial testing. I am getting this in my syslog every minute though.. UNRAID usb_manager: Info: rc.usb_manager USBIP Host Check attached failed Array Quote Link to comment
SimonF Posted July 24, 2022 Author Share Posted July 24, 2022 (edited) 6 minutes ago, muzo178 said: this is fantastic in initial testing. I am getting this in my syslog every minute though.. UNRAID usb_manager: Info: rc.usb_manager USBIP Host Check attached failed Array I have just updated to version 2022.07.24 which should fix? Edited July 24, 2022 by SimonF Quote Link to comment
Recommended Posts
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.