载入中。。。 'S bLog
 
载入中。。。
 
载入中。。。
载入中。。。
载入中。。。
载入中。。。
载入中。。。
 
填写您的邮件地址,订阅我们的精彩内容:


 
spice关于windows下最好的远程桌面
[ 2013/9/9 21:29:00 | By: 梦翔儿 ]
 

spice

virt-manager创建的虚拟机只要加了spice display,就可以用spice协议远程使用虚拟机的控制台。

Linux下的spice客户端叫spicec。

最重要的是Win7里必须安装spice的驱动和服务,才能让性能和功能达到最强。相关程序在这里下载:http://www.spice-space.org/download.html

qxl和virtio-serial驱动是必须安装的。如果安装时提示数字签名无效,驱动不生效,用管理员权限执行cmd.exe,运行下面两行命令并reboot(reboot后桌面会有“测试模式”字样,不影响使用):

12
bcdedit.exe -set loadoptions DDISABLE_INTEGRITY_CHECKS
bcdedit.exe -set TESTSIGNING ON

Windows guest agent服务也必须安装,才能同步剪贴板、屏幕分辨率。解开那个vdagent-xxxxx.zip,在管理员权限命令行执行“vdservice install”,然后reboot。

客户端加上–full-screen=auto-conf参数,就能全屏且同步分辨率了。Shift-F11切换全屏状态

spice性能确实比rdp好太多,看flash、gif基本不卡,视频音画基本同步,鼠标、键盘无延迟。最爽的,可以用招商银行大众版了!

安全的spice

spice缺省使用不安全连接。

用下面脚本创建必须的key

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
#!/bin/bash
 
SERVER_KEY=server-key.pem
 
# creating a key for our ca
if [ ! -e ca-key.pem ]; then
openssl genrsa -des3 -out ca-key.pem 1024
fi
# creating a ca
if [ ! -e ca-cert.pem ]; then
openssl req -new -x509 -days 1095 -key ca-key.pem -out ca-cert.pem -subj "/C=IL/L=Raanana/O=Red Hat/CN=my CA"
fi
# create server key
if [ ! -e $SERVER_KEY ]; then
openssl genrsa -out $SERVER_KEY 1024
fi
# create a certificate signing request (csr)
if [ ! -e server-key.csr ]; then
openssl req -new -key $SERVER_KEY -out server-key.csr -subj "/C=IL/L=Raanana/O=Red Hat/CN=my server"
fi
# signing our server certificate with this ca
if [ ! -e server-cert.pem ]; then
openssl x509 -req -days 1095 -in server-key.csr -CA ca-cert.pem -CAkey ca-key.pem -set_serial 01 -out server-cert.pem
fi
 
# now create a key that doesn't require a passphrase
openssl rsa -in $SERVER_KEY -out $SERVER_KEY.insecure
mv $SERVER_KEY $SERVER_KEY.secure
mv $SERVER_KEY.insecure $SERVER_KEY
 
# show the results (no other effect)
openssl rsa -noout -text -in $SERVER_KEY
openssl rsa -noout -text -in ca-key.pem
openssl req -noout -text -in server-key.csr
openssl x509 -noout -text -in server-cert.pem
openssl x509 -noout -text -in ca-cert.pem
 
# copy *.pem file to /etc/pki/libvirt-spice
if [[ ! -d "/etc/pki/libvirt-spice" ]]
then
mkdir -p /etc/pki/libvirt-spice
fi
cp ./*.pem /etc/pki/libvirt-spice
 
# echo --host-subject
echo "your --host-subject is" \"`openssl x509 -noout -text -in server-cert.pem | grep Subject: | cut -f 10- -d " "`\"
 
echo "copy ca-cert.pem to %APPDATA%\spicec\spice_truststore.pem or ~/.spice/spice_truststore.pem in your clients"
view rawkeygen.sh hosted with ? by GitHub

根据提示记住–host-subject,拷贝ca-cert.pem到指定位置

关闭虚拟机,重新启动libvirtd(sudo /etc/init.d/libvirt-bin restart)

客户端用“spicec -h HOSTNAME -s TLS-PORT –host-subject HOST-SUBJECT -w PASSWORD”连接

http://blog.sunner.cn/kvm-spice-windows-7-notes/

========

根据的Yitao Jiang的方法在centos上实验了下,已安装成功可以运行

实验环境:centos 6.3
openstack:G-2013.1.3
libvirt:0.10.2
qemu:0.15.0
spice-server:0.12.0

1.部署openstack


2.安装websockify
git clone https://github.com/kanaka/websockify.git
cd websockify
python setup.py install

or

pip install websockify

3.安装spice
需要libvirt版本0.9.4-23或更高
实验环境:libvirt-0.10.2、qemu-0.15.0

yum install spice-server spice-client spice-protocol

如果主机有完整的图像界面,可以继续安装以下:

yum install cairo-spice ffmpeg-spice-libs ngspice pixman-spice spice-glib spice-gtk spice-gtk-python spice-gtk-tools spice-xpi

4.安装spice-html5
http://cgit.freedesktop.org/spice/spice-html5

wget http://cgit.freedesktop.org/spice/spice-html5/snapshot/spice-html5-0.1.3.tar.gz
tar xf spice-html5-0.1.3.tar.gz
cd spice-html5-0.1.3
cp apache.conf.sample /etc/httpd/conf.d/spice.conf
cd ..
cp -r spice-html5-0.1.3 /usr/share/spice-html5

检查/ect/httpd/conf.d/spice.conf文件
cat /etc/httpd/conf.d/spice.conf
#
# spice-html5 is a Javascript SPICE client
#
Alias /spice /usr/share/spice-html5
<Directory /usr/share/spice-html5>
    # This page is broadly available, tune here to make it more restricted.
    Allow from all
    Satisfy Any
    DirectoryIndex spice.html
</Directory>

5.创建启动脚本
/etc/init.d/openstack-nova-spicehtml5proxy

6.修改nova.conf

增加
[spice]
agent_enabled=True
enabled=True
html5proxy_base_url=http://<;your host ip>:6082/spice_auto.html
server_listen=0.0.0.0
server_proxyclient_address=<your host ip>
keymap=en-us

注意:
需要关闭vnc
novnc_enabled=False
不然创建虚拟机会失败,libvirt报错:
libvirtError: internal error ifname "tape63a3e58-bf" not in key map

7.启动进程
/etc/init.d/httpd restart
/etc/init.d/openstack-nova-spicehtml5proxy start
 
from:china-openstack-user-group 
 
 
  • 标签:spice 远程桌面 
  • 发表评论:
    载入中。。。

     
     
     

    梦翔儿网站 梦飞翔的地方 http://www.dreamflier.net
    中华人民共和国信息产业部TCP/IP系统 备案序号:辽ICP备09000550号

    Powered by Oblog.