virt-manager spice spicec
来源:互联网 发布:java utf8转gbk 编辑:程序博客网 时间:2024/05/26 19:16
virt-manager是libvirt的一个图形客户端,而libvirt是个通用的虚拟机管理库(支持kvm、xen、virtualbox、vmware等等)。virsh是libvirt的命令行客户端,用“virsh -c qemu:///system”可以在命令行管理virt-manager创建的虚拟机。
需要先在系统启动一个桥接网卡,才能在虚拟机里装bridged网卡。修改/etc/network/interfaces(debian)如下:
# Replace "auto eth0 ..." with following lines in /etc/network/interfaces# The primary network interfaceauto br0iface br0 inet staticaddress xxx.xxx.xxx.xxxnetmask xxx.xxx.xxx.xxxnetwork xxx.xxx.xxx.xxxbroadcast xxx.xxx.xxx.xxxgateway xxx.xxx.xxx.xxx# dns-* options are implemented by the resolvconf package, if installeddns-nameservers xxx.xxx.xxx.xxxdns-search domain.namebridge_ports eth0bridge_stp offbridge_maxwait 0bridge_fd 0
Windows 7最多只支持两个CPU socket,每个socket内可以有多个core。kvm缺省每个CPU模拟一个socket,必须修改虚拟机CPU的topology,才能使用超过一个CPU。
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后桌面会有“测试模式”字样,不影响使用):
bcdedit.exe -set loadoptions DDISABLE_INTEGRITY_CHECKSbcdedit.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
#!/bin/bashSERVER_KEY=server-key.pem# creating a key for our caif [ ! -e ca-key.pem ]; thenopenssl genrsa -des3 -out ca-key.pem 1024fi# creating a caif [ ! -e ca-cert.pem ]; thenopenssl 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 keyif [ ! -e $SERVER_KEY ]; thenopenssl genrsa -out $SERVER_KEY 1024fi# create a certificate signing request (csr)if [ ! -e server-key.csr ]; thenopenssl 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 caif [ ! -e server-cert.pem ]; thenopenssl x509 -req -days 1095 -in server-key.csr -CA ca-cert.pem -CAkey ca-key.pem -set_serial 01 -out server-cert.pemfi# now create a key that doesn't require a passphraseopenssl rsa -in $SERVER_KEY -out $SERVER_KEY.insecuremv $SERVER_KEY $SERVER_KEY.securemv $SERVER_KEY.insecure $SERVER_KEY# show the results (no other effect)openssl rsa -noout -text -in $SERVER_KEYopenssl rsa -noout -text -in ca-key.pemopenssl req -noout -text -in server-key.csropenssl x509 -noout -text -in server-cert.pemopenssl x509 -noout -text -in ca-cert.pem# copy *.pem file to /etc/pki/libvirt-spiceif [[ ! -d "/etc/pki/libvirt-spice" ]]thenmkdir -p /etc/pki/libvirt-spiceficp ./*.pem /etc/pki/libvirt-spice# echo --host-subjectecho "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"
根据提示记住–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”连接
其它
虚拟机硬件配置很容易调整,导致Windows激活经常失效。在线激活失败时,选电话激活,根据提示打电话,跟客服mm稍加解释,就能顺利激活了。(此条只对正版Windows有效)
主要参考
- SSLConnection – Spice
- QA:Testcase Virtualization Manually set spice listening port with TLS port set
- WinQXL – Spice
- Networking – KVM
- manpages
- virt-manager spice spicec
- 使用 spice-guest-tools 让虚拟机支持spicec 双屏显示
- virt-manager manage VM
- 手动安装 virt-manager
- 手动安装 virt-manager
- virt-manager and qemu
- virt-manager 管理配置
- libvirt virt-manager
- mac virt-manager
- 使用qemu和virt-manager
- 安装KVM监控virt-manager
- 利用virt-manager安装虚拟机
- Virt-manager虚拟机键盘错乱
- root无法启动virt-manager
- virt-manager安装xp.iso
- Bridged Networking with Virt-Manager 0.8.3
- Using bridged networking with Virt-manager
- virt-manager的虚拟资源中心
- URLConnection的学习笔记
- Python中numpy中asarray
- NSFetchedResultsController bug:have no insertion
- 符号扩展指令
- heapsort
- virt-manager spice spicec
- 算法8-9:Dijkstra算法
- 测试新浪微博@小冰 为代码机器人的一些方法
- Math常用方法
- 增加DataWindow .Net控件到Microsoft Visual Studio 工具箱的办法
- 安全的网络通道——网络准入之三层准入
- vb format函数
- 生产消费者模式
- 网页中的信息排序信息显示