Optional USB Device in Virtual Machine Manager

To make a USB Host Device optional on startup within KVM, edit the XML and add startupPolicy="optional" to the source node. This will ensure your usb stick, yubikey, or whatever, it won’t stop your VM from booting if it isn’t present.


<hostdev mode="subsystem" type="usb" managed="yes">
  <source startupPolicy="optional">
    <vendor id="0x1050"/>
    <product id="0x0402"/>
  <address type="usb" bus="0" port="4"/>
</hostdev>Code language: HTML, XML (xml)