You can connect USB devices to a VM following the instructions in the article How to connect a USB device to a VM?
This article describes the steps to take when the guest OS does not detect a connected USB device.
Problem
The guest OS does not initialize the USB device under the following conditions:
- The VM is created from a NoOS template.
- Windows Server 2022 OS is installed on the VM from an ISO image.
- USB device is connected to the VM according to the instructions for How to connect a USB device to a VM?.
In this case:
- node of the cluster sees the device, but it is not passed to the guest OS;
- the VM configuration uses a USB controller of the
piix3-uhci:
<controller type='usb' index='0' model='piix3-uhci'>
Cause
Flash drive is incompatible with the USB controller model piix3-uhci. In the platform, VMs without OS are created only with this controller. Replacing the model with nec-xhci resolves the issue.
Diagnostics
To confirm the cause:
- Connect to the cluster node via SSH. For more information about connecting via SSH, see Workstation setup.
- Get the internal VM name:
virsh list --all --nameExplanation:Example output53_test00\ntest_vm_0153_test00,test_vm_01— internal VM names.
- Check the USB controller model in the VM configuration:
virsh dumpxml <vm_name> | grep -i -E 'uhci|ehci|xhci'Explanation:
- <vm_name> — internal VM name. Obtained in step 2;
uhci|ehci|xhci— USB controller model names, case-insensitive.
If the output contains onlyExample output<controller type='usb' index='0' model='piix3-uhci'>piix3-uhciand nonec-xhci, this confirms the issue: the device is incompatible with the installed controller model. - Make sure the cluster node sees the USB device:
lsusbExample outputBus 002 Device 004: ID 8564:1000 Transcend Information, Inc. JetFlashExplanation:
Bus 002 Device 004: ID 8564:1000 Transcend Information, Inc. JetFlash— USB driveTranscend JetFlashis connected to bus 002 and recognized by the cluster node.
Solution
To resolve the issue, replace the USB controller model with nec-xhci:
- Connect to the cluster node via SSH. For more information about connecting via SSH, see Workstation setup.
-
Save the current VM configuration. The command is executed on the cluster node:
virsh dumpxml <vm_name> > <vm_name>.xml - Open the configuration in edit mode:
virsh edit <vm_name> - In the XML configuration, find the USB controller section: the
<controller>element with thetype='usb'attribute:
Explanations:Configuration line example<controller type='usb' index='0' model='piix3-uhci'>type='usb'— controller type;index='0'— controller serial number;model='piix3-uhci'— current controller model that needs to be replaced.
-
Replace the model with
nec-xhci:Example of modified line<controller type='usb' index='0' model='nec-xhci'> - Save the changes and exit the editor.
- Stop the VM:
virsh shutdown <vm_name>Wait for the shutdown to complete. If high availability is enabled in the cluster, the VM will restart automatically. Changes will take effect after the restart. -
Check the configuration:
virsh dumpxml <vm_name> | grep -i -E 'uhci|ehci|xhci'Example of correct output<controller type='usb' index='0' model='nec-xhci'> - Log in to the guest OS and check if the USB device is recognized.
En
Es