Set up Spice-Gtk-0.6 on Ubuntu 11.04 ( Natty Narwhal )

May 23, 2011

I presume that standard KVM Server has been already setup on Ubuntu 11.04. The intend is to push “spice” as far as possible on the system, including option of running spice session via virt-manager for domains install (video “vmvga”) and runtime (video “qxl” or “vmvga”) as well. Add to system PPA Building qemu-kvm&spice based on current /virt/kvm/qemu-kvm.git for Ubuntu 11.04

# apt-add-repository ppa:bderzhavets/git-spice
# apt-get update

Install all packages from PPA except spice-gtk. It will result install spice enabled qemu binaries into /usr/bin due to
original tar ball was based on git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git as of May 18 2011. Spice server and spice client will be installed also.
*************************************************************************************************************
Update on 05/25/2011. Finally i have rebuilt Spice-gtk package in mentioned PPA to support python and gobject-introspection
*************************************************************************************************************
Then we will build Spice-gtk-0.6 manually to enable gobject-introspection

# apt-get install cdbs debhelper autotools-dev spice-protocol-dev \
libpixman-1-dev pkg-config libssl-dev \
libjpeg62-dev libcelt051-dev libgtk2.0-dev libglib2.0-dev \
libcairo2-dev libpulse-dev libsasl2-dev \
python2.6 libtext-csv-perl python-pyparsing python-gtk2-dev \
gobject-introspection libgirepository1.0-dev

Download spice-gtk-0.6.tar.bz2 to /usr/src/SPICE_GTK_0.6

# cd /usr/src/SPICE_GTK_0.6
# tar -jxvf spice-gtk-0.6.tar.bz2
# cd spice-gtk-0.6
# ./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

. . . . . . . .

Spice-Gtk 0.6
==============

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

Coroutine: ucontext
Audio: pulse
Target:
SASL support: yes
Gtk: 2.0

Now type ‘make’ to build spice-gtk

# make
# checkinstall –install=no
# dpkg -i ./spice-gtk_0.6-1_amd64.deb
(Reading database … 148506 files and directories currently installed.)
Unpacking spice-gtk (from ./spice-gtk_0.6-1_amd64.deb) …
Setting up spice-gtk (0.6-1) …

There is also another option add to system PPA Spice-Gtk-0.6 on Ubuntu 11.04 and install ready package spice-gtk-0.6-1ubuntu8.

Start spice session via virt-manager :-





At this point mouse pointer will be lost after blind click on the bar ” Account Name”. But bar will stay highlighted. Press “Enter”
it will activate password prompt and get mouse pointer back. Otherwise, log into VM and mouse pointer should be alive again.
Procedure has been tested with F14,Natty,W7 virtual machines logging in.




Rebuild KVM/QEMU to support SPICE on Ubuntu 11.04 (Natty Narwhal)

May 9, 2011

Rebuild procedure of regular qemu-kvm package to support spice on Natty Narwhal follows bellow. It depends on all packages from ppa:serge-hallyn/spice2 except qemu-kvm-spice. New packages install spice enabled /usr/bin/qemu* binaries and graphical spice client. I just disabled libvirtd’s AppArmor profile to be able manage domains via virt-manager. Spice install may be performed via virt-install. It would understand options “–graphics spice”, “–video qxl”. All required packages have been uploaded and built in PPA Spice on Ubuntu 11.04. View also
Building qemu-kvm&spice based on current /virt/kvm/qemu-kvm.git for Ubuntu 11.04
Uncompress regular Natty qemu-kvm package :-

qemu-kvm_0.14.0+noroms-0ubuntu4.diff.gz
qemu-kvm_0.14.0+noroms-0ubuntu4.dsc
qemu-kvm_0.14.0+noroms.orig.tar.gz

# dpkg-source -x qemu-kvm_0.14.0+noroms-0ubuntu4.dsc
# cd qemu-kvm_0.14.0+noroms-0ubuntu4

Edit debian/rules and comment line ( per Serge Hallyn)

# $(MAKE) -f debian/rules unpatch

to get patching to work !!

That’s a reason why hack “spice-qxl-locking-fix-for-qemu-kvm.patch” didn’t work originally.

Change ./configure part of debian/rules adding “–enable-spice” :-

config-host.mak: $(QUILT_STAMPFN)
dh_testdir
./configure \
–target-list=”x86_64-softmmu i386-softmmu x86_64-linux-user i386-linux-user” \
–prefix=/usr \
–interp-prefix=/etc/qemu-binfmt/%M \
–disable-blobs \
–disable-strip \
–enable-spice \
$(conf_arch)
Save

Edit debian/patches/series:-

larger_default_ram_size.patch
# Detect-and-use-GCC-atomic-builtins-for-locking.patch
# spice-qxl-locking-fix-for-qemu-kvm.patch
0001-qxl-spice-display-move-pipe-to-ssd.patch
0002-qxl-implement-get_command-in-vga-mode-without-locks.patch
0003-qxl-spice-remove-qemu_mutex_-un-lock_iothread-around.patch
0004-hw-qxl-render-drop-cursor-locks-replace-with-pipe.patch

Save and copy required patches to debian/patches.

Edit debian/control like in SPICE2 PPA:-

Build-Depends: bcc,
bzip2,
debhelper (>= 7),
device-tree-compiler [powerpc],
iasl,
libaio-dev,
libasound2-dev,
libcelt051-dev,
libcurl4-gnutls-dev,
libgnutls-dev,
libncurses5-dev,
libpci-dev,
libpixman-1-dev,
libpulse-dev,
libsasl2-dev,
libsdl1.2-dev (>= 1.2.14),
libssl-dev,
libx11-dev,
nasm,
perl,
pkg-config,
quilt (>= 0.40),
libspice-server-dev,
spice-protocol-dev,
sysv-rc (>= 2.86.ds1-14.1ubuntu2),
texi2html,
texinfo,
uuid-dev,
zlib1g-dev
Save.

Edit debian/chagelog and upgrade version to 5.
# cd ..
# dpkg-buildpackage -rfakeroot -b -us -uc
# cd ..
root@boris-System-P5Q3:~/QEMU14# # dpkg -i ./qemu-kvm_0.14.0+noroms-0ubuntu5_amd64.deb \
qemu_0.14.0+noroms-0ubuntu5_amd64.deb \
qemu-common_0.14.0+noroms-0ubuntu5_all.deb

(Reading database … 141175 files and directories currently installed.)
Preparing to replace qemu-kvm 0.14.0+noroms-0ubuntu4 (using …/qemu-kvm_0.14.0+noroms-0ubuntu5_amd64.deb) …
Unpacking replacement qemu-kvm …
Preparing to replace qemu 0.14.0+noroms-0ubuntu4 (using qemu_0.14.0+noroms-0ubuntu5_amd64.deb) …
Unpacking replacement qemu …
Preparing to replace qemu-common 0.14.0+noroms-0ubuntu4 (using qemu-common_0.14.0+noroms-0ubuntu5_all.deb) …
Unpacking replacement qemu-common …
Setting up qemu-common (0.14.0+noroms-0ubuntu5) …
Setting up qemu-kvm (0.14.0+noroms-0ubuntu5) …
Processing triggers for ureadahead …
ureadahead will be reprofiled on next reboot
Processing triggers for man-db …
Setting up qemu (0.14.0+noroms-0ubuntu5) …

# dpkg -l | grep qemu

ii qemu 0.14.0+noroms-0ubuntu5 dummy transitional package from qemu to qemu-kvm
ii qemu-common 0.14.0+noroms-0ubuntu5 qemu common functionality (bios, documentation, etc)
ii qemu-kvm 0.14.0+noroms-0ubuntu5 Full virtualization on i386 and amd64 hardware

root@boris-System-P5Q3:~/QEMU14# ls -l /usr/bin/kvm*
lrwxrwxrwx 1 root root 18 2011-05-06 15:24 /usr/bin/kvm -> qemu-system-x86_64
lrwxrwxrwx 1 root root 8 2011-05-06 15:24 /usr/bin/kvm-img -> qemu-img
lrwxrwxrwx 1 root root 8 2011-05-06 15:24 /usr/bin/kvm-nbd -> qemu-nbd
-rwxr-xr-x 1 root root 11792 2011-02-22 16:34 /usr/bin/kvm_stat

root@boris-System-P5Q3:~/QEMU14# ls -l /usr/bin/qemu*
-rwxr-xr-x 1 root root 3520568 2011-05-06 15:08 /usr/bin/qemu
-rwxr-xr-x 1 root root 2014976 2011-05-06 15:08 /usr/bin/qemu-i386
-rwxr-xr-x 1 root root 270 2011-05-06 14:04 /usr/bin/qemu-ifdown
-rwxr-xr-x 1 root root 138 2011-02-22 16:34 /usr/bin/qemu-ifup
-rwxr-xr-x 1 root root 350640 2011-05-06 15:08 /usr/bin/qemu-img
-rwxr-xr-x 1 root root 362928 2011-05-06 15:08 /usr/bin/qemu-io
-rwxr-xr-x 1 root root 338384 2011-05-06 15:08 /usr/bin/qemu-nbd
lrwxrwxrwx 1 root root 4 2011-05-06 15:24 /usr/bin/qemu-system-i386 -> qemu
-rwxr-xr-x 1 root root 3590968 2011-05-06 15:08 /usr/bin/qemu-system-x86_64
-rwxr-xr-x 1 root root 2055128 2011-05-06 15:08 /usr/bin/qemu-x86_64

Signed packages uploaded to https://launchpad.net/~bderzhavets/+archive/spice2


Follow

Get every new post delivered to your Inbox.