Skip to content

Instantly share code, notes, and snippets.

@wpyoga
Last active June 15, 2023 21:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wpyoga/b07914ee48c931c99f1dcc28243b36e2 to your computer and use it in GitHub Desktop.
Save wpyoga/b07914ee48c931c99f1dcc28243b36e2 to your computer and use it in GitHub Desktop.
attach usb device to qemu via monitor
https://qemu-project.gitlab.io/qemu/system/devices/usb.html
no need to use port number if only one xhci controller is connected
$ qemu -device qemu-xhci
(qemu) device_add usb-tablet,bus=usb-bus.0,port=1,id=my-tablet
(qemu) device_del my-tablet
(qemu) device_add driver,
vendorid=<hexnr> -- Specifies the vendor ID of the device.
productid=<hexnr> -- Specifies the product ID of the device.
device_add usb-host,id=iphone,vendorid=0x05ac,productid=0x12a8
device_del iphone
may need to chown manually or use udev rule to do that
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment