Generic Build Instructions

This section is for distributions that don't have *spice* packages in their repositories. It will show you step by step how to build the required spice components.

Client requirements

  1. autotools

  2. gtk+2 > 2.18 or gtk+3

  3. celt = 0.5.1.3 The exact version is required due to the lack of backwards compatibility in newer celt releases.

  4. cyrus-sasl

  5. pixman

  6. openssl

  7. pyparsing

  8. usbredir

  9. PolicyKit

Host requirements

  1. KVM supported by kernel (It should work also without KVM, but it's not being tested as most Linux distrubitions already support KVM.)

Guest requirements

Linux Guest

spice-vdagent requires virtio-serial support to be enabled. This is described in the chapter Spice basics. Guest should have installed qxl driver (xorg-x11-drv-qxl on Fedora and RHEL).

Windows Guest

Drivers for QXL and drivers for virtio-serial require Win XP SP3 and Win 7.

Setting up the build environment

This is a list of prerequisites on RHEL or Fedora. Install equivalent packages for your distribution in case that you're not using RHEL or Fedora.

All prerequisites for Windows are available in one big package which is available at http://spice-space.org/download.html.

yum install git pixman-devel celt051-devel cegui-devel libjpeg-devel alsa-lib-devel log4cpp-devel \
                openssl-devel libXrandr-devel libgcrypt-devel SDL-devel nss-devel dev86 iasl pyparsing

Package prerequisites for Ubuntu

apt-get install build-essential autoconf git-core libtool liblog4cpp5-dev libavcodec-dev \
                libssl-dev xlibmesa-glu-dev libasound-dev libpng12-dev libfreetype6-dev libfontconfig1-dev \
                libogg-dev libxrandr-dev kvm libgcrypt-dev libsdl-dev

Building libcacard

Fedora >=14 RHEL >=6.1 has libcacard already available. So you can install it directly trough yum.

yum install libcacard

Otherwise follow these instructions. The environment variable $BUILD_ROOT will point to a directory with stored sources and will be used during the whole build process. The variable $INST_ROOT will point to a directory in which Spice will be installed.

export BUILD_ROOT=/tmp/spice; mkdir $BUILD_ROOT; cd $BUILD_ROOT;
export INST_ROOT="/opt/spice"; mkdir $INST_ROOT
git clone git://anongit.freedesktop.org/~alon/libcacard
cd libcacard
./configure --prefix=/usr --libdir=/usr/lib64 # Ignore --libdir at Ubuntu
make
make install

Getting client sources

cd $BUILD_ROOT
git clone git://cgit.freedesktop.org/spice/spice-protocol
git clone git://cgit.freedesktop.org/spice/spice
wget http://downloads.us.xiph.org/releases/celt/celt-0.5.1.3.tar.gz
tar xvzf celt-0.5.1.3.tar.gz
                

Getting client/server sources

Skip this section if you don't want to build server side.

cd $BUILD_ROOT
git clone git://cgit.freedesktop.org/spice/qemu
cd qemu; git checkout -b spice.v13 origin/spice.v13; cd ..
git clone git://cgit.freedesktop.org/spice/spice-protocol
git clone git://cgit.freedesktop.org/spice/spice
git clone git://cgit.freedesktop.org/spice/win32/vd_agent
git clone git://cgit.freedesktop.org/spice/win32/qxl
git clone git://cgit.freedesktop.org/spice/slirp
wget http://downloads.us.xiph.org/releases/celt/celt-0.5.1.3.tar.gz
tar xvzf celt-0.5.1.3.tar.gz

Building common sources.

This part applies to both server and client build process.

cd $BUILD_ROOT/spice-protocol
mkdir m4
./autogen.sh --prefix=$INST_ROOT
sudo make install
cd $BUILD_ROOT/celt-0.5.1.3
./configure --prefix=$INST_ROOT
sudo make install

Building client side tools

cd $BUILD_ROOT/spice
./autogen.sh --prefix=$INST_ROOT --enable-smartcard
cd client
sudo make install

Building server side tools

These instructions contain flags for a minimal working build of qemu with Spice support enabled. You might want to build qemu with the --enable-io-thread option

cd $SRC_ROOT/qemu
./configure --prefix=$INST_ROOT --target-list=x86_64-softmmu --enable-spice
make

Setting up PATH

Last steps before starting with Spice are to set proper PATH variable. For example RHEL is using /usr/libexec as directory for spicec and qemu-kvm binaries. The following setup should be suitable for qemu and Spice built according to the instructions in this chapter.

echo "export PATH=$PATH:$INST_ROOT/bin:$BUILD_ROOT/x86_64-softmmu >> ~/.bashrc
source ~/.bashrc

You should now be able to access the qemu-system-x86_64 and spicec binaries.