Set up Ubuntu 11.04 ,10.10 KVM to run in spice session on Fedora 14 KVM Server ( Libvirt Preview Env)

March 19, 2011

The most recent patches to Fedora’s Qemu 0.14 went into qemu-0.14.0-6.fc14.src.rpm on 03/31/2011. Following bellow is brief description of F14 KVM and Spice Server set up via “Libvirt Preview” ( http://repos.fedorapeople.org/repos/jforbes/virt-preview/fedora-14/SRPMS/). Configured KVM Server allows to create Ubuntu 10.10, 11.04 Desktop KVM beta 1 (64 bit), which may run in spice session. Notice that Virt-Manager 0.8.7-2 does have SPICE support. It allows to switch particular VM from VNC Server to SPICE Server and run spice session via GUI or connect to VM via command line locally or remotely.
**********************************************************************************************************************************************
In this case Spice Display Screen will show address 127.0.0.1 and connections to VM via spicec will be available only locally.
To get spicec working remotely remove Display VNC and “Add hardware” Display Spice. It will show you address 0.0.0.0
In this case connections via spicec will be available remotely
***********************************************************************************************************************************************
Ubuntu 10.10 Desktop,11.04 Desktop KVM beta 1 require “apt-get update,apt-get upgrade” to run stable in SPICE session

Configure fedora-virt-preview.repo :-
[root@fedorakvm yum.repos.d]# cat fedora-virt-preview.repo

# Place this file in your /etc/yum.repos.d/ directory
[fedora-virt-preview]

name=Virtualization Preview Repository for Fedora 14 Users
baseurl=http://repos.fedorapeople.org/repos/jforbes/virt-preview/fedora-$releasever/$basearch/
enabled=1
skip_if_unavailable=1
gpgcheck=0

[fedora-virt-preview-source]
name=Virtualization Preview Repository for Fedora 14 Users – Source
baseurl=http://repos.fedorapeople.org/repos/jforbes/virt-preview/fedora-$releasever/SRPMS
enabled=0
skip_if_unavailable=1
gpgcheck=0

Then run :-
# yum update

Make sure :-

[root@fedorakvm ~]# rpm -qa|grep virt
virt-manager-0.8.7-2.fc14.noarch
python-virtkey-0.50-8.fc14.x86_64
libvirt-client-0.8.8-2.fc14.x86_64
libvirt-0.8.8-2.fc14.x86_64
libvirt-python-0.8.8-2.fc14.x86_64
virt-viewer-0.3.1-1.fc14.x86_64
python-virtinst-0.500.6-1.fc14.noarch

[root@fedorakvm ~]# rpm -qa|grep qemu
qemu-system-x86-0.14.0-6.fc14.x86_64
qemu-kvm-0.14.0-6.fc14.x86_64
qemu-common-0.14.0-6.fc14.x86_64
qemu-img-0.14.0-6.fc14.x86_64
gpxe-roms-qemu-1.0.1-3.fc14.noarch

Install spice :-
# yum install spice-protocol spice-server spice-client

Make sure :-

# rpm -qa |grep spice
spice-server-devel-0.8.0-1.fc14.x86_64
spice-protocol-0.8.0-1.fc14.noarch
spice-gtk-python-0.5-1.fc14.x86_64
spice-client-0.8.0-1.fc14.x86_64
spice-glib-0.5-1.fc14.x86_64
spice-server-0.8.0-1.fc14.x86_64
spice-gtk-0.5-1.fc14.x86_64

Create via virt-manager Ubuntu 11.04 Desktop (betta 1) KVM and run :-

# apt-get update
# apt-get upgrade

Due to presence SPICE support in Virt-Manager 0.7.2 switch to SPICE DISPLAY and start SPICE session via Virt-Manager :-





Connection to VM via command line :-



Automatically generated XML profile :-

[root@fedora14sp ~]# virsh dumpxml Natty
<domain type='kvm' id='7'>
<name>Natty</name>
<uuid>18260de6-7958-046a-7bc6-cd5e6d15bff5</uuid>
<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='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/bin/qemu-kvm</emulator>
<disk type='block' device='disk'>
<driver name='qemu' type='raw'/>
<source dev='/dev/sda9'/>
<target dev='vda' bus='virtio'/>
<alias name='virtio-disk0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</disk>
<disk type='block' device='cdrom'>
<driver name='qemu' type='raw'/>
<target dev='hdc' bus='ide'/>
<readonly/>
<alias name='ide0-1-0'/>
<address type='drive' controller='0' bus='1' unit='0'/>
</disk>
<controller type='ide' index='0'>
<alias name='ide0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
</controller>
<interface type='bridge'>
<mac address='52:54:00:63:5d:a9'/>
<source bridge='br0'/>
<target dev='vnet0'/>
<model type='virtio'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<serial type='pty'>
<source path='/dev/pts/0'/>
<target port='0'/>
<alias name='serial0'/>
</serial>
<console type='pty' tty='/dev/pts/0'>
<source path='/dev/pts/0'/>
<target type='serial' port='0'/>
<alias name='serial0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='spice' port='5900' tlsPort='-1' autoport='yes' listen='0.0.0.0'/>
<sound model='ac97'>
<alias name='sound0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</sound>
<video>
<model type='cirrus' vram='9216' heads='1'/>
<alias name='video0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
<memballoon model='virtio'>
<alias name='balloon0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</memballoon>
</devices>
</domain>

Graphics section now looks like :-

<graphics type='spice' port='5900' tlsPort='-1' autoport='yes' listen='0.0.0.0'/>

Old way with modifying XML definition and connecting via command would work as well.
Create script /usr/tmp/qemu-spice :
cat /usr/tmp/qemu-spice
#!/bin/bash

exec /usr/bin/qemu-kvm $* \
-vga qxl \
-spice port=5930,disable-ticketing

# chmod 755 /usr/tmp/qemu-spice

and add to root’s .bashrc
export PATH=/usr/tmp:$PATH

Create via virt-manager Ubuntu 11.04 Desktop (alpha 3) KVM and install QXL driver via Synaptic manager. Say name of VM created is NATTY. Then run :-
# virsh dumpxml NATTY > Natty.xml
Edit XML file as follows

1. Change emulator to /usr/tmp/qemu-spice
2. Remove VIDEO section
3. Remove UUID section
4. Change VM’s name

[root@fedorakvm ~]# cat Natty.xml
<domain type='kvm'>
<name>NATSP</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='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/tmp/qemu-spice</emulator>
<disk type='block' device='disk'>
<driver name='qemu' type='raw'/>
<source dev='/dev/sdb6'/>
<target dev='vda' bus='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</disk>
<disk type='block' device='cdrom'>
<driver name='qemu' type='raw'/>
<target dev='hdc' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='1' unit='0'/>
</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:c5:81:45'/>
<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='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes'/>
<sound model='ac97'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</sound>
<memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</memballoon>
</devices>
</domain>

Run :-
# virsh define Natty.xml
and new NATSP entry in Virt-Manager will be created. Start NATSP and connect via
# spicec -h localhost -p 5930
to NATSP







Attempt of qemu-kvm-0.14 patching via Gerd’s Hoffmann “spice/qxl: locking fix for qemu-kvm” on F14

March 13, 2011

Following bellow is attempt to test mentioned patch to resolve problem with loading KVM with “-vga qxl” by /usr/bin/qemu-kvm (v. 0.14) on Fedora 14 ( Libvirt Preview Environment ) . View : http://patchwork.ozlabs.org/patch/84704/. Test was successful for SL6,F14,W2K3,W7 KVMs (without QXL driver installed) and failed on Ubuntu 10.10 KVM no matter of presence or absence of QXL driver.
Download corresponding SRC RPM :-
# wget http://repos.fedorapeople.org/repos/jforbes/virt-preview/fedora-14/SRPMS/qemu-0.14.0-2.fc14.src.rpm
Install it :-
# rpm -iv qemu-0.14.0-2.fc14.src.rpm
# cd
#cd rpmbuild/SPECS

Patch ../SOURCES/qemu-kvm-0.14.0.tar.gz via Gerd’s Hoffmann “spice/qxl: locking fix for qemu-kvm” .Then build

[root@fedora14 SPECS]# rpmbuild –with x86only -bb ./qemu.spec

*****************************
Remove old RPMS :-
*****************************
[root@fedora14 x86_64]# cat remove.sh
yum remove qemu-0.14.0-2.fc14.x86_64 \
qemu-common-0.14.0-2.fc14.x86_64 \
qemu-debuginfo-0.14.0-2.fc14.x86_64 \
qemu-img-0.14.0-2.fc14.x86_64 \
qemu-kvm-0.14.0-2.fc14.x86_64 \
qemu-kvm-tools-0.14.0-2.fc14.x86_64 \
qemu-system-x86-0.14.0-2.fc14.x86_64 \
qemu-user-0.14.0-2.fc14.x86_64
[root@fedora14 x86_64]# ./remove.sh
Removing:
qemu x86_64 2:0.14.0-2.fc14 @fedora-virt-preview 0.0
qemu-common x86_64 2:0.14.0-2.fc14 @fedora-virt-preview 767 k
qemu-img x86_64 2:0.14.0-2.fc14 @fedora-virt-preview 686 k
qemu-kvm x86_64 2:0.14.0-2.fc14 @fedora-virt-preview 0.0
qemu-system-x86 x86_64 2:0.14.0-2.fc14 @fedora-virt-preview 10 M
qemu-user x86_64 2:0.14.0-2.fc14 @fedora-virt-preview 33 M
Removing for dependencies:
libvirt x86_64 0.8.8-2.fc14 @fedora-virt-preview 2.8 M
qemu-system-arm x86_64 2:0.14.0-2.fc14 @fedora-virt-preview 3.2 M
qemu-system-cris x86_64 2:0.14.0-2.fc14 @fedora-virt-preview 1.6 M
qemu-system-m68k x86_64 2:0.14.0-2.fc14 @fedora-virt-preview 2.1 M
qemu-system-mips x86_64 2:0.14.0-2.fc14 @fedora-virt-preview 13 M
qemu-system-ppc x86_64 2:0.14.0-2.fc14 @fedora-virt-preview 12 M
qemu-system-sh4 x86_64 2:0.14.0-2.fc14 @fedora-virt-preview 4.1 M
qemu-system-sparc x86_64 2:0.14.0-2.fc14 @fedora-virt-preview 1.8 M

[root@fedora14 x86_64]# cat inst.sh
yum install qemu-0.14.0-2.fc14.x86_64.rpm \
qemu-common-0.14.0-2.fc14.x86_64.rpm \
qemu-debuginfo-0.14.0-2.fc14.x86_64.rpm \
qemu-img-0.14.0-2.fc14.x86_64.rpm \
qemu-kvm-0.14.0-2.fc14.x86_64.rpm \
qemu-kvm-tools-0.14.0-2.fc14.x86_64.rpm \
qemu-system-x86-0.14.0-2.fc14.x86_64.rpm \
qemu-user-0.14.0-2.fc14.x86_64.rpm
********************************************************************
Install patched ones , just built via rpmbuild procedure :-
********************************************************************
[root@fedora14 x86_64]# ./inst.sh
Loaded plugins: langpacks, presto, refresh-packagekit
Adding en_US to language list
Setting up Install Process
Examining qemu-0.14.0-2.fc14.x86_64.rpm: 2:qemu-0.14.0-2.fc14.x86_64
Marking qemu-0.14.0-2.fc14.x86_64.rpm to be installed
Examining qemu-common-0.14.0-2.fc14.x86_64.rpm: 2:qemu-common-0.14.0-2.fc14.x86_64
Marking qemu-common-0.14.0-2.fc14.x86_64.rpm to be installed
Examining qemu-debuginfo-0.14.0-2.fc14.x86_64.rpm: 2:qemu-debuginfo-0.14.0-2.fc14.x86_64
Marking qemu-debuginfo-0.14.0-2.fc14.x86_64.rpm to be installed
Examining qemu-img-0.14.0-2.fc14.x86_64.rpm: 2:qemu-img-0.14.0-2.fc14.x86_64
Marking qemu-img-0.14.0-2.fc14.x86_64.rpm to be installed
Examining qemu-kvm-0.14.0-2.fc14.x86_64.rpm: 2:qemu-kvm-0.14.0-2.fc14.x86_64
Marking qemu-kvm-0.14.0-2.fc14.x86_64.rpm to be installed
Examining qemu-kvm-tools-0.14.0-2.fc14.x86_64.rpm: 2:qemu-kvm-tools-0.14.0-2.fc14.x86_64
Marking qemu-kvm-tools-0.14.0-2.fc14.x86_64.rpm to be installed
Examining qemu-system-x86-0.14.0-2.fc14.x86_64.rpm: 2:qemu-system-x86-0.14.0-2.fc14.x86_64
Marking qemu-system-x86-0.14.0-2.fc14.x86_64.rpm to be installed
Examining qemu-user-0.14.0-2.fc14.x86_64.rpm: 2:qemu-user-0.14.0-2.fc14.x86_64
Marking qemu-user-0.14.0-2.fc14.x86_64.rpm to be installed
Resolving Dependencies
–> Running transaction check
—> Package qemu.x86_64 2:0.14.0-2.fc14 set to be installed
–> Processing Dependency: qemu-system-sparc = 2:0.14.0-2.fc14 for package: 2:qemu-0.14.0-2.fc14.x86_64
–> Processing Dependency: qemu-system-arm = 2:0.14.0-2.fc14 for package: 2:qemu-0.14.0-2.fc14.x86_64
–> Processing Dependency: qemu-system-cris = 2:0.14.0-2.fc14 for package: 2:qemu-0.14.0-2.fc14.x86_64
–> Processing Dependency: qemu-system-sh4 = 2:0.14.0-2.fc14 for package: 2:qemu-0.14.0-2.fc14.x86_64
–> Processing Dependency: qemu-system-m68k = 2:0.14.0-2.fc14 for package: 2:qemu-0.14.0-2.fc14.x86_64
–> Processing Dependency: qemu-system-mips = 2:0.14.0-2.fc14 for package: 2:qemu-0.14.0-2.fc14.x86_64
–> Processing Dependency: qemu-system-ppc = 2:0.14.0-2.fc14 for package: 2:qemu-0.14.0-2.fc14.x86_64
—> Package qemu-common.x86_64 2:0.14.0-2.fc14 set to be installed
—> Package qemu-debuginfo.x86_64 2:0.14.0-2.fc14 set to be installed
—> Package qemu-img.x86_64 2:0.14.0-2.fc14 set to be installed
—> Package qemu-kvm.x86_64 2:0.14.0-2.fc14 set to be installed
—> Package qemu-kvm-tools.x86_64 2:0.14.0-2.fc14 set to be installed
—> Package qemu-system-x86.x86_64 2:0.14.0-2.fc14 set to be installed
—> Package qemu-user.x86_64 2:0.14.0-2.fc14 set to be installed
–> Running transaction check
—> Package qemu-system-arm.x86_64 2:0.14.0-2.fc14 set to be installed
—> Package qemu-system-cris.x86_64 2:0.14.0-2.fc14 set to be installed
—> Package qemu-system-m68k.x86_64 2:0.14.0-2.fc14 set to be installed
—> Package qemu-system-mips.x86_64 2:0.14.0-2.fc14 set to be installed
—> Package qemu-system-ppc.x86_64 2:0.14.0-2.fc14 set to be installed
—> Package qemu-system-sh4.x86_64 2:0.14.0-2.fc14 set to be installed
—> Package qemu-system-sparc.x86_64 2:0.14.0-2.fc14 set to be installed
–> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================
Package Arch Version Repository Size
===================================================================================================================
Installing:
qemu x86_64 2:0.14.0-2.fc14 /qemu-0.14.0-2.fc14.x86_64 0.0
qemu-common x86_64 2:0.14.0-2.fc14 /qemu-common-0.14.0-2.fc14.x86_64 775 k
qemu-debuginfo x86_64 2:0.14.0-2.fc14 /qemu-debuginfo-0.14.0-2.fc14.x86_64 322 M
qemu-img x86_64 2:0.14.0-2.fc14 /qemu-img-0.14.0-2.fc14.x86_64 701 k
qemu-kvm x86_64 2:0.14.0-2.fc14 /qemu-kvm-0.14.0-2.fc14.x86_64 0.0
qemu-kvm-tools x86_64 2:0.14.0-2.fc14 /qemu-kvm-tools-0.14.0-2.fc14.x86_64 12 k
qemu-system-x86 x86_64 2:0.14.0-2.fc14 /qemu-system-x86-0.14.0-2.fc14.x86_64 10 M
qemu-user x86_64 2:0.14.0-2.fc14 /qemu-user-0.14.0-2.fc14.x86_64 3.9 M
Installing for dependencies:
qemu-system-arm x86_64 2:0.14.0-2.fc14 fedora-virt-preview 1.0 M
qemu-system-cris x86_64 2:0.14.0-2.fc14 fedora-virt-preview 593 k
qemu-system-m68k x86_64 2:0.14.0-2.fc14 fedora-virt-preview 705 k
qemu-system-mips x86_64 2:0.14.0-2.fc14 fedora-virt-preview 3.4 M
qemu-system-ppc x86_64 2:0.14.0-2.fc14 fedora-virt-preview 2.9 M
qemu-system-sh4 x86_64 2:0.14.0-2.fc14 fedora-virt-preview 1.4 M
qemu-system-sparc x86_64 2:0.14.0-2.fc14 fedora-virt-preview 641 k

Transaction Summary
===================================================================================================================
Install 15 Package(s)

Total size: 348 M
Total download size: 11 M
Installed size: 375 M
Is this ok [y/N]: y
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 11 M
(1/7): qemu-system-arm-0.14.0-2.fc14.x86_64.rpm | 1.0 MB 00:02
(2/7): qemu-system-cris-0.14.0-2.fc14.x86_64.rpm | 593 kB 00:01
(3/7): qemu-system-m68k-0.14.0-2.fc14.x86_64.rpm | 705 kB 00:01
(4/7): qemu-system-mips-0.14.0-2.fc14.x86_64.rpm | 3.4 MB 00:05
(5/7): qemu-system-ppc-0.14.0-2.fc14.x86_64.rpm | 2.9 MB 00:03
(6/7): qemu-system-sh4-0.14.0-2.fc14.x86_64.rpm | 1.4 MB 00:02
(7/7): qemu-system-sparc-0.14.0-2.fc14.x86_64.rpm | 641 kB 00:01
——————————————————————————————————————-
Total 534 kB/s | 11 MB 00:20
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : 2:qemu-common-0.14.0-2.fc14.x86_64 1/15
Installing : 2:qemu-system-x86-0.14.0-2.fc14.x86_64 2/15
Installing : 2:qemu-system-ppc-0.14.0-2.fc14.x86_64 3/15
Installing : 2:qemu-system-mips-0.14.0-2.fc14.x86_64 4/15
Installing : 2:qemu-system-sparc-0.14.0-2.fc14.x86_64 5/15
Installing : 2:qemu-user-0.14.0-2.fc14.x86_64 6/15
Installing : 2:qemu-system-arm-0.14.0-2.fc14.x86_64 7/15
Installing : 2:qemu-system-sh4-0.14.0-2.fc14.x86_64 8/15
Installing : 2:qemu-system-m68k-0.14.0-2.fc14.x86_64 9/15
Installing : 2:qemu-system-cris-0.14.0-2.fc14.x86_64 10/15
Installing : 2:qemu-img-0.14.0-2.fc14.x86_64 11/15
Installing : 2:qemu-0.14.0-2.fc14.x86_64 12/15
Installing : 2:qemu-kvm-0.14.0-2.fc14.x86_64 13/15
Installing : 2:qemu-kvm-tools-0.14.0-2.fc14.x86_64 14/15
Installing : 2:qemu-debuginfo-0.14.0-2.fc14.x86_64 15/15

Installed:
qemu.x86_64 2:0.14.0-2.fc14 qemu-common.x86_64 2:0.14.0-2.fc14 qemu-debuginfo.x86_64 2:0.14.0-2.fc14
qemu-img.x86_64 2:0.14.0-2.fc14 qemu-kvm.x86_64 2:0.14.0-2.fc14 qemu-kvm-tools.x86_64 2:0.14.0-2.fc14
qemu-system-x86.x86_64 2:0.14.0-2.fc14 qemu-user.x86_64 2:0.14.0-2.fc14

Dependency Installed:
qemu-system-arm.x86_64 2:0.14.0-2.fc14 qemu-system-cris.x86_64 2:0.14.0-2.fc14
qemu-system-m68k.x86_64 2:0.14.0-2.fc14 qemu-system-mips.x86_64 2:0.14.0-2.fc14
qemu-system-ppc.x86_64 2:0.14.0-2.fc14 qemu-system-sh4.x86_64 2:0.14.0-2.fc14
qemu-system-sparc.x86_64 2:0.14.0-2.fc14

Complete!
[root@fedora14 x86_64]#

Install F14 KVM as usual as VFS14.
# virsh dumpxml VFS14 > VF14.xml
Update VF14.xml :
1. Set name to VFSP14
2.Remove uuid section
3.Replace emulator with /usr/local/bin/qemu-spice
4.Remove video section ( pci slot 0x02)
# virsh define VF14.xml
will create KVM VFSP14 to run in spice session

Runtime VFSP14 profile :-

<domain type='kvm' id='7'>
<name>VFSP14</name>
<uuid>96172c80-c4df-4bbb-469e-a9e999289915</uuid>
<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='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/local/bin/qemu-spice</emulator>
<disk type='block' device='disk'>
<driver name='qemu' type='raw'/>
<source dev='/dev/vg_kvms/vm01'/>
<target dev='vda' bus='virtio'/>
<alias name='virtio-disk0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</disk>
<disk type='block' device='cdrom'>
<driver name='qemu' type='raw'/>
<target dev='hdc' bus='ide'/>
<readonly/>
<alias name='ide0-1-0'/>
<address type='drive' controller='0' bus='1' unit='0'/>
</disk>
<controller type='ide' index='0'>
<alias name='ide0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
</controller>
<interface type='bridge'>
<mac address='52:54:00:f6:88:9a'/>
<source bridge='br0'/>
<target dev='vnet0'/>
<model type='virtio'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<serial type='pty'>
<source path='/dev/pts/1'/>
<target port='0'/>
<alias name='serial0'/>
</serial>
<console type='pty' tty='/dev/pts/1'>
<source path='/dev/pts/1'/>
<target type='serial' port='0'/>
<alias name='serial0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='5900' autoport='yes'/>
<sound model='ac97'>
<alias name='sound0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</sound>
<video>
<model type='cirrus' vram='9216' heads='1'/>
<alias name='video0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
<memballoon model='virtio'>
<alias name='balloon0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</memballoon>
</devices>
</domain>

Emulator

#cat /usr/local/bin/qemu-spice
#!/bin/bash
exec /usr/bin/qemu-kvm $* \
-vga qxl \
-spice port=5930,disable-ticketing
[root@fedora14 ~]#






File /var/log/libvirt/qemu/VFSP14.log
*****************
Before patching
*****************
2011-03-13 13:04:55.858: starting up
LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin QEMU_AUDIO_DRV=none /usr/local/bin/qemu-spice -S -M pc-0.14 -enable-kvm -m 2048 -smp 2,sockets=2,cores=1,threads=1 -name VFSP14 -uuid 96172c80-c4df-4bbb-469e-a9e999289915 -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/VFSP14.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -boot c -drive file=/dev/vg_kvms/vm01,if=none,id=drive-virtio-disk0,boot=on,format=raw -device virtio-blk-pci,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0 -drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -netdev tap,fd=21,id=hostnet0 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:f6:88:9a,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -usb -vnc 127.0.0.1:0 -vga cirrus -device AC97,id=sound0,bus=pci.0,addr=0x4 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6
char device redirected to /dev/pts/1
do_spice_init: starting 0.8.0
spice_server_add_interface: SPICE_INTERFACE_KEYBOARD
spice_server_add_interface: SPICE_INTERFACE_MOUSE
spice_server_add_interface: SPICE_INTERFACE_QXL
red_worker_main: begin
handle_dev_destroy_surfaces:
handle_dev_destroy_surfaces:
handle_dev_input: start
qemu-kvm: /builddir/build/BUILD/qemu-kvm-0.14.0/qemu-kvm.c:1724: kvm_mutex_unlock: Assertion `!cpu_single_env’ failed.
2011-03-13 13:05:31.775: shutting down
*****************
After patching
*****************
2011-03-13 13:45:19.141: starting up
LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin QEMU_AUDIO_DRV=none /usr/local/bin/qemu-spice -S -M pc-0.14 -enable-kvm -m 2048 -smp 2,sockets=2,cores=1,threads=1 -name VFSP14 -uuid 96172c80-c4df-4bbb-469e-a9e999289915 -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/VFSP14.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -boot c -drive file=/dev/vg_kvms/vm01,if=none,id=drive-virtio-disk0,boot=on,format=raw -device virtio-blk-pci,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0 -drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -netdev tap,fd=21,id=hostnet0 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:f6:88:9a,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -usb -vnc 127.0.0.1:0 -vga cirrus -device AC97,id=sound0,bus=pci.0,addr=0x4 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6
char device redirected to /dev/pts/1
do_spice_init: starting 0.8.0
spice_server_add_interface: SPICE_INTERFACE_KEYBOARD
spice_server_add_interface: SPICE_INTERFACE_MOUSE
spice_server_add_interface: SPICE_INTERFACE_QXL
red_worker_main: begin
handle_dev_destroy_surfaces:
handle_dev_destroy_surfaces:
handle_dev_input: start
handle_dev_destroy_surfaces:
handle_dev_destroy_surfaces:
reds_handle_main_link:
reds_show_new_channel: channel 1:0, connected successfully, over Non Secure link
reds_main_handle_message: net test: latency 0.200000 ms, bitrate 4071570576 bps (3882.952286 Mbps)
reds_show_new_channel: channel 4:0, connected successfully, over Non Secure link
red_dispatcher_set_cursor_peer:
handle_dev_input: cursor connect
reds_show_new_channel: channel 2:0, connected successfully, over Non Secure link
red_dispatcher_set_peer:
handle_dev_input: connect
handle_new_display_channel: jpeg disabled
handle_new_display_channel: zlib-over-glz disabled
reds_show_new_channel: channel 3:0, connected successfully, over Non Secure link
inputs_link:
spice_server_add_interface: SPICE_INTERFACE_TABLET
handle_dev_input: mouse mode 2
handle_dev_input: oom current 0 pipe 0
handle_dev_input: oom current 0 pipe 0
handle_dev_input: oom current 0 pipe 0
handle_dev_input: oom current 0 pipe 0
handle_dev_input: oom current 0 pipe 0
handle_dev_input: oom current 0 pipe 0
spice_server_remove_interface: remove SPICE_INTERFACE_TABLET
handle_dev_input: mouse mode 1
2011-03-13 13:48:07.644: shutting down

Windows 7 KVM running in spice terminal