qemu-kvm 1.1 adds experimental support for usb 3.0

Monday, July 16, 2012 - 01:32 Haydn Solomon

Experimental support for usb 3.0 has been added to kvm with the recent release of upstream qemu 1.1. Apart from higher throughput of usb 3.0 comes the nice effect of lower cpu resource usage due to shifting more control to the usb hardware device. There's currently very little documentation available for this new feature as it's still in early development but you can start experimenting quickly with a few kvm command line options.

Getting started

To get started using usb 3.0 experimental support at this time requires running kvm from the command line as support is not yet available to kvm management tools. Start by downloading the latest version of qemu-kvm which is currently 1.1 at this location. You would need to build and install this manually unless your distro has packages for it already.

There are two sets of commands required for using usb 3.0 devices with kvm. You first need to add the new usb xhci controller with the device option when invoking kvm for specifying the new controller.

qemu-kvm -device nec-usb-xhci,id=xhci

Next you need to attach a usb device to this controller using the device again, this time specifying the device. Below is an example

-device usb-storage,bus=xhci.0,drive=usbstick

There's still a lot of work to be done to fully implement usb 3.0 support in kvm. As it stands, the current state of development is listed as follows in the qemu documentation

usb-storage emulation should work

devices which need constant polling do NOT work. An example of this is usb-tablet

ISO xfers are NOT implemented

superspeed ports are NOT implemented

usb passthrough is untested

As you can see basically usb storage is the only feature really implemented.

Give it a try and post any comments or questions you have with your experience using this new feature.