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


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


Implementation Spice on Ubuntu 11.10 KVM Server

July 5, 2011

**********************************************************************************************
UPDATE on 12/03/11. Ubuntu 12.04 (Precise Pangolin) alpha 1 is out.
**********************************************************************************************
View Qemu-kvm 1.0 & Spice 0.10.0 & Spice-Gtk-0.7.81 USB redirection for Ubuntu Precise, Oneiric and Linux Mint 12 (Lisa)
**********************************************************************************************
UPDATE on 10/15/11. Ubuntu 11.10 (Oneiric Ocelot) final release is out.
**********************************************************************************************
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 “howtos”
a.Set up Qemu&Spice USB redirection on Ubuntu 11.10
b.Set up Qemu&Spice&Libvirt 0.9.6 USB Redirection on Ubuntu 11.10
3.Link for PPA Qemu&Spice USB redirection and Libvirt 0.9.6 on Ubuntu 11.10
4.View also Qemu-kvm 0.15.1 & Spice USB Redirection support for Ubuntu Oneiric
**********************************************************************************************
UPDATE on 08/27/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. View PPA Building Spice-Gtk-0.7 via Debian Unstable with Gobject-introspection enabled. View for core details Implementation Spice on Ubuntu 11.10 KVM Server the most recent approach.
Qemu-kvm 0.15.0 was built with changed dependencies (due to SpiceServer 0.8.2 with embedded libcelt051) 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 PPAs 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
**********************************************************************************
All packages required are already in PPA “Spice-Gtk-0.7 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.
Following bellow is brief description of PPA Spice-Gtk-0.7 on Ubuntu 11.10.
View also PPA Qemu-kvm 0.15.0 and Spice on Ubuntu 11.10

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.

******************************
Install software from PPA :-
******************************
$ sudo apt-add-repository ppa:bderzhavets/spice-7
$ 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








Set up KVM/QEMU/SPICE on Ubuntu 11.04 via ppa:serge-hallyn/spice2

April 27, 2011

*****************************************************************************************************************
UPDATE on 09/21/11 Ubuntu 11.10 beta-2 will be released tomorrow.
Ubuntu 11.10 final release (Oneiric Ocelot) 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) for Oneiric
Qemu-kvm-0.15.0+noroms (spice enabled), Spice Server&Client 0.8.2, Spice-Gtk-0.7-2 (via Debian)

2. Set up Qemu-kvm 0.15.1 & Spice USB Redirection support for Ubuntu Oneiric
Patches set for debian build may be generated as follows :

$ git clone git://people.freedesktop.org/~jwrdegoede/qemu
$ cd qemu
$ git checkout -B qemu-kvm-0.15.0-usbredir origin/qemu-kvm-0.15.0-usbredir
$ mkdir -p /tmp/patches
$ git format-patch -M -C --output-directory \
/tmp/patches ea2798c1ebe0c12d5feb7d7471a999ea0671ef2f

Kernel installed is 3.1.0-030100-generic
Consider option downgrade seabios 1.6.3 => 0.6.2-qxl if some things go wrong for you. It won’t affect USB Redirection support

*****************************************************************************************************************
UPDATE on 08/27/2011. In meantime the best way to solve the problem on Ubuntu 11.10 (Oneiric) is to work via PPA Building Spice-Gtk-0.7 via Debian Unstable with Gobject-introspection enabled. View for details Implementation Spice on Ubuntu 11.10 KVM Server the most recent approach.
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.

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
**********************************************************************************************************************
Packages installed via ppa:serge-hallyn/spice2 have been tested for F14, W7 KVMs installs and runtime. Package qemu-kvm-spice (0.14.0+noroms-0ubuntu4qxl2) is based on the most recent RH’s QXL patches sets for qemu-kvm-0.14.tar.gz. Disabling AppArmor’s profile for libvirtd allows to manage and create domains via virt-manager 0.8.6-1 installed on Ubuntu Natty Narwhal. However, first domain install with option “-spice port=5900,disable-ticketing -vga qxl” has been been performed via qemu-kvm command line keeping original restrictions in place.
Add new repository to system :-

# add-apt-repository ppa:serge-hallyn/spice2
# apt-get update

Install packages from PPA on your system :-



Verify install via “dpkg -l” :

root@boris-System-P5Q3:~# dpkg -l |grep spice
ii libspice-client 0.6-0ubuntu1 Spice GTK+ Library
ii libspice-client-dev 0.6-0ubuntu1 Spice GTK+ Library (development files)
ii libspice-server 0.8.1-0ubuntu1 Spice Server-Side Library
ii libspice-server-dev 0.8.1-0ubuntu1 Spice Server-Side Library (development files)
ii qemu-kvm-spice 0.14.0+noroms-0ubuntu4qxl2 Full virtualization on i386 and amd64 hardware
ii spice 0.8.1-0ubuntu1 Spice Client
ii spice-protocol-dev 0.8.0-0ubuntu1 SPICE protocol headers

AppArmor’s restriction for libvirtd profile on Natty Narwhal brings us initially to qemu-kvm command line installation.
Open terminal session and issue :-

/usr/bin/kvm-spice -cpu host -enable-kvm \
-name W7 -m 2048 \
-drive file=/dev/sdb7,if=virtio,media=disk,aio=native,cache=off \
-drive file=/usr/tmp/virtio-win-1.1.16.vfd,if=floppy \
-net nic,model=rtl8139 -net user -localtime \
-usb -vga qxl -spice port=5900,disable-ticketing \
-cdrom /usr/tmp/Win7_64.iso -boot d

Connect to console via “spicec -h localhost -p 5900″ and proceed with install :-







When done load W7 KVM as follows :-

/usr/bin/kvm-spice -cpu host -enable-kvm \
-name W7 -m 2048 \
-drive file=/dev/sdb7,if=virtio,media=disk,aio=native,cache=off \
-net nic,model=virtio -net user -localtime \
-usb -vga qxl -spice port=5900,disable-ticketing \
-cdrom /usr/tmp/virtio-win-1.1.16.iso

and set up VirtIO Net Driver




Finally runtime command line will look like :-

/usr/bin/kvm-spice -cpu host -enable-kvm \
-name W7 -m 2048 \
-drive file=/dev/sdb7,if=virtio,media=disk,aio=native,cache=off \
-net nic,model=virtio -net user -localtime \
-usb -vga qxl -spice port=5900,disable-ticketing



Now disable AppArmor profile for libvirtd :-

# ln -s /etc/apparmor.d/usr.sbin.libvirtd /etc/apparmor.d/disable/
# apparmor_parser -R /etc/apparmor.d/usr.sbin.libvirtd
# reboot

Next step

# cd /usr/bin
# cp qemu-system-x86_64-spice qemu-system-x86_64
# cp qemu-x86_64-spice qemu-x86_64

Invoke virt-manager with option “Import Existing Image”



and update XML definition of W7 as follows.

<domain type='kvm'>
<name>W7</name>
<memory>2097152</memory>
<currentMemory>2097152</currentMemory>
<vcpu>2</vcpu>
<os>
<type arch='x86_64' machine='pc-0.14'>hvm</type>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='localtime'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/bin/kvm</emulator>
<disk type='block' device='disk'>
<driver name='qemu' type='raw' cache='none'/>
<source dev='/dev/sdb7'/>
<target dev='vda' bus='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</disk>
<controller type='ide' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
</controller>
<interface type='bridge'>
<mac address='52:54:00:7d:5d:dc'/>
<source bridge='br0'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
<input type='tablet' bus='usb'/>
<input type='mouse' bus='ps2'/>
<graphics type='spice' autoport='yes' listen='0.0.0.0'/>
<sound model='ac97'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</sound>
<video>
<model type='qxl' vram='32768' heads='1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
<memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</memballoon>
</devices>
</domain>

Run
# virsh define W7.xml

Now start domain via Virt-Manger :-





Actually at this point domains may be created in VNC mode via virt-manager 0.8.6-1. SPICE Server activated invoking “Add Hardware” wizard -> “Graphics->Spice Server , previously removing VNC Server. Switching domain to “QXL” mode is also possible via virt-manager.

References
1. https://launchpad.net/~serge-hallyn/+archive/spice2


Follow

Get every new post delivered to your Inbox.