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.

Support for adding optional USB devices in VM Manager form view

Featured Replies

Currently, unraid requires all USB devices added to a VM to be present on startup of that VM, or the startup fails. Libvirt actually supports adding USB devices as optional for VM startup using hostdev startuppolicy, see details below.

But this can only be done in the XML view.

It would be great if we could have another checkbox in the form view to specify that we want a specific USB device to be included with startuppolicy = optional. This will reduce the need to edit the XML directly, which always risks breaking the VM and deters many users. Something like this perhaps:

318297034_OptionalUSBdevices.jpg.ea1bf93daf9c951fd9db63b75efa1186.jpg

 

 

Libvirt supports adding USB devices as optional for VM startup, using the hostdev source startupolicy = optional.

https://libvirt.org/formatdomain.html#usb-pci-scsi-devices

969251564_ScreenShot2022-09-03at2_07_38pm.thumb.png.c93278178beefc8a56c87d53a22a3829.png

 

For example:

  <hostdev mode='subsystem' type='usb'>
    <source startupPolicy='optional'>
      <vendor id='0x1234'/>
      <product id='0xbeef'/>
    </source>
  </hostdev>

 

 

It seems to work well in my limited testing, after some initial unrelated problems, see:

 

You can already do this using plugins, but I agree it would be nice to have it built in as standard.

  • 2 weeks later...
On 9/3/2022 at 5:35 AM, Jorgen said:

Currently, unraid requires all USB devices added to a VM to be present on startup of that VM, or the startup fails. Libvirt actually supports adding USB devices as optional for VM startup using hostdev startuppolicy, see details below.

But this can only be done in the XML view.

It would be great if we could have another checkbox in the form view to specify that we want a specific USB device to be included with startuppolicy = optional. This will reduce the need to edit the XML directly, which always risks breaking the VM and deters many users. Something like this perhaps:

318297034_OptionalUSBdevices.jpg.ea1bf93daf9c951fd9db63b75efa1186.jpg

 

 

Libvirt supports adding USB devices as optional for VM startup, using the hostdev source startupolicy = optional.

https://libvirt.org/formatdomain.html#usb-pci-scsi-devices

969251564_ScreenShot2022-09-03at2_07_38pm.thumb.png.c93278178beefc8a56c87d53a22a3829.png

 

For example:

  <hostdev mode='subsystem' type='usb'>
    <source startupPolicy='optional'>
      <vendor id='0x1234'/>
      <product id='0xbeef'/>
    </source>
  </hostdev>

 

 

It seems to work well in my limited testing, after some initial unrelated problems, see:

 

I have started to look at creating a PR for this requirement. Also will show missing devices.

 

image.png.5d3714a59002c8a6490f4eb1a94d7886.png

Edited by SimonF

On 9/3/2022 at 5:35 AM, Jorgen said:

Currently, unraid requires all USB devices added to a VM to be present on startup of that VM, or the startup fails. Libvirt actually supports adding USB devices as optional for VM startup using hostdev startuppolicy, see details below.

But this can only be done in the XML view.

It would be great if we could have another checkbox in the form view to specify that we want a specific USB device to be included with startuppolicy = optional. This will reduce the need to edit the XML directly, which always risks breaking the VM and deters many users. Something like this perhaps:

318297034_OptionalUSBdevices.jpg.ea1bf93daf9c951fd9db63b75efa1186.jpg

 

 

Libvirt supports adding USB devices as optional for VM startup, using the hostdev source startupolicy = optional.

https://libvirt.org/formatdomain.html#usb-pci-scsi-devices

969251564_ScreenShot2022-09-03at2_07_38pm.thumb.png.c93278178beefc8a56c87d53a22a3829.png

 

For example:

  <hostdev mode='subsystem' type='usb'>
    <source startupPolicy='optional'>
      <vendor id='0x1234'/>
      <product id='0xbeef'/>
    </source>
  </hostdev>

 

 

It seems to work well in my limited testing, after some initial unrelated problems, see:

 

Followed your suggestion and this has now been merged so will appear in the next RC..

Also includes support for missing USB devices so people can change to optional or remove.

image.thumb.png.a45e014742c76d7a446de85bff0adb35.png

47 minutes ago, SimonF said:

Also includes support for missing USB devices so people can change to optional or remove.

Would it be too much work to automatically change missing devices to optional, accompanied by a mid (yellow) level notification, something like...

"VM was started without required USB device, automatically changed to optional"

So the VM won't fail, but you would get a warning that something you need may be missing?

1 hour ago, JonathanM said:

Would it be too much work to automatically change missing devices to optional, accompanied by a mid (yellow) level notification, something like...

"VM was started without required USB device, automatically changed to optional"

So the VM won't fail, but you would get a warning that something you need may be missing?

Dont think it will be simple to do, also not sure it should still start without the device as ccould have a negative effect. 

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.