Hi all,
I 've been working on USB redirection over the network
Qemu/spice for a while now. And I'm happy to report I 've something
Which is good enough to invite others to test it. In the mean time Gert
Hoffmann (kraxel) has been working on cleaning up the EHCI support which
Was submitted to the qemu-devel list about a year ago, making it
Suitable to get merged. My qemu git tree is based on gert's tree, so it
Has Prelimary usb2 support too. Note that the usb2 support works best
When used together with the network redirection code over localhost,
That seems to be more reliable at the moment then using qemu's direct
USB Host redirection code.
So if you want to play around
This here are some installation instructions. These instructions assume
64 bit red hat or fedora installation. If you 've a 32 bit installation,
Or are using a distribution which does not use/usr/lib64 for 64 bit
Installations (such as Debian and UBUNTU) replace/usr/lib64
/Usr/lib in the below instructions.
First of all you will need my version of libusb, which is has a new libusb_get_device_speed function, this is intended
To
Go upstream sometime soon. But first upstream needs to get to long
Awaited 1.0.9 Out the door. To install my (fully compatible) libusb
Version do:
Git clone git: // anongit.freebench top.org /~ JwrdegoedE/libusb
CD libusb
Git checkout usbredir
./Autogen. Sh
./Configure -- prefix =/usr -- libdir =/usr/lib64
Make
Sudo make install
Http://cgit.freedesktop.org /~ Jwrdegoede
Http://hansdegoede.livejournal.com/9682.html
With the new libusb in place, it is time to build the non qemu parts of the usbredir code
(A standalone server, as well as the usbredir Protocol Parser and host libraries ):
Git clone git: // anongit.freebench top.org /~ JwrdegoedE/usbredir
CD usbredir
Make prefix =/usr libdir =/usr/lib64
Sudo make prefix =/usr libdir =/usr/lib64 install
And now lets build qemu with usbredir support (note I enable spice + spices smartcard support here, since that is
What I use in my day to day testing, this is not strictly needed ).
Git clone git: // anongit.freebench top.org /~ JwrdegoedE/qemu
CD qemu
Git checkout usbredir
./Configure -- prefix =/usr -- enable-SmartCard-nss -- enable-smartcard -- enable-spice -- target-list = x86_64-softmmu
Make
Sudo install-m0755-P x86_64-softmmu/qemu-system-x86_64 "/usr/bin"
Note
Do not use make install, this will also install the BIOS Roms from qemu
Git which are outdated, this assumes that you already have a recent
Qemu installed and will be using the BIOS Roms from that version.
Now
Start qemu with all the options you use normally and "-USB" or "-USB
-Device USB-EHCI "for usb2 support. To test the network redirection,
Start the usbredirserver in another terminal, lets say you want
Redirect a USB device with vid: PID
045e: 0772, then start usbredirserver like this:
Usbredirserver 045e: 0772
And then in the qemu monitor using line type:
Usb_add TCP-redir: localhost: 4000
Notes:
1) Replace localhost with the IP or hostname of the other machine if you're actually testing this over the network
2) You can start multiple servers to redirect multiple devices on the same machine, add "-P 4001" to start a second
Server on port 4001, and make the 4000 4001 in the usb_add command
3) To unplug a device do a usb_del with the exact same arguments as you passed to the usb_add command
If you're interested in the network protocol used for the USB redirection, see:
Http://cgit.freedesktop.org /~ Jwrdegoede/u
Sbredir/tree/usb-redirection-protocol.txT
Regards,
Hans
Http://cgit.freedesktop.org /~ Jwrdegoede/qemu/tree /? H = usbredir