Set up KVM/QEMU/SPICE on Ubuntu 11.04
2011-05-26 09:58
603 查看
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 :-
Install packages from PPA on your system :-
Verify install via “dpkg -l” :
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 :-
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
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
Now disable AppArmor profile for libvirtd :-
Next step
Invoke virt-manager with option "Import Existing Image"
and update XML definition of W7 as follows.
Run
# virsh define W7.xml
Now start domain via Virt-Manger :-
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
Add new repository to system :-
# add-apt-repository ppa:serge-hallyn/spice2 # apt-get update
Install packages from PPA on your system :-
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 :-
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
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
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"
and update XML definition of W7 as follows.
<domain type='kvm'> <name>W7</name> <memory>2097152</memory> <currentMemory>2097152</currentMemory> <vcpu>2</vcpu> <os> <type arch='x86_64' machine='pc-0.14'>hvm</type> <boot dev='hd'/> </os> <features> <acpi/> <apic/> <pae/> </features> <clock offset='localtime'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <devices> <emulator>/usr/bin/kvm</emulator> <disk type='block' device='disk'> <driver name='qemu' type='raw' cache='none'/> <source dev='/dev/sdb7'/> <target dev='vda' bus='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </disk> <controller type='ide' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller> <interface type='bridge'> <mac address='52:54:00:7d:5d:dc'/> <source bridge='br0'/> <model type='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> <serial type='pty'> <target port='0'/> </serial> <console type='pty'> <target type='serial' port='0'/> </console> <input type='tablet' bus='usb'/> <input type='mouse' bus='ps2'/> <graphics type='spice' autoport='yes' listen='0.0.0.0'/> <sound model='ac97'> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </sound> <video> <model type='qxl' vram='32768' heads='1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> </memballoon> </devices> </domain>
Run
# virsh define W7.xml
Now start domain via Virt-Manger :-
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
相关文章推荐
- How To Set Up vsftpd on Ubuntu 12.04
- How To Set Up Database Replication In MySQL On Ubuntu
- How to set up Solr on Ubuntu 10.04 (or whatever)
- How To Set Up Nginx Server Blocks (Virtual Hosts) on Ubuntu 14.04 LTS
- Set up a svn server on a virtual ubuntu
- How To Set Up Apache Virtual Hosts on Ubuntu 14.04 LTS
- Set up of Qt/Embedded 4.5 on ubuntu 9.04----2
- How To Set Up a Firewall Using IPTables on Ubuntu 14.04
- How To Set Up Nginx Server Blocks (Virtual Hosts) on Ubuntu
- Set up start development environment on ubuntu-12.04.1
- How To Set Up HTTP Authentication With Nginx On Ubuntu 12.10
- How to Set Up Apache Virtual Hosts on Ubuntu 12.04 LTS
- How to Set Up vsftpd on Ubuntu 12.04
- Set Up Highcharts Export Server On Ubuntu Server 12.04: Step by Step
- Set up git server on ubuntu using ssh protocol(已经测试可以)
- How To Set Up a Private Docker Registry on Ubuntu 14.04
- How to set up an FTP server on Ubuntu 14.04