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.

Libvirt Hot Plugin USB - USB Hot Plugin for VMs

Featured Replies

This is a continuation of the plugin written by bshakil to hot plug USB devices in a VM.  It has been updated for Unraid 6.5 due to some file structure changes.  You will need to remove the previous plugin before installing this one.

 

Installing the plugin

 

You can install the plugin from Community Applications or by pasting the following link in the Install Plugin tab on the Unraid plugins page.

 

https://github.com/dlandon/libvirt.hotplug.usb/raw/master/libvirt.hotplug.usb.plg

 

USB hot plug is now incorporated into Unraid by editing the xml and selecting/unselecting USB devices.  This plugin offers an alternative to that method.

Edited by dlandon
Add note about Unraid support of hotplug USB devices

  • Replies 134
  • Views 46k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • I'm not going to be forking this plugin.  Because it is no longer available within Apps, the messaging the FCP is now changed, with it now being advised to switch to USB Manager.  Similar functionalit

  • For those that are interested, I have found an article here that describes how to set up usb hot plug. https://www.labsrc.com/unraid-automatic-usb-hotplugging-libvirt/#comments   I have

  • I'll have a look.

Posted Images

does this work with all vm operating systems?

  • Author
12 minutes ago, 1812 said:

does this work with all vm operating systems?

It should.

Thanks for updating this. I installed it yesterday and it works great.

Thanks so much for making this update!  I use this daily and was so glad to see an update!

  • 3 weeks later...

Switched from USB passthrough to using this, as my coffee lake system basically has all the USB controllers as one and can't be split apart, and I can't be bothered right now to pick up an additional USB controller

 

But, question though.  Is it possible to have the "last state" of hot-plugged devices through this plugin carried over to the next reboot of unRaid without modifying the XML?

  • 2 weeks later...

For me, this plugin does not work anymore from unRAID 6.5.0.

It no longer appears in the VMs page

2 minutes ago, NY152 said:

It no longer appears in the VMs page

Are you sure you're using dlandon's and not bshakil's version?

  • Author
6 minutes ago, NY152 said:

For me, this plugin does not work anymore from unRAID 6.5.0.

It no longer appears in the VMs page

The dlandon version has a different icon.

libvirt.hotplug_usb.png.4cd3ce6e604ff73c1edfd613c6620969.png

I have this icon

  • 2 months later...

This looks great - I wonder if it could be a but improved.

I am wanting to set up a virtual PC for my daughter on my server, running an HDMI and a USB to her room, where she'll have a monitor, and a powered USB hub to connect keyboard, mouse, headset, etc.  My hold-up is that m motherboard has a pretty poor IOMMU arrangement, so I cannot seem to successfully pass through a USB controller to the VM.  I can simply pass through the USB devices she needs (Keyboard, Mouse, Headset) via USB passthrough, but this doens't allow her to plug in thumbdrives or other devices into her USB hub.

 

I'm wondering if it would be possible to detect when new USB devices are plugged into unRAID, and if they are beneath a defined USB hub, they are auto-hotplugged to a specified virtual machine.

  • 4 months later...

Was this functionality added to unraid? or do I still need to download this for the hot-add usb functionality?

42 minutes ago, jordanmw said:

Was this functionality added to unraid? or do I still need to download this for the hot-add usb functionality?

You still need it. 

  • 3 months later...

Anyone know how to correct for this error?

Quote

 

error: operation failed: Multiple USB devices for XXXX:XXXX, use <address> to specify one


 

 

I am trying to attach a handheld scanner, which when plugged in, seems to register as 2 USB devices.

Instead of hot plugging, I also tried editing the VM settings. This device appears twice (2 checkboxes) in 'form view'. If I check only one box, the VM won't start, throwing a similar error:

Quote

 

Execution error

operation failed: Multiple USB devices for 8088:7809, use to specify one

 

 

  • When I go back in to edit in 'form view', both checkboxes are now selected. 
  • When I check the XML, only one entry exists but still the same behavior occurs.
    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <vendor id='0x8088'/>
        <product id='0x7809'/>
      </source>
      <address type='usb' bus='0' port='4'/>
    </hostdev>

 

Thanks everyone in advance for helping me get this working!

 

Screen 2019-03-29 at 23.48.51.png

Screen 2019-03-29 at 23.49.10.png

Screen 2019-03-29 at 23.49.31.png

Screen 2019-03-29 at 23.50.02.png

  • 2 months later...

Hi, was trying out this plugin.

My setup is a SuperMicro X8DT6-F, with a PCI-e USB-C card. My SSD drive is connected to the USB-C card.

When i Edit my VM, the ssd is listed on the list of USB devices.

However, when i try to start my VM, it throws an error saying its unable to open the bus # and device #.

Any pointers?

P.S my PCI-e card is not setup as passthru.

Thanks!

22 minutes ago, ryan.lio said:

Hi, was trying out this plugin.

My setup is a SuperMicro X8DT6-F, with a PCI-e USB-C card. My SSD drive is connected to the USB-C card.

When i Edit my VM, the ssd is listed on the list of USB devices.

However, when i try to start my VM, it throws an error saying its unable to open the bus # and device #.

Any pointers?

P.S my PCI-e card is not setup as passthru.

Thanks!

Wrong place to ask, mate. You are asking about VM stuff and this topic is about the plugin.

  • 1 month later...

My goodness I don't know how I didn't find this a year ago, this is so helpful. Thank you!

  • 1 month later...

Trying to connect an external disk to a VM, but not successful:

 

error: Failed to attach device from /tmp/libvirthotplugusb.xml
error: internal error: unable to execute QEMU command 'device_add': failed to open host usb device 2:2

 

Any thoughts?

  • 1 month later...

Trying out 6.8.0-RC3.  When I start my Windows 10 VM, I must detach my Logitech unifying receiver from the VM using the plugin ( I have a HDMI switch and I can switch back and forth from my VM and my unRaid GUI) and then reattach it for my wireless mouse and keyboard to be usable in the VM.  I didn't have this issue with 6.7.2. 

  • Author
16 minutes ago, Woodpusherghd said:

Trying out 6.8.0-RC3.  When I start my Windows 10 VM, I must detach my Logitech unifying receiver from the VM using the plugin ( I have a HDMI switch and I can switch back and forth from my VM and my unRaid GUI) and then reattach it for my wireless mouse and keyboard to be usable in the VM.  I didn't have this issue with 6.7.2. 

This plugin does not control the attachment of usb devices when a VM boots.  It only allows you to attach and detach a usb device manually.  The issue is 6.8.

  • 1 month later...

Im not sure what Im doing wrong. I installed plugin, it shows up in my VM page. However when I start the VM, I try to choose in in the list of Running VMs, but the list is just empty. What am I doing wrong? Thanks!

6 minutes ago, ElnarVideo said:

Im not sure what Im doing wrong. I installed plugin, it shows up in my VM page. However when I start the VM, I try to choose in in the list of Running VMs, but the list is just empty. What am I doing wrong? Thanks!

Reload the page.  The Hot plug page isn't dynamic, and only picks up the running VMs when you enter the VM page

  • 3 months later...

Awesome plugin!!! Thanks a lot!!!

Not sure if a problem with plugin, 6.8.3 release, or some combination of the two, but I only noticed a formatting issue after installing this plugin for the first time:

  • VM name column has gone extra wide
  • long descriptions seem to change to justified

image.png.8914b9bfa029c19c7bdd70fd97b54ed6.png

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.