设为首页 收藏本站
查看: 1231|回复: 0

[经验分享] Set up KVM/QEMU/SPICE on Ubuntu 11.04

[复制链接]

尚未签到

发表于 2015-4-10 13:43:43 | 显示全部楼层 |阅读模式
  Packages installed via ppa:serge-hallyn/spice2 have been tested for F14, W7 KVMs installs and runtime. Package qemu-kvm-spice (0.14.0+noroms-0ubuntu4qxl2) is based on the most recent RH’s QXL patches sets for qemu-kvm-0.14.tar.gz. Disabling AppArmor’s profile for libvirtd allows to manage and create domains via virt-manager 0.8.6-1 installed on Ubuntu Natty Narwhal. However, first domain install with option “-spice port=5900,disable-ticketing -vga qxl” has been been performed via qemu-kvm command line keeping original restrictions in place.
Add new repository to system :-

# add-apt-repository ppa:serge-hallyn/spice2
# apt-get update

Install packages from PPA on your system :-
http://bderzhavets.files.wordpress.com/2011/04/shppa-installed.png?w=450&h=360
Verify install via “dpkg -l” :

root@boris-System-P5Q3:~# dpkg -l |grep spice
ii libspice-client 0.6-0ubuntu1 Spice GTK+ Library
ii libspice-client-dev 0.6-0ubuntu1 Spice GTK+ Library (development files)
ii libspice-server 0.8.1-0ubuntu1 Spice Server-Side Library
ii libspice-server-dev 0.8.1-0ubuntu1 Spice Server-Side Library (development files)
ii qemu-kvm-spice 0.14.0+noroms-0ubuntu4qxl2 Full virtualization on i386 and amd64 hardware
ii spice 0.8.1-0ubuntu1 Spice Client
ii spice-protocol-dev 0.8.0-0ubuntu1 SPICE protocol headers

AppArmor’s restriction for libvirtd profile on Natty Narwhal brings us initially to qemu-kvm command line installation.
Open terminal session and issue :-
/usr/bin/kvm-spice -cpu host -enable-kvm \
-name W7 -m 2048 \
-drive file=/dev/sdb7,if=virtio,media=disk,aio=native,cache=off \
-drive file=/usr/tmp/virtio-win-1.1.16.vfd,if=floppy \
-net nic,model=rtl8139 -net user -localtime \
-usb -vga qxl -spice port=5900,disable-ticketing \
-cdrom /usr/tmp/Win7_64.iso -boot d
Connect to console via “spicec -h localhost -p 5900″ and proceed with install :-
http://bderzhavets.files.wordpress.com/2011/04/w7-1.png?w=450&h=360
http://bderzhavets.files.wordpress.com/2011/04/w7-2.png?w=450&h=360
http://bderzhavets.files.wordpress.com/2011/04/w7-3.png?w=450&h=360
When done load W7 KVM as follows :-
/usr/bin/kvm-spice -cpu host -enable-kvm \
-name W7 -m 2048 \
-drive file=/dev/sdb7,if=virtio,media=disk,aio=native,cache=off \
-net nic,model=virtio -net user -localtime \
-usb -vga qxl -spice port=5900,disable-ticketing \
-cdrom /usr/tmp/virtio-win-1.1.16.iso
and set up VirtIO Net Driver
http://bderzhavets.files.wordpress.com/2011/04/w7-5.png?w=450&h=360

Finally runtime command line will look like :-
/usr/bin/kvm-spice -cpu host -enable-kvm \
-name W7 -m 2048 \
-drive file=/dev/sdb7,if=virtio,media=disk,aio=native,cache=off \
-net nic,model=virtio -net user -localtime \
-usb -vga qxl -spice port=5900,disable-ticketing
http://bderzhavets.files.wordpress.com/2011/04/finalrun.png?w=450&h=360
Now disable AppArmor profile for libvirtd :-

# ln -s /etc/apparmor.d/usr.sbin.libvirtd /etc/apparmor.d/disable/
# apparmor_parser -R /etc/apparmor.d/usr.sbin.libvirtd
# reboot

Next step

# cd /usr/bin
# cp qemu-system-x86_64-spice qemu-system-x86_64
# cp qemu-x86_64-spice qemu-x86_64

Invoke virt-manager with option "Import Existing Image"
http://bderzhavets.files.wordpress.com/2011/04/importexistingimage.png?w=450&h=360
and update XML definition of W7 as follows.


W7
2097152
2097152
2

hvm








destroy
restart
restart

/usr/bin/kvm





































Run
# virsh define W7.xml
Now start domain via Virt-Manger :-
http://bderzhavets.files.wordpress.com/2011/04/libv1.png?w=450&h=360
http://bderzhavets.files.wordpress.com/2011/04/libv2.png?w=450&h=360
Actually at this point domains may be created in VNC mode via virt-manager 0.8.6-1. SPICE Server activated invoking "Add Hardware" wizard -> "Graphics->Spice Server , previously removing VNC Server. Switching domain to "QXL" mode is also possible via virt-manager.
  References
1. https://launchpad.net/~serge-hallyn/+archive/spice2

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.iyunv.com/thread-55695-1-1.html 上篇帖子: Qemu创建KVM虚拟机内存初始化流程 下篇帖子: [转] KVM Internals, code and more
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表