Install spice on Linux

Source: Internet
Author: User
Build spice library and experimental qemu spice serverthursday, rjl 22,201 0-08:50 Haydn Solomon

In this post I'll walk through the building the spice library and qemu-spice using RFC patches recently submitted. this procedure was used on the latest fedora 12 Linux distribution at the time of this writing so you'll have to make adjustments if you're re running
An another distribution. note that I have not gone beyond testing with the built software and there are already some known issues. updates on these issues will posted either on the comments section of this post or in a new blog entry.

 

Install spice Protocol

The spice Library has the following pre-requisite software for building on your system; Spice protocol, log4cpp development packages, cegui development packages, pixman and cel051 development packages. you can install these required packages in any order
But I'll start with SPICE protocol. the spice protocol you'll be installing really is nothing more than a few header files. this does not mean however that you can just copy these files anywhere. the reason is that it must be installed as a PKG-config package
For spice library to find later on since we're building these packages using GNU Autoconf tools. First, get the latest spice protocol code using the following git command.

git clone git://anongit.freedesktop.org/spice/spice-protocol

Go to the root directory and configure with the following command.

$ ./autogen.sh

Next run make

$ make

Then make install

$ make install

This shoshould complete the installation of the spice protocol. It will install under/usr/local/include/spice-1/spice. You shoshould see a listing of files as follows

-rw-r--r-- 1 root root  2015 2010-04-19 00:51 barrier.h-rw-r--r-- 1 root root  9536 2010-04-19 00:51 draw.h-rw-r--r-- 1 root root  1769 2010-04-19 00:51 end-packed.h-rw-r--r-- 1 root root  2307 2010-04-19 00:51 error_codes.h-rw-r--r-- 1 root root  5415 2010-04-19 00:51 ipc_ring.h-rw-r--r-- 1 root root  6443 2010-04-19 00:51 macros.h-rw-r--r-- 1 root root 22594 2010-04-19 00:51 protocol.h-rw-r--r-- 1 root root  9695 2010-04-19 00:51 qxl_dev.h-rw-r--r-- 1 root root  2197 2010-04-19 00:51 start-packed.h-rw-r--r-- 1 root root  2555 2010-04-19 00:51 stats.h-rw-r--r-- 1 root root  1879 2010-04-19 00:51 types.h-rw-r--r-- 1 root root  2937 2010-04-19 00:51 vd_agent.h-rw-r--r-- 1 root root  2608 2010-04-19 00:51 vdi_dev.h

This completes the installation of spice-Protocol package.

 

Install log4cpp-devel, cegui-devel, pixman and celt051-devel packages

The other packages required for building the spice library are log4cpp-devel, cegui-devel, pixman and celt051-devel. on fedora these are all provided as distribution packages IE. rpm packages. I don't know about other distributions but if these are not available
You can also build them using GNU Autoconf tools. in this post I won't cover building these packages with GNU Autoconf tools since that is a simple process. to install these packages on fedora 12 use the following commands

yum –y install log4cpp-devel cegui-devel celt051-devel

On fedora 12, the pixman package is an earlier release than that required so you can use the rawhide repository for a newer release of the software. Install pixman using the following command

yum –y install --enablerepo=rawhide pixman

This will complete the installation of the RPM packaged required software for building spice.

 

Build spice library and client

Building spice library and client is fairly straightforward. the only thing to be aware of is that the spice-Protocol package you installed from the previous section INSTALLThe PKG-config. PC file under/usr/local/lib/pkgconfig by default. if your Linux
System doesn't use this directory for your PKG-config. PC files then you'll need to use one additional command for building the spice library and client. first download the latest spice code using the following git command.

git clone git://anongit.freedesktop.org/~kraxel/spice

On my system PKG-config configuration directory was not/usr/local/lib/pkgconfig so I needed to use the following command to adjust for this when building spice library.

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

Next, run autogen. Sh script from the root directory

$ ./autogen.sh

Now type 'make' to build spice then run make install to complete the installation. Spice library will be installed under/usr/local/lib. below shows the contents of this directory.

-rw-r--r-- 1 root root 4703110 2010-04-19 01:22 libspice-server.a-rwxr-xr-x 1 root root    1048 2010-04-19 01:22 libspice-server.lalrwxrwxrwx 1 root root      24 2010-04-19 01:22 libspice-server.so -> libspice-server.so.1.0.0lrwxrwxrwx 1 root root      24 2010-04-19 01:22 libspice-server.so.1 -> libspice-server.so.1.0.0-rwxr-xr-x 1 root root 2966811 2010-04-19 01:22 libspice-server.so.1.0.0

Spice client will also be built and installed in the source tree. from the root of the source tree (GIT download), you'll find the spice client after building. /client/X11/spicec. this completes the installation of the spice library and spice client.

 

Install qemu-spice

Clone qemu-spice using the following command.

git clone git://anongit.freedesktop.org/spice/qemu 

Next switch to the spice. V3 branch using the following command

$ git checkout -b spice.v3 remotes/origin/spice.v3

Next comment out the following lines from the configure script so that it looks like the following. Thanks to pavlinux for this tip.

# quick hack for kraxel's spice devel environment# spice_cflags="-I/export/git/work/spice/server/include $spice_cflags"# spice_cflags="-L/export/git/work/spice/server/.libs $spice_cflags"# spice_cflags="$spice_cflags -L/export/git/work/slirp/release"# spice_libs="$spice_libs -lspice-server -lslirp"

Now build qemu + spice with the following commands assuming you're doing this on an x86 machine. Adjust the-target-list variable for other ubuntures.

./configure --prefix=/usr/local/qemu-spice --target-list=x86_64-softmmu

Now run make then make install. this step will only apply if/usr/local/lib is not searched by your Linux system linker (LD ). if not you can add a file named spice. conf to/etc/lD. so. conf. d with one line as follows

/usr/local/lib

If you needed to add this file then issue the command 'ldconfig' to add/usr/local/lib to the system linker search path.

At this point, you'll have built and installed enough to start playing with experimental spice patches to upstream qemu. I haven't tested it yet but there does seem to be some issues parsing the command line options. please post questions, comments on how
This build went for you.

Update: For running spice on Ubuntu, see the following post.

Http://www.linux-kvm.com/content/spice-ubuntu-wiki-available

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.