参考文章:
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/libcacard2 cd libcacard3 ./autogen.sh4 make5 sudo make install6 cd ..
spice-protocol
1 wget http://spice-space.org/download/releases/spice-protocol-0.8.0.tar.bz22 tar xjvf spice-protocol-0.8.0.tar.bz23 cd spice-protocol-0.8.04 mkdir m45 ./configure6 make7 sudo make install8 cd ..
celt
1 wget http://downloads.us.xiph.org/releases/celt/celt-0.5.1.3.tar.gz2 tar xvzf celt-0.5.1.3.tar.gz3 cd celt-0.5.1.3/4 ./configure5 make6 sudo make install7 cd ..
3: spice-gtk安装
1 wget http://spice-space.org/download/releases/spice-0.8.1.tar.bz22 tar xjvf spice-0.8.1.tar.bz23 cd spice-0.8.14 ./configure --enable-smartcard5 make6 sudo make install7 cd ..
4:服务端 搭建spice
参考文章:
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 line3 /lib/libpthread.so.0: could not read symbols: Invalid operation4 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.so2 ln -s libcacard.so.0.0.0 /usr/lib/libcacard.so.0
之后如果仍然找不到libcacard.so.0文件,则修改 /etc/ld.so.conf
添加
1 include /usr/local/lib3 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