Install and configure spice in Ubuntu

Source: Internet
Author: User


Refer to the official wiki: http://docs.cslabs.clarkson.edu/wiki/SPICE

Spice consists of three parts: Spice protocol, spice client, and spice server)


The Protocol is the basis for communication between the server and the client,

The client is a terminal machine that enjoys the service,

The server is the backend machine that provides services.


0. Preparations before installation:

To download and install the source code from the GIT server, you need to install the GIT tool.

sudo apt-get install build-essential autoconf git-core

Of course, you also need to install the tool used to compile the installation package:

sudo apt-get install 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 libnss3-dev libpixman-1-dev libxfixes-dev libjpeg8-dev \libsasl2-dev python-pyparsing 


Finally, prepare and create a folder to store the downloaded installation package. (If you are clear about the download and installation location, you do not need to create this folder)

cdmkdir spice-sourcescd spice-sources

1. Spice installation dependency package:


1.1 libcacard

This library is what spice uses to emulate smart cards and smart card readers.

git clone git://people.freedesktop.org/~alon/libcacardcd libcacard./autogen.shmakesudo make installcd ..
1.2. Install protocol (SPICE protocol headers)

The first dependency to install is the spice protocol headers.

wget http://spice-space.org/download/releases/spice-protocol-0.8.0.tar.bz2tar xjvf spice-protocol-0.8.0.tar.bz2cd spice-protocol-0.8.0mkdir m4./configuremakesudo make installcd ..
1. 3. Install Celt

Spice requires a specific version of The Celt low-latency audio codec (0.5.1.3). Since it is unavailable in the Ubuntu repositories, it must also be compiled.

wget http://downloads.us.xiph.org/releases/celt/celt-0.5.1.3.tar.gztar xvzf celt-0.5.1.3.tar.gzcd celt-0.5.1.3/./configuremakesudo make installcd ..
2. Install the client (SPICE client)

This gives us spicec, the spice client. It's used to connect to spice guests.

The client is used to connect to the server.

wget http://spice-space.org/download/releases/spice-0.8.1.tar.bz2tar xjvf spice-0.8.1.tar.bz2cd spice-0.8.1./configure --enable-smartcardmakesudo make installcd ..

This step is possible to perform on a 32-bit host; it's only installing the spice client.

It is worth noting that 32-bit systems can only install spice clients. The following server cannot be installed!

3. Install spice Server

Now, it's time to build the spice server itself. spice has been rolled into qemu now, so this step amounts to installing a recent version of qemu. in fact, we will be pulling the latest qemu source code for version 0.14. oddly
Enough, qemu 0.14 is available in the Ubuntu repositories, but spice support is not supported in the build.

The above means that qemu already contains the spice service,

First, we need to change an environment variable so that. /configure can find the spice protocol libraries we installed. you will need to set this variable anytime you want to use qemu with SPICE, so it's easiest to put it in
Your. bashrc.

Modify environment variables so that configure can find the function library where Spice is installed.

echo "export LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH}" >> ~/.bashrcsource ~/.bashrc

Now, we can continue with the installation. note that if you require a specific softmmu target, you can add a list of them with the -- target argument. by default, qemu only builds with support for 32-bit x86 guests.

Continue the installation. (PS: skip this step if you have installed qemu before)

wget http://download.savannah.gnu.org/releases/qemu/qemu-0.14.0.tar.gztar xzvf qemu-0.14.0.tar.gzcd qemu-0.14.0./configure --enable-spice --enable-kvm --enable-io-thread --audio-drv-list=alsa,oss --enable-systemmakesudo make install

Now, we need to copy over some BIOS files that qemu will need to start spice VMS. We just need to put them in a location that qemu expects them to be.

Copy the relevant files to the qemu directory to enable the qemu VM. (PS: If you have installed qemu, you only need to confirm that there are the following two files in the/usr/share/qemu/directory. If not, you have to manually copy the files)

sudo cp pc-bios/vgabios-qxl.bin /usr/share/qemu/sudo cp pc-bios/pxe-e1000.bin /usr/share/qemu/cd ..

Now, qemu with SPICE support is installed in
/Usr/local/bin, And the ordinary system qemu is installed in/Usr/bin. We'll make a shortcut cut command called 'qemu-spice 'That you can invoke separately from the system qemu (which doesn' t have spice support ).

Install the qemu containing spice service to usr/local/bin (PS: may also be in usr/bin), and install the common qemu system under/usr/bin. The following is a tool named qemu-spice, which is actually a copy of qemu.

cd /usr/local/binsudo mv qemu qemu-spice

So far, the server has been installed.



4. Use spice4.1 to use Client

To invoke the spice client, use the command: Call the client, use the following command

Note: <Server Hostname> is the server address. If your computer is installed with the client server, you can use 127.0.0.1 to test it yourself. <port number> is the port number specified by the server.

spicec -h <server hostname> -p <port number>
4.2 Use Server

Invoking the spice server is rather more complex than the client, since you have to set the parameters of the specified alized guest. For example,

Calling the server is much more troublesome than the client.

qemu-spice -spice port=5930,disable-ticketing -drive file=/path/to/image -vga qxl -device AC97 -usbdevice tablet -m 1024 -enable-kvm -net nic -net user 

Note: replace file =/path/to/image with the system's image file, for example, my file =/KVM/vdisk. img


In this way, the spice server is started and client commands are used on the client.

spicec -h <server hostname> -p <port number>

You can start the Virtual Machine System on the spice client.


------- Good luck ------------- Yaung

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.