参考文章:spice wiki
1: gtk+-3.0安装
2: 安装依赖
a:
1 sudo apt-get install build-essential autoconf git-core
b:
1 sudo apt-get install libtool liblog4cpp5-dev libavcodec-dev libssl-dev xlibmesa-glu-dev libasound-dev libpng12-dev libfreetype6-dev 2 libfontconfig1-dev libogg-dev libxrandr-dev kvm libgcrypt-dev libsdl-dev libnss3-dev libpixman-1-dev libxfixes-dev libjpeg8-dev 3 libsasl2-dev python-pyparsing
c: 其他包
libcacard
1 git clone git://people.freedesktop.org/~alon/libcacard 2 cd libcacard 3 ./autogen.sh 4 make 5 sudo make install 6 cd ..
spice-protocol
1 wget http://spice-space.org/download/releases/spice-protocol-0.8.0.tar.bz2 2 tar xjvf spice-protocol-0.8.0.tar.bz2 3 cd spice-protocol-0.8.0 4 mkdir m4 5 ./configure 6 make 7 sudo make install 8 cd ..
celt
1 wget http://downloads.us.xiph.org/releases/celt/celt-0.5.1.3.tar.gz 2 tar xvzf celt-0.5.1.3.tar.gz 3 cd celt-0.5.1.3/ 4 ./configure 5 make 6 sudo make install 7 cd ..
3: spice-gtk安装
1 wget http://spice-space.org/download/releases/spice-0.8.1.tar.bz2 2 tar xjvf spice-0.8.1.tar.bz2 3 cd spice-0.8.1 4 ./configure --enable-smartcard 5 make 6 sudo make install 7 cd ..
4:服务端 搭建spice
参考文章: kvm server搭建
5:出现的问题
a:编译libcacard时出现
1 /usr/bin/ld: main.o: undefined reference to symbol 'pthread_create@@GLIBC_2.1' 2 /usr/bin/ld: note: 'pthread_create@@GLIBC_2.1' is defined in DSO /lib/libpthread.so.0 so try adding it to the linker command line 3 /lib/libpthread.so.0: could not read symbols: Invalid operation 4 collect2: ld returned 1 exit status
解决方法: sudo CFLAGS='-lpthread' ./configure
b:运行spicy -h localhost -p 5900 出现libcacard.so.0 no such file or directory 。
找到libcacard.so.0文件后,发现在/usr/local/lib文件夹下,之后建立两个链接文件
在/usr/local/lib目录下 执行一下命令:
1 ln -s libcacard.so.0.0.0 /usr/lib/libcacard.so 2 ln -s libcacard.so.0.0.0 /usr/lib/libcacard.so.0
之后如果仍然找不到libcacard.so.0文件,则修改 /etc/ld.so.conf
添加
1 include /usr/local/lib 3 include /usr/lib
c: 运行 spicy -h ip地址 -p 端口号,每次都是弹出对话框,但是spicy -h localhost -p 端口号 就可以。
在服务端修改/etc/libvirt/qemu.conf文件
找到spice_listen="0.0.0.0",将前面#号去掉。
d:virt-manager运行时每次都出现authentication 对话框。或者virsh运行时只能在root权限下才出现结果
在服务端修改/etc/libvirt/libvirtd.conf,找到auth_unix_ro和auth_unix_rw,将前面的#号去掉。
找到unix_sock_rw_perms和unix_sock_ro_perms,都设置为0777