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 = 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

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://
cd libcacard
./configure --prefix=/usr --libdir=/usr/lib64 # Ignore --libdir at Ubuntu
make install

Getting client sources

git clone git://
git clone git://
tar xvzf celt-

Getting client/server sources

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

git clone git://
cd qemu; git checkout -b spice.v13 origin/spice.v13; cd ..
git clone git://
git clone git://
git clone git://
git clone git://
git clone git://
tar xvzf celt-

Building common sources.

This part applies to both server and client build process.

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

Building client side tools

cd $BUILD_ROOT/spice
./ --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

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.