February 25, 20215 yr Is there a reason why we cannot use the following, as the GUI will not allow. Not enough usb ports? Qemu can emulate an usb hub (-device usb-hub). But the hub supports usb1 only, so you should avoid using it. Better solution is to just increase the number of root ports. xhci has four root ports by default, but it supports up to 15 ports. And in case this still isn't enough a second xhci adapter can be added to the virtual machine. To create a host adapter with 8 ports use -device qemu-xhci,p2=8,p3=8. The libvirt configuration is: <controller type='usb' model='qemu-xhci' ports='8'/> In case you wonder why qemu-xhci needs both p2 and p3 parameters: p2 specifies the number of usb2 ports (which support usb1 too), and p3 specifies the number of usb3 ports. It is possible to assign different counts here. When using -device qemu-xhci,p2=8,p3=4 you'll get an xhci adapter where ports 1-4 support both usb2 and usb3 and ports 5-8 are usb2-only. Can be used to force a usb3-capable usb device into usb2 mode by plugging it into a usb2-only xhci port. There should rarely be a need to actually do that in practice though. https://www.kraxel.org/blog/2018/08/qemu-usb-tips/
Archived
This topic is now archived and is closed to further replies.