Skip to main content

Optional USB Device in Virtual Machine Manager

·1 min

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.

Example:

<hostdev mode="subsystem" type="usb" managed="yes">
  <source startupPolicy="optional">
    <vendor id="0x1050"/>
    <product id="0x0402"/>
  </source>
  <address type="usb" bus="0" port="4"/>
</hostdev>

Related

Application Guard Testing with Virt-Manager

·1 min
Received a BSOD with error code 0xc0000225 on a Windows 10 (and 11) VM when enabling the Hyper-V role to do some testing with Microsoft Defender Application Guard. This VM runs on a Rocky Linux host and I typically use Virt-Manager to handle my VMs. Two changes were necessary to get nested Hyper-V working with virt-manager: virt-xml <VM-NAME> --edit --cpu host-passthrough sudo modprobe kvm\_intel nested=1 Note: kvm\_amd for AMD processors

DevCon: Rescan for Hardware automatically

·1 min
I’ve been having a strange issue with a PCMCIA card on my wife’s computer. Every time the machine is rebooted, you are required to “Scan for Hardware Changes” in device manager. It does not automatically detect that the PCMCIA card is still plugged in. After searching high and low for a solution, I thought about seeing if I could write a script that would automatically run a hardware scan at logon.