Build Spice-Gtk-0.6 (GTK2&GTK3) on Ubuntu 11.10 (Oneiric)

June 28, 2011

Package spice-gtk-0.6 has been rebuilt on Natty to support gobject-introspection.Notice, that it was GTK2 build. Only GTK2 build creates SpiceClientGtk.so,which allows you to open Spice Console via virt-manager. Fedora 16 (rawhide) does two parallel builds GTK2 and GTK3. Analysis of spice-gtk-0.6-1.fc16.src.rpm clearly shows how packages are supposed to be created separating directories with GTK2 and GTK3 shared libraries. Actually, spice-gtk.spec works as a sample to create debian’s package.install files, providing an option reproduce exactly the same file layout on Ubuntu 11.10 as it is on F16 (rawhide) after install package spice-gtk-0.6-1.
Just SpiceClientGtk.so allows to run installs with video mode “vga” and spice sessions in “qxl” video mode with created domains via virt-manager.
View PPA Spice-Gtk-0.6 on Ubuntu 11.04 and Ubuntu 11.10 for details :-
Build with GTK2 : spice-gtk-0.6-9ubuntu15
Built packages
libspice-client Spice GTK+ Library
libspice-client-dev Spice GTK+ Library (development files)
Build with GTK3 : spice-gtk3-0.6-3ubuntu9
Built packages
libspicegtk3-client Spice GTK+ Library
libspicegtk3-client-dev Spice GTK+ Library (development files)
spicegtk3-client Virtual Desktop Interface Client using the Spice Protocol
Build spice-gtk3-0.6-3ubuntu9 depends on libspice-client. Both builds have been done for Oneiric and tested to install (with no conflicts) via Synaptic Manager and to work on daily builds 06/24/11 and 06/29/11 . Qemu-kvm build (spice enabled) was based on git clone git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git as of 06/23/11.


Set up Spicevmc Channel on Ubuntu 11.04 as KVM Server and spice-vdagent on Natty as a KVM guest

June 13, 2011

Procedure following bellow set up spicevmc channel support on KVM Server Ubuntu Natty. It also instructs how to setup spice-vdagent on Natty installed as KVM guest at any KVM Server Ubuntu 11.04 or F15. In other words it contains build debian package spice-vdagent via source for Ubuntu 11.04 ( Natty). To setup spicevmc channel on Natty install qemu-kvm packages from PPA Packages in Spice-Gtk-0.6 on Ubuntu 11.04 and Ubuntu 11.10. Build qemu-kvm-060911-0ubuntu5 from PPA already supports spicevmc channel.It’s original tarball is based on git clone git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git on 06/09/2011.Also upgrade virtinst via same PPA up to 0.500.6 to have virt-install understand option “–channel spicevmc”

Install VF15 KVM guest via :-

virt-install --connect qemu:///system \
--virt-type kvm \
--os-type=linux --os-variant=fedora15 \
--name VM15VMC --ram 2048 --disk path=/dev/sda5 \
--graphics spice --video qxl --channel spicevmc \
--cdrom /usr/tmp/Fedora-15-x86_64-DVD.iso --vcpus 2

Due to absence Virt-Manager’s ability to create channels,
e.g. it’s missing required F15 patches. Then in guest environment :
# sudo yum update
# sudo yum install spice-vdagent.
It provides an option cut text in VM Spice screen and paste in KVM Server Ubuntu 11.04 desktop environment and vice versa ….
Debian qemu-kvm packages providing spicevmc support have been also tested OK on Oneiric ( Libvirt 0.9.1)





Install Natty KVM guest as follows :-


virt-install --connect qemu:///system \
--virt-type kvm \
--os-type=linux --os-variant=ubuntunatty \
--name UbuntuVMC --ram 2048 \
--disk path=/dev/sdb7 \
--graphics spice --video qxl \
--channel spicevmc \
--cdrom /usr/tmp/ubuntuDesk11.04.iso \
--vcpus 2

When done install spice-vdagent for Natty via PPA Spice on Ubuntu 11.04 and 11.10.
*********************************************************************************
Update on 06/17/2011. Current versions of spice-vdagent install service and *.desktop (file) automatically and require guest restart for activation or manual gdm restart and starting service.
*********************************************************************************

Next :-
1. Create file /etc/xdg/autostart/spice-vdagent.desktop

[Desktop Entry]
Name=Spice vdagent
Comment=Agent for Spice guests
Exec=/usr/bin/spice-vdagent
Terminal=false
Type=Application
Categories=
X-GNOME-Autostart-Phase=Initialization
X-GNOME-AutoRestart=true

2. Then create service spice-vdagentd.

Create file /etc/init/spice-vdagentd.conf

# spice-vdagent - spice-vdagent job file
description "spice-vdagentd"
author "Boris Derzhavets <bderzhavets@yahoo.com>"
# Stanzas
#
# Stanzas control when and how a process is started and stopped
# See a list of stanzas here: http://upstart.ubuntu.com/wiki/Stanzas#respawn
# When to start the service
start on runlevel [2345]
# When to stop the service
stop on runlevel [016]
# Automatically restart process if crashed
respawn
# Essentially lets upstart know the process will detach itself to the background
expect fork
# Run before process
pre-start script
[ -d /var/run/spice-vdagentd ] || mkdir -p /var/run/spice-vdagentd
echo "Put bash code here"
end script
# Start the process
exec /usr/sbin/spice-vdagentd

Expected result :-

boris@boris-virtual-machine:~$ ps -ef| grep spice- | grep -v grep
root 739 1 0 09:23 ? 00:00:00 /usr/sbin/spice-vdagentd
gdm 1041 1 0 09:23 ? 00:00:00 /usr/bin/spice-vdagent
boris 1248 1 0 09:23 ? 00:00:00 /usr/bin/spice-vdagent

Current Build is just for testing. All actions above should be incapsulated in debian package.
If feature doesn’t work :-
boris@boris-virtual-machine:~$ ps -ef|grep spice-
root 1044 1 0 18:25 ? 00:00:00 /usr/sbin/spice-vdagentd
boris 1439 1379 0 18:25 pts/0 00:00:00 grep –color=auto spice-
boris@boris-virtual-machine:~$ /usr/bin/spice-vdagent &
[1] 1445



Testing Oneiric Daily Build as KVM guest :-


Spice-Gtk-0.6 on Ubuntu 11.10 (Oneiric) after Libvirt & python-libvirt upgrade up to 0.9.1

June 10, 2011

Packages from PPA Spice-Gtk-0.6 on Ubuntu 11.04 have been rebuilt and installed on Oneiric Alpha 1 + (apt-get update; apt-get upgrade) as of 06/10/2011. Virt-Manager is able to perform guest’s installs with either VNC Server or Spice Server & Video Mode “VGA”. Afterwards guest’s Grapics may be switched to Spice Server and video mode to “QXL” Spice sessions run normal via Virt-Manager and spicec as well. As of now all packages from Spice-Gtk-0.6 on Ubuntu 11.04 and Ubuntu 11.10 are rebuilt for Oneiric and uploaded to the same PPA.