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


Implementation Qemu-kvm 0.15.0,Spice Server and Spice-Gtk-0.7 on Ubuntu 11.10 KVM Server the most recent approach

August 30, 2011

**********************************************************************************************
UPDATE on 09/21/11 Ubuntu 11.10 beta-2 will be released tomorrow.
Ubuntu 11.10 (Oneiric Ocelot) final release on 10/14/11
**********************************************************************************************
1. Set up Qemu-kvm 0.15.0(spice enabled), Spice Server (0.8.2), Spice-Gtk-0.7-2(via Debian)
Stable Qemu-kvm-0.15.0+noroms(spice enabled), Spice Server&Client 0.8.2, Spice-Gtk-0.7-2 (via Debian)

2. First view :-

http://bderzhavets.wordpress.com/2011/10/09/usb-redirection-on-ubuntu-11-10-oneiric/

3. Set up Qemu&Spice USB Redirection support on Ubuntu 11.10 (Oneiric). Experimental PPA Set up Qemu&Spice USB Redirection support on Ubuntu 11.10 (Oneiric)
View also “Howto” Set up Qemu&Spice USB Redirection support on Ubuntu 11.10 (Oneiric)
************************************************************************************************
Following bellow seems to be the best way to implement Qemu-kvm 0.15.0 spice enabled, Spice Server 0.8.2 and Spice-Gtk-0.7 with GObject-introspection enabled on Ubuntu 11.10 in meantime close to Beta 1. It’s based on PPA Building Spice-Gtk-0.7 via Debian Unstable with Gobject-introspection enabled published on 08/20/11. The original version of Spice-Gtk-0.7-2 came from Debian Unstable didn’t support GObject-introspection. Original version 0.7-2 was not supposed to install files like *.gir and *.typelib. View projects /collab-maint/spice-gtk.git/ summary. No tag “unstable/0.7-3″.It also clearly shows that introspection went into Git Repo on 09/01/11. View [2] also regarding this issue. Original version 0.7-2 also required fixes for debian/control and debian/rules. To understand better why this step should be undertaken, please , view Introspection Overivew

Now I feel myself like a detective whose 4 weeks old case, somebody wants to drop. It’s really funny, because lack of understanding GObject-introspection when porting Spice-Gtk-0.7 from F16 do Debian (Ubuntu) is not a crime.

Moreover file http://mentors.debian.net/debian/pool/main/s/spice-gtk/spice-gtk_0.7-2.dsc (been located at http://mentors.debian.net/package/spice-gtk) doesn’t exist on the Net any longer,which has been used by myself for :
$ dget -x http://mentors.debian.net/debian/pool/main/s/spice-gtk/spice-gtk_0.7-2.dsc
$ dpkg-source -x spice-gtk_0.7-2.dsc

and spice-gtk-0.7-2 was a base I used to rebuild debian packages with introspection enabled, view my PPA
“Building Spice-Gtk-0.7 via Debian Unstable with gobject-introspection enabled”. It means I did it on my own . Everything had been done by myself from scratch.
I really did it from scratch but in different way and at different time. View another my PPA : Qemu-kvm 0.15.0 and Spice on Ubuntu 11.10 as of 08/10/11 and my article at LinuxToday Set up Spice-Gtk-0.7 on Ubuntu 11.10
******************************************************************************************************************
UPDATE on 09/12/11. Bug – https://bugzilla.redhat.com/show_bug.cgi?id=734680 doesn’t show up when running with spice (0.8.2) enabled qemu-kvm 0.15.0 with Oneiric patching
******************************************************************************************************************
UPDATE on 09/06/11. As of 09/05/11 Mentioned error has been fixed. Packaging schema changed vs been used on 09/01/11. Original version 0.7-2 (as of 08/16/11) may be viewed now only at QA page http://qa.debian.org/developer.php?login=bluestonechina%40gmail.com. Front page doesn’t contain it any longer. However, page Debian Tracking System shows the history and build logs 0.7-2 pretty clear.View projects /collab-maint/spice-gtk.git/ summary.

Version 0.7-3
Information
Version: 0.7-3
Uploaded: 2011-09-05 15:30
Source package: http://mentors.debian.net/debian/pool/main/s/spice-gtk/spice-gtk_0.7-3.dsc
Section: misc
Priority: optional
Closes bugs: 639936 640136 640138

View PPA Build Spice-Gtk-0.7 via Debian Unstable as of 09/06/11

View also : http://packages.qa.debian.org/s/spice-gtk.html
TODO section :-
mentors.debian.net has version 0.7-3 of this package, you should consider sponsoring its upload.

*****************************************************************************************************************
Now back to rebuild spice-gtk-0.7-2 from Debian (08/16/11) to enable introspection , which had been done on 08/20/11
*****************************************************************************************************************
Port Debian Unstable Spice Server (been built with embedded libcelt051) to Ubuntu 11.10.
$ dget -x http://mentors.debian.net/debian/pool/main/s/spice/spice_0.8.2-2.dsc
$ dpkg-source -x spice_0.8.2-2.dsc
Port Debian Unstable version of Spice-Gtk-0.7 to Ubuntu 11.10.
$ dget -x http://mentors.debian.net/debian/pool/main/s/spice-gtk/spice-gtk_0.7-2.dsc
$ dpkg-source -x spice-gtk_0.7-2.dsc
It requires rebuild to enable gobject-introspection,which was done in PPA "Building Spice-Gtk-0.7 via Debian Unstable with gobject-introspection enabled" for Ubuntu 11.10.

Details may be viewed here :
Building Spice-Gtk-0.7 via Debian Unstable with gobject-introspection enabled

In particular,

1. Added –enable-introspection to debian/rules dh_auto_configure.

dh_auto_configure -B/build/buildd/spice-gtk-0.7/build-gtk3 -- \
--enable-smartcard=no --with-gtk=3.0 --disable-static --enable-introspection


dh_auto_configure -- \
--enable-smartcard=no --with-gtk=2.0 --disable-static --enable-introspection

2. Updated debian/control and added required dependencies

Build-Depends:
debhelper (>= 8.0.0),
libspice-protocol-dev (>= 0.8.1),
libspice-server-dev,
libpixman-1-dev (>= 0.17.7),
libgtk2.0-dev,
libgtk-3-dev,
libglib2.0-dev (>= 2.22),
libcairo2-dev (>= 1.2.0),
libpulse-dev,
python2.7,
python-gtk2-dev (>= 2.0.0),
python-pyparsing,
intltool,
libsasl2-dev,
libjpeg8-dev,
gobject-introspection, <=
libgirepository1.0-dev <=

The last two lines have been added.

3.Several debian/package_name.install files have been updated by adding right full path to corresponding library to accommodate installation of :-

/usr/lib/girepository-1.0/SpiceClientGLib-2.0.typelib
/usr/lib/girepository-1.0/SpiceClientGtk-2.0.typelib
/usr/lib/girepository-1.0/SpiceClientGtk-3.0.typelib
/usr/share/gir-1.0/SpiceClientGLib-2.0.gir
/usr/share/gir-1.0/SpiceClientGtk-3.0.gir

which otherwise won’t be installed.

Added to libspice-client-glib-2.0-4.install
line usr/lib/girepository-1.0/SpiceClientGLib-2.0.typelib

Added to libspice-client-gtk-2.0-1.install
line usr/lib/girepository-1.0/SpiceClientGtk-2.0.typelib

Added to libspice-client-gtk-3.0-1.install
line usr/lib/girepository-1.0/SpiceClientGtk-3.0.typelib

Added to libspice-client-glib-2.0-dev.install
line usr/share/gir-1.0/SpiceClientGLib-2.0.gir

Added to libspice-client-gtk-3.0-dev.install
line usr/share/gir-1.0/SpiceClientGtk-3.0.gir

Qemu-kvm 0.15.0 was built with changed dependencies in the same PPA
Packages from https://launchpad.net/~bderzhavets/+archive/test-deb2 installed with no conflicts on Oneiric daily build 08/27/11. Spice sessions (via VirtManager) in QXL mode (64M vram) for install and for runtime have been run.
******************************************************************************************************
The most recent snapshot for seabios supporting 64M vram for QXL device uploaded to ppa:bderzhavets/test-deb2,ppa:bderzhavets/test-deb1
******************************************************************************************************
Please, view regarding this issue [Qemu-devel] -vga qxl

To install packages from PPA

$ sudo add-apt-repository ppa:bderzhavet/test-deb2
$ sudo apt-get update
$ sudo apt-get install qemu-kvm qemu qemu-common \
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 spice-client \
seabios

$ 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
$ sudo reboot

In case trouble with “apt-get update” run :-

# sudo apt-key adv --keyserver keyserver.ubuntu.com \
--recv-keys 5CC1785DC05C1EB5
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /tmp/tmp.IbkrNcyBsB --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv-keys 5CC1785DC05C1EB5
gpg: requesting key C05C1EB5 from hkp server keyserver.ubuntu.com
gpg: key C05C1EB5: public key "Launchpad PPA for Boris Derzhavets" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
# sudo apt-get update

Normal install looks like :-

$ sudo apt-get install qemu-kvm qemu qemu-common \
> 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 spice-client \
> seabios
[sudo] password for boris:
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
bridge-utils cpu-checker libaio1 libcegui-mk2-1 libdevil1c2 libfreeimage3 libspice-server1
libxerces-c28 msr-tools vgabios
Suggested packages:
kvm-pxe mol-drivers-macosx openbios-sparc ubuntu-vm-builder uml-utilities
The following NEW packages will be installed:
bridge-utils cpu-checker libaio1 libcegui-mk2-1 libdevil1c2 libfreeimage3
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
libspice-server1 libxerces-c28 msr-tools python-spice-client-gtk qemu qemu-common qemu-kvm
seabios spice-client spice-client-gtk vgabios
0 upgraded, 23 newly installed, 0 to remove and 0 not upgraded.
Need to get 9,977 kB of archives.
After this operation, 35.8 MB of additional disk space will be used.
Do you want to continue [Y/n]? Y







References
1. Debian Tracking System
2.http://www.mail-archive.com/ubuntu-bugs@lists.ubuntu.com/msg3124003.html


Rebuild Spice-Gtk-0.7 via Debian Unstable with gobject-introspection enabled

August 20, 2011

Following bellow seems to be the best way to implement Qemu-kvm 0.15.0 spice enabled, Spice Server 0.8.2 and Spice-Gtk-0.7 with GObject-introspection enabled on Ubuntu 11.10 in meantime close to Beta 1. It’s based on PPA Building Spice-Gtk-0.7 via Debian Unstable with Gobject-introspection enabled published on 08/20/11. The original version of Spice-Gtk-0.7-2 came from Debian Unstable didn’t support GObject-introspection. Original version 0.7-2 was not supposed to install files like *.gir and *.typelib. View projects /collab-maint/spice-gtk.git/ summary.It also clearly shows that introspection went into Git Repo on 09/01/11. View [2] also regarding this issue.
Original version 0.7-2 also required fixes for debian/control and debian/rules. To understand better why this step should be undertaken, please , view Introspection Overivew

Now I feel myself like a detective whose 4 weeks old case, somebody wants to drop. It’s really funny, because lack of understanding GObject-introspection when porting Spice-Gtk-0.7 from F16 do Debian (Ubuntu) is not a crime.

Moreover file http://mentors.debian.net/debian/pool/main/s/spice-gtk/spice-gtk_0.7-2.dsc ( been located at http://mentors.debian.net/package/spice-gtk) doesn’t exist on the Net any longer,which has been used by myself for :
$ dget -x http://mentors.debian.net/debian/pool/main/s/spice-gtk/spice-gtk_0.7-2.dsc
$ dpkg-source -x spice-gtk_0.7-2.dsc

and spice-gtk-0.7-2 was a base I used to rebuild debian packages with introspection enabled, view my PPA
“Building Spice-Gtk-0.7 via Debian Unstable with gobject-introspection enabled”. It means I did it on my own . Everything had been done by myself from scratch.
I really did it from scratch but in different way and at different time. View another my PPA : Qemu-kvm 0.15.0 and Spice on Ubuntu 11.10 as of 08/10/11 and my article at LinuxToday Set up Spice-Gtk-0.7 on Ubuntu 11.10
***********************************************************
Now back to rebuild spice-gtk-0.7-2 done on 08/20/11 :-
***********************************************************
Port Debian Unstable Spice Server (been built with embedded libcelt051) to Ubuntu 11.10.
$ dget -x http://mentors.debian.net/debian/pool/main/s/spice/spice_0.8.2-2.dsc
$ dpkg-source -x spice_0.8.2-2.dsc
Port Debian Unstable version of Spice-Gtk-0.7 to Ubuntu 11.10.
$ dget -x http://mentors.debian.net/debian/pool/main/s/spice-gtk/spice-gtk_0.7-2.dsc
$ dpkg-source -x spice-gtk_0.7-2.dsc
It requires rebuild to enable gobject-introspection,which was done in PPA “Building Spice-Gtk-0.7 via Debian Unstable with gobject-introspection enabled” for Ubuntu 11.10.

Details may be viewed here :
Building Spice-Gtk-0.7 via Debian Unstable with gobject-introspection enabled

In particular,

1. Added –enable-introspection to debian/rules dh_auto_configure.

dh_auto_configure -B/build/buildd/spice-gtk-0.7/build-gtk3 -- \
--enable-smartcard=no --with-gtk=3.0 --disable-static --enable-introspection


dh_auto_configure -- \
--enable-smartcard=no --with-gtk=2.0 --disable-static --enable-introspection

2. Updated debian/control and added required dependencies

Build-Depends:
debhelper (>= 8.0.0),
libspice-protocol-dev (>= 0.8.1),
libspice-server-dev,
libpixman-1-dev (>= 0.17.7),
libgtk2.0-dev,
libgtk-3-dev,
libglib2.0-dev (>= 2.22),
libcairo2-dev (>= 1.2.0),
libpulse-dev,
python2.7,
python-gtk2-dev (>= 2.0.0),
python-pyparsing,
intltool,
libsasl2-dev,
libjpeg8-dev,
gobject-introspection, <=
libgirepository1.0-dev <=

The last two lines have been added.

3.Several debian/package_name.install files have been updated by adding right full path to corresponding library to accommodate installation of :-

/usr/lib/girepository-1.0/SpiceClientGLib-2.0.typelib
/usr/lib/girepository-1.0/SpiceClientGtk-2.0.typelib
/usr/lib/girepository-1.0/SpiceClientGtk-3.0.typelib
/usr/share/gir-1.0/SpiceClientGLib-2.0.gir
/usr/share/gir-1.0/SpiceClientGtk-3.0.gir

which otherwise won’t be installed.

Added to libspice-client-glib-2.0-4.install
line usr/lib/girepository-1.0/SpiceClientGLib-2.0.typelib

Added to libspice-client-gtk-2.0-1.install
line usr/lib/girepository-1.0/SpiceClientGtk-2.0.typelib

Added to libspice-client-gtk-3.0-1.install
line usr/lib/girepository-1.0/SpiceClientGtk-3.0.typelib

Added to libspice-client-glib-2.0-dev.install
line usr/share/gir-1.0/SpiceClientGLib-2.0.gir

Added to libspice-client-gtk-3.0-dev.install
line usr/share/gir-1.0/SpiceClientGtk-3.0.gir

Qemu-kvm 0.15.0 was built with changed dependencies in the same PPA
Packages from https://launchpad.net/~bderzhavets/+archive/test-deb2 installed with no conflicts on Oneiric daily build 08/27/11. Spice sessions (via VirtManager) in QXL mode (64M vram) for install and for runtime have been run. The most recent snapshot for seabios supporting 64M vram for QXL device
uploaded to ppa:bderzhavets/test-deb2, ppa:bderzhavets/test-deb1

To install packages from PPA

$ sudo add-apt-repository ppa:bderzhavet/test-deb2
$ sudo apt-get update
$ sudo apt-get install qemu-kvm qemu qemu-common \
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 spice-client \
seabios

$ 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
$ sudo reboot







References
1. http://mentors.debian.net/package/spice-gtk
2. http://www.mail-archive.com/ubuntu-bugs@lists.ubuntu.com/msg3124003.html


Follow

Get every new post delivered to your Inbox.

Join 25 other followers