May 29, 201610 yr Does anyone know if this plugin is still being worked on? I have 2 vms which use hotplug all the time but it would be great if I could replace my 2 usb controllers for this plugin The main thing I need to do is pass usb hubs over, once the hub is passed through I would presume all connected usbs would be also? I haven't tried this yet but I want to clarify before installing it My usb hubs are not shown as devices that can be passed through under the vm manager window if that makes a difference
May 29, 201610 yr Author Does anyone know if this plugin is still being worked on? I have 2 vms which use hotplug all the time but it would be great if I could replace my 2 usb controllers for this plugin The main thing I need to do is pass usb hubs over, once the hub is passed through I would presume all connected usbs would be also? I haven't tried this yet but I want to clarify before installing it My usb hubs are not shown as devices that can be passed through under the vm manager window if that makes a difference Well i am currently maintaining the plugin as its in my regular use. So will fix any issues caused by upgrades of Unraid Versions (Curently works with 6.1 and 6.2 Beta). As for your request it will not work with this plugin. This plugin works with USB attach functionality built in into QEMU (Virsh). It works with USB Hubs but cannot pass-through the HUB itself. Only able to pass-through Devices plugged into a HUB. I found this from Proxmox Documentation which also uses QEMU. Assigning Devices to VMs Note that only "real" devices can be assigned, i.e. assigning of USB hubs is not possible. Also i am using the same library of Unraid to display devices which is used in VM Page. Which specifically filters USB Hubs from the list of USB Devices because they are not supported. So i am afraid you have to continue using the 2 USB Controllers.
May 29, 201610 yr Hi bshakil Thanks for the quick reply, that is not an issue as I can pass through the individual devices - I just saw mention of hubs and took a guess Regards, Jamie P. S. Great plugin!
May 30, 201610 yr Hey and thanks for the plugin! I guess that when attaching one USB to VM, it disappears from the unRAID server.. now, will it reattached automatically to the unRAID server after stopping the VM or after restarting the unRAID server? thanks. if not, is there a way for attaching one or two USB devices permanently to a VM? Thanks!
May 30, 201610 yr Thanks for putting this out. I never did get around to finalizing this since they took over the vm manager. What I had put together was a drop down checklist for each vm between memory and hard drives and was using virsh like you did. I don't think I pushed any of that to my github but your welcome to it if you want. Here's the usbhotplug.php I was using. I added the persistent option so it would save to the vm when shutdown. Otherwise you lose the usb you hot plugged. I'm not sure if that's something people would want or would want an option to save it. <? $arrValues = explode(":",$_POST["values"]); $xml = "<hostdev mode='subsystem' type='usb' managed='yes'> <source> <vendor id='0x{$arrValues[1]}'/> <product id='0x{$arrValues[2]}'/> </source> </hostdev>"; $filename = "/usr/local/emhttp/plugins/dynamix.vm.manager/usb.xml"; file_put_contents($filename, $xml); $cmd = "virsh {$_POST['options']} --domain '{$arrValues[0]}' --file '$filename' --persistent 2>&1"; exec($cmd, $arrOutput); echo $arrOutput[1]; ?> Also I noticed you used the dynamix plg as a template but left some of the original comments in there. Good job on plugin. It works great.
May 31, 201610 yr Author Thanks for putting this out. I never did get around to finalizing this since they took over the vm manager. What I had put together was a drop down checklist for each vm between memory and hard drives and was using virsh like you did. I don't think I pushed any of that to my github but your welcome to it if you want. Here's the usbhotplug.php I was using. I added the persistent option so it would save to the vm when shutdown. Otherwise you lose the usb you hot plugged. I'm not sure if that's something people would want or would want an option to save it. <? $arrValues = explode(":",$_POST["values"]); $xml = "<hostdev mode='subsystem' type='usb' managed='yes'> <source> <vendor id='0x{$arrValues[1]}'/> <product id='0x{$arrValues[2]}'/> </source> </hostdev>"; $filename = "/usr/local/emhttp/plugins/dynamix.vm.manager/usb.xml"; file_put_contents($filename, $xml); $cmd = "virsh {$_POST['options']} --domain '{$arrValues[0]}' --file '$filename' --persistent 2>&1"; exec($cmd, $arrOutput); echo $arrOutput[1]; ?> Also I noticed you used the dynamix plg as a template but left some of the original comments in there. Good job on plugin. It works great. I knew about the persistent option. But i didn't include it since it modifies the Domain XML file which will be redundant since this functionality is already available in VM Manager. If someone wants to associate a USB device with a VM permanently they can do it from VM Manager instead of my plugin. But one thing i need help with is reattaching the USB device automatically back to VM when someone physically remove the USB and replug it while the VM is running. I understood that udev handles all physical devices attached to a linux machine. But coudnt figure out how to isolate only few usb devices and detach/reattach them to VM upon unplugging and plugging. If you can provide any assistance regarding this issue. It will be great help to finalize v2.0 of my Plugin.
May 31, 201610 yr Here's a link I had saved about udev. http://rolandtapken.de/blog/2011-04/how-auto-hotplug-usb-devices-libvirt-vms-update-1
May 31, 201610 yr Author Brilliant and to the point. You rock. I will test it. If its as simple as the article says. I think i can finally bring the requested functionality.
June 1, 201610 yr I have tried to attach a kingston and a sandisk USB stick to my Windows10 machine, and I get a "Device attached successfully" on both of them but windows doesnt recognize them. What drivers am I missing? I have tried telling windows to find the drivers and I have tried to tell windows to use drivers from the virtio-win-0.1.102.iso but nothing works. It just says windows is using the best drivers.
June 17, 201610 yr Anyone else receive a Code 10 "The device cannot start" error? I'm trying to connect an android phone, but even with the latest drivers installed I'm receiving this error.
June 18, 201610 yr There are a few issues with VMs seeing USB devices but nothing this plugin can resolve i believe I have a 64GB kingston USB pendrive and an external HDD cradle Passing them to my main VM running OVMf the devices don't appear at all Passing them to my second VM using SeaBios and they work instantly This is on the latest beta 23 however so there may be something that needs updating to make it work with OVMF but i'm not sure Just pointing it out id needed, honestly glad i found this plugin! Regards, Jamie
June 25, 201610 yr Anyone else receive a Code 10 "The device cannot start" error? I'm trying to connect an android phone, but even with the latest drivers installed I'm receiving this error. Am I the only one with this issue?
July 12, 20169 yr Anyone else receive a Code 10 "The device cannot start" error? I'm trying to connect an android phone, but even with the latest drivers installed I'm receiving this error. Am I the only one with this issue? New USB Pass Through Method with USB 3...Please Test https://r.tapatalk.com/shareLink?url=http%3A%2F%2Flime-technology%2Ecom%2Fforum%2Findex%2Ephp%3Ftopic%3D41922&share_tid=41922&share_fid=18593&share_type=t Sent from my iPhone using Tapatalk
August 10, 20169 yr I love this plug-in! Great work! I wanted to get your thoughts on listing and adding the device address with your plug-in. No matter if your using vanilla UnRAID or your plug-in, having many identical devices (for me its Logitech Unifying Receivers and USB NICs) is problematic. I know which bus they're on but their enumeration changes on removal/reboot. Thanks again for creating this plug-in. Neil
December 5, 20169 yr it doesn't work with usb storage devices also, can you make one that automatically attaches anything you plug in to a specified vm
December 9, 20169 yr it doesn't work with usb storage devices also, can you make one that automatically attaches anything you plug in to a specified vm It does work with usb storage devices from what I have tested and I don't know why it shouldn't as it just uses virsh.
December 9, 20169 yr it doesn't work with usb storage devices also, can you make one that automatically attaches anything you plug in to a specified vm It does work with usb storage devices from what I have tested and I don't know why it shouldn't as it just uses virsh. well, I will try it with more usb storage devices, I think the problem was that (not sure but probably) the storage device was mounted in the host.
February 4, 20179 yr bshakil hasn't been around for a while, and I'm thinking about significantly expanding this plugin (at least initially as a script with a future possibility for a plugin) to support automatically detecting changes and applying them to the specified VM. But, I would need to know a couple of things to determine how things would work (and only need to know for those that DO NOT have any usb controllers passed through) just so I can compare your system's operation to my system's - How many Busses are listed when you do lsusb - How many USB ports total does your motherboard support total according to the manual. Note that this does not necessarily mean the number of ports you have installed. You may have extra USB headers unused on the motherboard. - Plug a USB device into a particular port lsusb pull the device and then plug it in again to the exact same port lsusb Did the device number for the device change?
February 5, 20179 yr Is there any compatibility problems with this plugin and unraid 6.3? I tried it while I was making a hotplug script today and it works fine.
February 5, 20179 yr Squid, I use this plugin for my Windows 10 VM and find it real useful. A hot plug version would be very welcome. Let me know if you need my help.
July 20, 20178 yr after improperly disconnecting USB camera I now get this error when I try to reconnect it to VM any ideas? error: Failed to attach device from /tmp/libvirthotplugusb.xml error: internal error: unable to execute QEMU command 'device_add': usb port 2 (bus usb.0) not found (in use?)
July 20, 20178 yr Author 3 minutes ago, SylverWolf said: after improperly disconnecting USB camera I now get this error when I try to reconnect it to VM any ideas? error: Failed to attach device from /tmp/libvirthotplugusb.xml error: internal error: unable to execute QEMU command 'device_add': usb port 2 (bus usb.0) not found (in use?) Did you try detaching the device before attaching. Sometimes when you remove the device it remains attached to the VM. So select the same device Detach it and then try to attach it again.
July 20, 20178 yr 5 hours ago, bshakil said: Did you try detaching the device before attaching. Sometimes when you remove the device it remains attached to the VM. So select the same device Detach it and then try to attach it again. Yes, I did, in fact it can attach and detach successfully from other VM's just not this one. Again it was working before. I also tried deleting the lib XML and uninstalling the plugin and reinstalling also rebooting the unraid server. error: Failed to detach device from /tmp/libvirthotplugusb.xml error: operation failed: host usb device vendor=0x046d product=0x082d not found this is what i get when i hit detach
January 7, 20188 yr On 2/4/2017 at 12:59 PM, Squid said: bshakil hasn't been around for a while, and I'm thinking about significantly expanding this plugin (at least initially as a script with a future possibility for a plugin) to support automatically detecting changes and applying them to the specified VM. But, I would need to know a couple of things to determine how things would work (and only need to know for those that DO NOT have any usb controllers passed through) just so I can compare your system's operation to my system's - How many Busses are listed when you do lsusb - How many USB ports total does your motherboard support total according to the manual. Note that this does not necessarily mean the number of ports you have installed. You may have extra USB headers unused on the motherboard. - Plug a USB device into a particular port lsusb pull the device and then plug it in again to the exact same port lsusb Did the device number for the device change? Did anything ever come of this, Squid? Just found this plugin today and while it's working for me so far, I'm curious if you ever came up with anything script or new plugin wise?
Archived
This topic is now archived and is closed to further replies.