SPICE server requires 64-bit system. Make sure you are running Oneiric x86_64.
1. Remove AppArmor
$ sudo invoke-rc.d apparmor stop $ sudo update-rc.d -f apparmor remove $ sudo apt-get autoremove --purge apparmor $ sudo reboot
After the machine is rebooted, you can check if there are configurations or data folders not deleted automatically, if yes, you can delete them safely, for example:
$ cd /etc $ sudo rm -fr apparmor*
2. Configure Bridge (optional)
This step is only required when you want to provide ethernet bridging for VMs.
First of all, bridging tool needs to be installed:
$ sudo apt-get install bridge-utils
By default, Ubuntu uses NetworkManager to configure network devices automatically. But here we need to edit the configuration file manually to add bridging settings:
$ sudo vi /etc/network/interfaces
auto lo
iface lo inet loopbackauto eth0
iface eth0 inet manualauto br0
iface br0 inet static
address 192.168.96.88
netmask 255.255.255.0
network 192.168.96.0
broadcast 192.168.96.255
gateway 192.168.96.1
bridge_ports eth0
bridge_stp off
bridge_fd 0
bridge_maxwait 0
If your machine is using DHCP for IP configuration, change the third section (device br0) to:
auto br0
iface br0 inet dhcp
bridge_ports eth0
bridge_stp off
bridge_fd 0
bridge_maxwait 0
Save your configuration file, and restart network to take effect:
$ sudo invoke-rc.d networking stop $ sudo invoke-rc.d networking start
Or, if you are working remotely, stopping network will disconnect you to the machine, just do reboot machine alternatively.
After restarted network or rebooted machine, use ifconfig and brctl show to check if ethernet briding works as expected.
$ brctl show
bridge name bridge id STP enabled interfaces
br0 8000.5c63bf86e499 no eth03. Install KVM and SPICE packages
The qemu-kvm version in Oneiric is 0.14, but Ubuntu’s compilation does not include SPICE support. We have to use another repository which has compiled qemu-kvm with SPICE support.
$ sudo apt-add-repository ppa:bderzhavets/qemu-git $ sudo apt-get update
I don’t know if there are the other repositories better than the above found in Ubuntu wiki. But at least it works.
Install:
$ sudo apt-get install qemu-kvm virt-manager spice libspice-server
After installed the packages, your Oneiric is ready to run VM with SPICE support. Refer to another post to learn how to install guest with SPICE support.
> sudo apt-add-repository ppa:bderzhavets/qemu-git
Yes , it works. But I would suggest you consider two my others PPAs
1. Qemu-kvm 0.15.1 & Spice USB Redirection support for Ubuntu Oneiric
https://launchpad.net/~bderzhavets/+archive/0151-usbredir
2. Qemu&Spice USB Redirection with back ported Libvirt 0.9.6 , new seabios 1.6.3 for Ubuntu Oneiric
https://launchpad.net/~bderzhavets/+archive/seabios163
I pointed to this PPAs in Ubuntu Wiki
@bderzhavets
Thanks for these great repos. They help a lot!
You may find this helpful
http://bderzhavets.wordpress.com/2011/10/16/set-up-qemuspicelibvirt-0-9-6-usb-redirection-on-ubuntu-11-10/
I remember the picture. Would like to suggest you one more link :-
https://launchpad.net/~bderzhavets/+archive/xen-next9
It should be soon in Debian Unstable, but I expect them to skip pygrub gpt support
back port.
为什么要卸载了AppArmor?
是不是会出现访问控制等问题,如果是,修改配置就可以了,这样直接删了,会降低系统本来内置设定的安全性的。
@黑传说
我懒得修改 AppArmor 相关的配置了,就是偷懒而已
Pingback: QEMU-KVM with SPICE Support on Ubuntu 11.10 64-bit - qemu-kvm教程