Set up Spice-Gtk 0.11 with USB redirection on Ubuntu Precise

March 17, 2012

Build requires spice & spice-protocol 0.10.1 and the most recent usbredir 0.4.3 as of 04/02/2012. View also recent commit at http://cgit.freedesktop.org/spice/spice-gtk converted to 0001-usbredir-Check-for-existing-usb-channels-after-libus.patch for spice-gtk-0.11.
Qemu-kvm 1.0 has been built based on branch http://cgit.freedesktop.org/~jwrdegoede/qemu/log/?h=qemu-kvm-1.0-usbredir
as of 04/05/2012.
It contains all required usb redirection patches on top of QEMU-KVM 1.0 release

$ git clone git://people.freedesktop.org/~jwrdegoede/qemu
$ cd qemu
$ git checkout -B qemu-kvm-1.0-usbredir origin/qemu-kvm-1.0-usbredir
$ cd ..
$ cp -R qemu qemu-kvm-1.0-usbredir040712

****************
Link to PPA V.4
****************
$ sudo add-apt-repository ppa:bderzhavets/lib-usbredir71
$ $ sudo apt-get update
$ sudo apt-get install qemu-kvm qemu qemu-common qemu-utils \
spice-client libusb-1.0-0 libusb-1.0-0-dev \
libusbredir libusbredir-dev usbredir-server \
libspice-protocol-dev libspice-server-dev \
libspice-client-glib-2.0-1 libspice-client-glib-2.0-dev \
libspice-client-gtk-2.0-1 libspice-client-gtk-2.0-dev \
libspice-client-gtk-3.0-1 libspice-client-gtk-3.0-dev \
python-spice-client-gtk spice-client-gtk

$ sudo apt-get install virtinst virt-manager virt-viewer
$ sudo ln -s /etc/apparmor.d/usr.sbin.libvirtd /etc/apparmor.d/disable/

$ sudo adduser $USER libvirtd
REBOOT
View also bug report for F16 affecting Ubuntu as well



Start VM with virtfs support :
$ sudo /usr/bin/kvm -cpu host -enable-kvm \
-name VF15HQ -m 2048 \
-drive file=/dev/sdb5,if=virtio,media=disk,aio=native,cache=off \
-net nic,model=virtio -net user -localtime \
-usb -vga qxl -spice port=5900,disable-ticketing \
-device virtio-serial \
-chardev spicevmc,id=vdagent,name=vdagent \
-device virtserialport,chardev=vdagent,name=com.redhat.spice.0 \
-readconfig /etc/qemu/ich9-ehci-uhci.cfg \
-chardev spicevmc,name=usbredir,id=usbredirchardev1 \
-device usb-redir,chardev=usbredirchardev1, \
id=usbredirdev1,debug=3 \
-chardev spicevmc,name=usbredir, \
id=usbredirchardev2 \
-device usb-redir,chardev=usbredirchardev2, \
id=usbredirdev2,debug=3 \
-chardev spicevmc,name=usbredir,\
id=usbredirchardev3 \
-device usb-redir,chardev=usbredirchardev3, \
id=usbredirdev3,debug=3 \
-virtfs local,path=/home/boris,security_model=passthrough,mount_tag=host_share





do_spice_init: starting 0.10.1
spice_server_add_interface: SPICE_INTERFACE_MIGRATION
spice_server_add_interface: SPICE_INTERFACE_KEYBOARD
spice_server_add_interface: SPICE_INTERFACE_MOUSE
spice_server_add_interface: SPICE_INTERFACE_QXL
red_worker_main: begin
display_channel_create: create display channel
cursor_channel_create: create cursor channel
*** EHCI support is under development ***
spice_server_char_device_add_interface: CHAR_DEVICE usbredir
spice_server_char_device_add_interface: CHAR_DEVICE usbredir
spice_server_char_device_add_interface: CHAR_DEVICE usbredir
reds_handle_auth_mechanism: Auth method: 1
reds_handle_main_link:
reds_disconnect:
reds_show_new_channel: channel 1:0, connected successfully, over Non Secure link
main_channel_link: add main channel client
reds_handle_main_link: NEW Client 0x7f5ed6e44cb0 mcc 0x7f5ed6e443a0 connect-id 1804289383
main_channel_handle_parsed: net test: latency 0.225000 ms, bitrate 9061946902 bps (8642.146017 Mbps)
reds_handle_auth_mechanism: Auth method: 1
reds_show_new_channel: channel 3:0, connected successfully, over Non Secure link
inputs_connect: inputs channel client create
reds_handle_auth_mechanism: Auth method: 1
reds_show_new_channel: channel 4:0, connected successfully, over Non Secure link
red_dispatcher_set_cursor_peer:
reds_handle_auth_mechanism: Auth method: 1
handle_dev_cursor_connect: cursor connect
red_connect_cursor: add cursor channel client
listen_to_new_client_channel: NEW ID = 0
reds_show_new_channel: channel 2:0, connected successfully, over Non Secure link
red_dispatcher_set_display_peer:
handle_dev_display_connect: connect
handle_new_display_channel: add display channel client
reds_handle_auth_mechanism: Auth method: 1
handle_new_display_channel: New display (client 0x7f5ed6e44cb0) dcc 0x7f5e30602c30 stream 0x7f5ed6e450a0
handle_new_display_channel: jpeg disabled
handle_new_display_channel: zlib-over-glz disabled
listen_to_new_client_channel: NEW ID = 0
reds_show_new_channel: channel 9:0, connected successfully, over Non Secure link
reds_handle_auth_mechanism: Auth method: 1
reds_show_new_channel: channel 9:1, connected successfully, over Non Secure link
kvm: usbredirparser info: Peer version: spice-gtk 0.11

kvm: usbredirparser info: Peer version: spice-gtk 0.11

reds_handle_auth_mechanism: Auth method: 1
reds_show_new_channel: channel 9:2, connected successfully, over Non Secure link
kvm: usbredirparser info: Peer version: spice-gtk 0.11

display_channel_client_wait_for_init: creating encoder with id == 0
spice_server_add_interface: SPICE_INTERFACE_TABLET
handle_dev_set_mouse_mode: mouse mode 2
display_channel_release_item: not pushed (101)
spice_server_remove_interface: remove SPICE_INTERFACE_TABLET
inputs_detach_tablet:
handle_dev_set_mouse_mode: mouse mode 1
red_channel_client_disconnect: 0x7f5e30602c30 (channel 0x7f5e30045920 type 2 id 0)
display_channel_client_on_disconnect:
*********************************************
F17 usbredir enabled VM in spicy session
*********************************************







Follow

Get every new post delivered to your Inbox.