`

SPICE在ubuntu上的实现

    博客分类:
  • VDI
阅读更多
SPICE在ubuntu上的实现

SPICE的安装过程,参照:http://docs.cslabs.clarkson.edu/wiki/SPICE的介绍,依赖包中。应该另外安装libjpeg-dev包。
Overview

SPICE is a protocol that allows for high-quality virtual machine access using VDI over a network. It could be used as a communication layer between thin clients and their associated virtualized operating systems, or it could be used as it is in the COSI lab for normal machines to have quick access to a variety of different operating systems, or in any other configuration where it is better for a virtual machine to be running remotely.
SPICE on Ubuntu

As SPICE is under development by Red Hat, binary packages are rpm-based. However, it is possible to run both the SPICE server and client on 64-bit Ubuntu machines, if they are compiled from source. There are several dependencies that must be installed before SPICE can be compiled; dependencies not already available in the standard Ubuntu repositories must also be compiled from source. Please follow the instructions below to compile the SPICE server and client.

These instructions are for installing SPICE 0.6 on 64-bit Ubuntu 10.04. It is not possible to install a SPICE server on any 32-bit system due to its reliance on 64-bit atomic operations, and the process for installing just the client on 32-bit systems no longer appears to be supported.

Please direct comments or questions about this guide to Mark Platek.
Initial set-up

Some standard tools are required:

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

Also, install some dependencies from the repositories:

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

Finally, create a directory to compile from and descend into it:

mkdir spice-sources
cd spice-sources

Installing Dependencies
Spice protocol headers

The first dependency to install is the spice protocol headers.

wget http://spice-space.org/download/releases/spice-protocol-0.6.0.tar.gz
tar xvf spice-protocol-0.6.0.tar.gz
cd spice-protocol-0.6.0/
./configure
make
sudo make install
cd ..

qpixman and pixman

SPICE requires a special version of pixman unavailable in the Ubuntu repositories. It is available from the SPICE homepage.

wget http://spice-space.org/download/stable/qpixman-0.13.3-git20090127.tar.bz2
tar xvf qpixman-0.13.3-git20090127.tar.bz2
cd qpixman-0.13.3-git20090127/
./autogen.sh -includedir=/usr/include --libdir=/usr/lib64
make
sudo make install
cd ..

We must also install a newer version of the normal pixman library, available from the SPICE project's git repository.

git clone git://anongit.freedesktop.org/pixman
cd pixman/
./autogen.sh --includedir=/usr/include --libdir=/usr/lib64
make
sudo make install
cd ..

celt

SPICE requires a specific version of the celt 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.gz
tar xvf celt-0.5.1.3.tar.gz
cd celt-0.5.1.3/
./configure --includedir=/usr/include --libdir=/usr/lib64
make
sudo make install
cd ..

qcairo

SPICE requires a modified version of the cairo graphics library, named qcairo. Sources are available on the spice homepage.

wget http://spice-space.org/download/stable/qcairo-1.8.7.1-git74d6b5.tar.bz2
tar xvf qcairo-1.8.7.1-git74d6b5.tar.bz2
cd qcairo-1.8.7.1-git74d6b5/
./autogen.sh --disable-xlib --disable-ps --disable-pdf --disable-svg --includedir=/usr/include --libdir=/usr/lib64
make
sudo make install
cd ..

Installing SPICE
libspice and the SPICE client

Finally, all of the dependencies are satisfied and we can install the SPICE server. It comes in two parts: one part is libspice (we will later compile a new version of qemu with spice support to use it), and the other is the spice client. They are both installed at the same time.

NOTE: This section can only be performed on a 64-bit system! Client-only installation on a 32-bit system no longer appears to be supported.

wget http://spice-space.org/download/releases/spice-0.6.0.tar.gz
tar xf spice-0.6.0.tar.gz
cd spice-0.6.0/
./configure --includedir=/usr/include --libdir=/usr/lib64
make
sudo make install
cd ..

"Spiced" QEMU

Support for SPICE 0.6 is currently included in a late 0.13 release of QEMU, we will install that version now. We will be installing this "spiced" QEMU alongside the system QEMU, so make sure you perform the installation in some permanent location. I chose /opt/qemu-spice, but you can do it wherever you want.

Note that we must switch to a branch of the qemu git tree - v19 is the latest branch at time of writing (2010-09-23). According to theSPICE documentation the branch number is in flux and is subject to change.

This whole subsection should be done as root, to avoid exposing /opt to ordinary users. If you don't want to work as root, prepend each command with sudo.

cd /opt
mkdir qemu-spice
cd qemu-spice/
git clone git://git.freedesktop.org/git/spice/qemu
cd qemu/
git checkout -b spice.v19 origin/spice.v19

Now we have to change the configure script to not set the -Werror CFLAG. This is dangerous, but I couldn't get qemu to compile without forcing the configure script to not set it. Open the configure script in your favorite editor and find the part that looks like:

if test "$werror" = "yes" ; then
    QEMU_CFLAGS="-Werror $QEMU_CFLAGS"
fi

Change it to remove the -Werror, like so:

if test "$werror" = "yes" ; then
    QEMU_CFLAGS="$QEMU_CFLAGS"
fi

Now, run the configure script and make QEMU. Please note that compiling QEMU in this way will enable it to emulate only a 64-bit host; add extra targets if you need other architectures.

./configure --target-list=x86_64-softmmu --enable-spice --enable-io-thread
make

QEMU needs certain BIOS files to be able to start SPICE VMs, so we have to copy them to a location QEMU expects to find them.

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

Spiced QEMU is now available, the executable is located at /opt/qemu-spice/qemu/x86_64-softmmu/qemu-system-x86_64. Make a symlink for convenient invocation:

ln -s /opt/qemu-spice/qemu/x86_64-softmmu/qemu-system-x86_64 /usr/sbin/qemu-spice

And that's it! You can invoke qemu-spice with the argument "-spice" to start a SPICE server. As soon as QEMU 0.14 is released, however, you can use the QEMU package available in the Ubuntu repositories instead, since it will include SPICE support by default.
Appendix: Ubuntu SPICE PPA

In past revisions of this page, Adam J. Lincoln's PPA containing debian packages for qcairo, qpixman, etc. and the spice client was mentioned. It no longer appears to be actively maintained, and almost certainly carries an old, incompatible version of SPICE (0.4). If you wish to use SPICE, please compile it from source using the method described above
How To Use SPICE
Client

To invoke the spice client, use the command

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

Server

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

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

will start a SPICE server VM on port 5930 from the image at the supplied path, with:

    qxl graphics (you need this for spice to be of any use)
    an AC97 sound device
    a tablet input device (using a virtualized tablet generally gives better results than a virtualized mouse)
    1024M of memory available
    KVM support enabled (you really want this, as the guest is quite slow otherwise)
    a user-controllable virtualized nic

It is also possible to use virtio if your system supports it; doing so will lead to significant performance gains for the guest. Modify the-drive argument like so:

-drive file=/path/to/image,if=virtio

And, modify the -net argument like so:

-net nic,model=virtio

When a SPICE server is started, its virtual guest boots and at any point until the guest is shut down a client can connect to and interact with the guest.
Special instructions for using a Windows guest

SPICE aims to provide a high-quality interface between the remote client and the guest VM. To this end, a SPICE-specific Windows driver has been written to enable smooth operation of the mouse, eliminating the "choppiness" that has before been a problem when running an XP guest. When you boot the SPICE Windows guest, follow these instructions to enable it. Note that you must start the guest with option -vga qxl in order for the mouse driver to work.
分享到:
评论

相关推荐

    spice-protocol,spice-gtk从0编译说明文档并实现桌面虚拟化访问

    在本文档中,我们将深入探讨Spice协议的编译环境搭建以及使用Spice-GTK实现桌面虚拟化访问。 **1. Spice 协议详解** Spice协议由多种组件构成,包括代理、客户端和服务器端。它支持多种传输层协议,如TCP和TLS,...

    QEMU+SPICE+USBredir详细编译步骤

    本文将详细介绍如何在 Linux 系统(包括 CentOS、Ubuntu 等)下编译 QEMU 和 SPICE 协议,使其支持 USB 重定向。 一、编译 libusb libusb 是一个开源的 USB 库,提供了访问 USB 设备的功能。要编译 libusb,首先...

    code_python实现_pythonspice_python实现spice_简易spice仿真工具_源码

    - **tran仿真**:时域瞬态仿真,模拟电路在时间上的动态行为,通常用于分析脉冲响应、启动过程等。 3. **PythonSPICE的实现细节** PythonSPICE可能包括以下组件: - **语法解析器**:解析用户提供的SPICE语法的...

    手把手教你安装配置spice服务

    在OpenStack中,Spice作为一个组件,允许管理员和用户通过网络连接到虚拟机,实现远程桌面操作。 在OpenStack环境中配置Spice服务,主要涉及以下几个步骤: 1. **安装Spice服务器和客户端组件**: 在服务器端,你...

    xen虚拟机对spice的支持

    在虚拟化技术领域,Xen是一款非常知名的开源虚拟机软件,它允许在同一台物理服务器上运行多个操作系统实例,实现资源的高效利用。Xen 4.4版本引入了一个重要的更新,即对SPICE(Simple Protocol for Independent ...

    SSSR3.m.zip_DOA_SPICE algorithm_spice_spice DOA_spice doa

    "SPICE"在这里可能是两个含义:一是作为算法名称的一部分,二是指仿真程序套件SPICE(Simulation Program with Integrated Circuit Emphasis),它在电子电路设计中广泛使用。然而,在这个上下文中,"SPICE"更可能指...

    SPICE模型参数介绍

    SPICE模型参数使设计人员能够在计算机上对电路进行仿真,以此来预测电路在不同条件下的行为,而无需搭建实际的电路。SPICE模型参数的介绍通常包括各种基本元件的参数设置以及它们在SPICE语法中的表示方法。 标题...

    spice协议实现源码

    SPICE (Simple Protocol for Independent Computing Environment)协议的C语言详细定义。

    spice-gtk-0.20

    spice 客户端 用于spicy远程链接,编译时,可支持USB重定向支持

    spice-gtk编译后程序

    4. **多平台支持**:由于 `spice-gtk` 是跨平台的,因此它可以在多种操作系统上运行,如 Linux、Windows 和 macOS。这使得基于 `spice-gtk` 的应用具有广泛的兼容性和可移植性。 **编译过程** 编译 `spice-gtk` ...

    Spice安装和使用_spice_

    2. **教程和示例**: 初学者可以通过网络上的教程和实例学习,例如"Spice安装和使用.ppt"提供的内容。 3. **社区论坛**: 加入SPICE用户社区,提问和解答问题,获取实践经验。 总之,掌握SPICE是电子工程师的基本...

    spice Windows客户端

    **Windows版SPICE客户端**是专为在Windows操作系统上运行而设计的,它使得Windows用户能够无缝地访问和操作基于SPICE服务器的虚拟机。这个客户端提供了与远程虚拟机的图形界面交互的能力,包括键盘输入、鼠标操作、...

    Automotive-SPICE-PAM-30-翻译版_spice_pam_spice_汽车A-SPICE_Automotive

    pam"指的是SPICE的过程评估模型,"spice"一般指Software Process Improvement and Capability dEtermination(软件过程改进和能力鉴定),"汽车A-SPICE"和"AutomotiveSPICE"都指向了汽车行业特有的SPICE实现,而...

    在pspice中如何使用厂家提供的spice模型(1).pdf

    在 PSPICE 中使用厂家提供的 SPICE 模型 在 Cadence PSPICE 中使用厂家提供的 SPICE 模型是一种非常常见的仿真方法,尤其是在电子器件日新月异,更新非常快的情况下。通常,我们需要从元器件的生产厂家获取 SPICE ...

    LM386 SPICE模型 兼容Multisim

    .sym文件则是在Multisim中表示元器件的符号文件,使得在电路图上可以清晰地识别出LM386。 对于LM386来说,其主要特点包括高增益(通常在20到200之间可调)、内置频率补偿和低电源电压要求(通常在4V到12V之间)。...

    WS_MOSFET_SPICE_REV7.zip_6123 ws_LTSIPCE_MOSFET SPICE模型_spice 模型

    7. **电路设计流程**: 在设计复杂电路时,SPICE模型是必不可少的,它们确保了从概念到实现的过渡尽可能顺利,减少了原型制作和测试的次数。 通过这些模型,工程师能够构建逼真的电路模型,测试不同条件下的性能,...

    Circuit Simpulation with SPICE OPUS

    8. 与其他电子设计自动化(EDA)工具的集成和协同工作,展示SPICE OPUS如何与其他设计工具配合,实现从设计到制造的流程。 9. 电路模拟在电子系统设计中的重要性,以及如何将其纳入到更广泛的工程设计和分析流程中...

    ADI公司芯片所有的spice模型

    ADI公司是全球知名的半导体制造商,其产品涵盖了模拟电路、混合信号和数字信号处理等领域。...在Multisim 11的支持下,用户可以方便地将这些模型导入并应用到自己的电路设计中,实现高效且精确的仿真。

    IR公司元器件SPICE模型

    这可以通过修改SPICE模型文件或者在电路原理图中直接设置元器件属性来实现。 4. 构建电路:在PSPICE环境中构建包含IR元器件的电路,确保正确连接并指定合适的电源、负载和其他外部元件。 5. 运行仿真:选择合适的...

    Spice用户指南和参考

    If you are generally unfamiliar with how to use Spice, or are not familiar with all of its features then Chapter 2 and Chapter 3 are provided to get you started. The aim in Chapter 2 is just to help ...

Global site tag (gtag.js) - Google Analytics