Set up Spice-Gtk-0.7.4X (USB redirection support), LibUsbredir 0.3.1, Qemu-kvm-0.15.0 (spice enabled), Spice Server&Client 0.9.1 on Ubuntu 11.10

September 30, 2011

Following bellow is attempt to reproduce Hans de Goede blog entry at http://planet.spice-space.org/ on Ubuntu 11.10 with intent to build Spice-Gtk-0.7.4X up on current snapshot of git://anongit.freedesktop.org/spice/spice-gtk to obtain Spice-Gtk working stable with development Spice version 0.9.1. Build done on Ubuntu Oneiric include USB redirection support , but due to obvious reasons stays just a feature which cannot be used for real redirection. If USB redirection will appear to be in Qemu-kvm upstream, then Ubuntu will be ready to pick it up.
Packaged version version of Spice-Gtk-0.7.4X is built up on mentioned git repository with GTK2 and GTK3 as two sets of packages.
Libusb-1.0-2:1.0.9-3ubuntu9 is built up on git://people.freedesktop.org/~jwrdegoede/libusb (pre 1.0.9). Usbredir-0.3.1-1ubuntu5 is built up on official release usbredir-0.3.1.tar.gz. Of course no usb redirection really happens due to version of Qemu-kvm 0.15.0,compare with series of qxl and usbredir patches on top of 0.15.0 in Fedora 16. Version of Libvirt and etc. However, this version of Spice-Gtk >= 0.7.39 and should work stable with Spice 0.9.1
*********************************************************************************************************************
Running autogen.sh with exported environment variable NOCONFIGURE allows to perform it in one build per Debian’s Spice-Gtk-0.7-3 building schema.It has been already done as well. View:-
Spice-Gtk-0.7.46-314c been built per debian’s 0-7.2 schema
*********************************************************************************************************************
GTK2 build debian/rules contains :-

override_dh_auto_configure:
./autogen.sh \
--enable-vala --disable-smartcard \
--enable-introspection --enable-werror=no \
--with-gtk="2.0" --prefix=/usr --libdir=/usr/lib \
LIBUSB_CFLAGS=-I/usr/include/libusb-1.0 \
LIBUSB_LIBS='-L/usr/lib/*-linux-gnu -lusb-1.0' \
LIBUSBREDIRHOST_CFLAGS=-I/usr/include \
LIBUSBREDIRHOST_LIBS='-L/usr/lib -lusbredirhost'

Original file spice-gtk-3/gtk/Makefile.am was updated to handle GTK3 build, otherwise GTK3 build failed building spicy.

--- spice-gtk.orig/gtk/Makefile.am      2011-10-03 20:00:55.150133286 +0400
+++ spice-gtk/gtk/Makefile.am   2011-10-03 20:06:51.446137091 +0400
@@ -352,6 +352,7 @@
        libspice-client-glib-2.0.la             \
        $(XRANDR_LIBS)                  \
        $(GTHREAD_LIBS)                 \
+        $(GTK_LIBS)                     \
        $(NULL)

 spicy_CPPFLAGS =                       \

GTK3 build debian/rules contains :-

override_dh_auto_configure:
./autogen.sh \
--enable-vala --disable-smartcard \
--enable-introspection --enable-werror=no \
--with-gtk="3.0" --prefix=/usr --libdir=/usr/lib \
LIBUSB_CFLAGS=-I/usr/include/libusb-1.0 \
LIBUSB_LIBS='-L/usr/lib/*-linux-gnu -lusb-1.0' \
LIBUSBREDIRHOST_CFLAGS=-I/usr/include \
LIBUSBREDIRHOST_LIBS='-L/usr/lib -lusbredirhost'

*****************************
To install packages from PPA
*****************************
$ sudo add-apt-repository ppa:bderzhavets/lib-usbredir3
$ sudo apt-get update
$ sudo apt-get install qemu-kvm qemu qemu-common \
spice-client seabios \
libusb-1.0-0 libusb-1.0-0-dev \
libusbredir libusbredir-dev \
libspice-protocol-dev libspice-server-dev \
libspice-client-glib-2.0-4 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

To install Livbirt and virtinst tools :-

$ sudo apt-get install virtinst virt-manager virt-viewer

You might have to disable apparmor profile for libvirtd

$ sudo ln -s /etc/apparmor.d/usr.sbin.libvirtd /etc/apparmor.d/disable/
$ sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.libvirtd
$ sudo adduser $USER kvm

Link to PPA

Following builds have been debianized in current PPA :-

Spice-Gtk 0.7.46-314c
==============

prefix: /usr
c compiler: gcc -std=gnu99

Coroutine: ucontext
Audio: pulse
Target: Unix
SASL support: yes
Smartcard support: no
USB redirection support: yes
Gtk: 2.0

Now type ‘make’ to build spice-gtk

Spice-Gtk 0.7.46-314c-dirty
==============

prefix: /usr
c compiler: gcc -std=gnu99

Coroutine: ucontext
Audio: pulse
Target: Unix
SASL support: yes
Smartcard support: no
USB redirection support: yes
Gtk: 3.0

Now type ‘make’ to build spice-gtk

Advertisements

Qemu-kvm 0.15.0 stable and Spice-Gtk-0.7 on Ubuntu 11.10

August 15, 2011

All packages required are already in PPA “Qemu-kvm 0.15.0 and Spice on Ubuntu 11.10″. Spice-gtk-0.7 has been done for Oneiric as two builds. First one with python, gobject-introspection enabled and –with-gtk=”2.0″(GTK2). Second one –with-introspection and –with-gtk=”3.0″ (GTK3).This builds actually are the core builds in PPA, which bring RH’s technologies to Ubuntu 11.10. Notice, that option –with-audio=”pulse” is also used by both builds and appears to be working fine. Version of Spice Server has been
also upgraded to 0.8.2.
Following bellow is brief description of PPA Qemu-kvm 0.15.0 and Spice on Ubuntu 11.10.
************************************************************************************************************
UPDATE on 08/18/11 I am aware of following builds made at Debian :-
Details about package spice-gtk
Packaging schema at link mentioned above is exactly the same as in spice-gtk-0.7.1-1.fc16.src.rpm
View Rebuild Spice-Gtk-0.7 via Debian Unstable with gobject-introspection enabled
*************************************************************************************************************

1.The most recent qemu-kvm packages were done via “git clone git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git” are Release 0.15.0 as of 08/10/2011.
$ git clone git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git
$ cd qemu-kvm
$ git checkout -b stable-0.15 origin/stable-0.15
$ cd ..
Copy to building directory :
$ cp -R qemu-kvm ../BUILD/qemu-kvm-mmddyy
Stable branch is already patched to fix “QXL” issues and to support spicevmc channel

2. Spice-gtk-0.7 has been done for Oneiric as two builds.

GTK2 build performed with
./configure --prefix=/usr --build=x86_64-linux-gnu \
--mandir=/usr/share/man --infodir=/usr/share/info \
--datadir=/usr/share \
--sysconfdir=/etc --localstatedir=/var \
--libexecdir=/usr/bin \
--with-python --disable-static \
--enable-introspection \
--enable-smartcard=no \
--with-gtk="2.0" --with-audio="pulse"

GTK3 build performed with
./configure --prefix=/usr --build=x86_64-linux-gnu \
--mandir=/usr/share/man --infodir=/usr/share/info \
--datadir=/usr/share \
--sysconfdir=/etc --localstatedir=/var \
--libexecdir=/usr/bin \
--disable-static \
--enable-introspection \
--with-gtk="3.0" --enable-smartcard=no --with-audio="pulse"

libspice-protocol-dev 0.8.1-1 is required by both builds

3.Current version of spice-vdagent for Oneiric as KVM guest installs service and *.desktop (file) automatically and requires guest restart for activation or manual gdm restart and starting service.

***********************************************************************
UPDATE on 08/16/11. Please, view https://wiki.ubuntu.com/spice ,
regarding issues raised up on 08/16/11. You might have to import
PUBLIC KEY separately to install PPA.

Would you have problem with adding my PPAs , like this :-
Executing: gpg –ignore-time-conflict –no-options –no-default-keyring –secret-keyring /tmp/tmp.CuZyZy4MSK
–trustdb-name /etc/apt/trustdb.gpg –keyring /etc/apt/trusted.gpg –primary-keyring /etc/apt/trusted.gpg –keyserver hkp://keyserver.ubuntu.com:80/ –recv 5
gpg: “5” not a key ID: skipping
Run “sudo apt-get update” . It will show you value of PUBLIC KEY to be imported . Then run :
$ sudo apt-key adv –keyserver keyserver.ubuntu.com –recv-keys
$ sudo apt-key adv –keyserver keyserver.ubuntu.com –recv-keys \
XXXXXXXXXXXXXXX

Where XXXXXXXXXXXXXX is a value been shown by “apt-get update” on your box
$ sudo apt-get update
***********************************************************************
Install software from PPA :-
************************************************************************
$ sudo apt-add-repository ppa:bderzhavets/qemu-git
$ sudo apt-get update
$ sudo apt-get install qemu-kvm qemu qemu-common \
libspice-client libspice-client-dev \
libspicegtk3-client libspicegtk3-client-dev \
spice libspice-protocol-dev spicegtk3-client

$ sudo apt-get install virtinst virt-viewer virt-manager

Disable libvirtd’s apparmor profile :

$ sudo ln -s /etc/apparmor.d/usr.sbin.libvirtd /etc/apparmor.d/disable/
$ sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.libvirtd
$ sudo adduser $USER kvm
$ sudo reboot

The most recent daily builds of Ubuntu 11.10 don’t contain Synaptic Manager. To install
$ sudo apt-get install synaptic