Virtualization Technology Learning (2) SPICE configuration under Unbuntu

Source: Internet
Author: User

Virtualization Technology Learning (2) SPICE configuration under Unbuntu

Recently has been engaged in spice, installed on the cost of my long time, on the Internet to see some of the other's tutorials are said to refer to the official tutorial http://docs.cslabs.clarkson.edu/wiki/SPICE but into the tutorial to see, found that the content has been deleted, after my unremitting efforts, I found a document translated from an official tutorial. http://www.verydemo.com/cj.jsp? C = 59 & u = ubuntu-xia-spice-de-an-zhuang-yu-pei-zhi

Then I followed the tutorial step by step to install, but there were always some errors in the middle, and finally I was not able to install them all. I am also a porter. take the steps above in some official tutorials.

 

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 the terminal machine that enjoys the service, and the server is the backend machine that provides the service.

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 libcacardThis 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. 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 celtSPICE 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 serverNow, 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 use ClientTo 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 on the client server at the same time, you can use 127.0.0.1 for your own test. <port number> is the port number specified by the server.
spicec -h <server hostname> -p <port number>
4.2 using ServerInvoking 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. File, such as my file =/kvm/vdisk. img

The above is the installation process in the tutorial.
After the above installation process, let's check which spice-related packages have been installed.
We enter
dpkg --get-selections | grep spice
Some content may not be installed properly. The following is all installed.


During the first installation, I found that many of the items were not properly installed. Then I directly used the sudo apt-get install command to install the packages that were not included.

Then we can install the Virtual Machine in kvm. refer to the previous blog http://blog.csdn.net/whjkm/article/details/40587955.

For more information about installing spice in kvm, see the next blog ~



 

Related Article

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.