Set up Spicevmc Channel on Ubuntu 11.04 as KVM Server and spice-vdagent on Natty as a KVM guest

Procedure following bellow set up spicevmc channel support on KVM Server Ubuntu Natty. It also instructs how to setup spice-vdagent on Natty installed as KVM guest at any KVM Server Ubuntu 11.04 or F15. In other words it contains build debian package spice-vdagent via source for Ubuntu 11.04 ( Natty). To setup spicevmc channel on Natty install qemu-kvm packages from PPA Packages in Spice-Gtk-0.6 on Ubuntu 11.04 and Ubuntu 11.10. Build qemu-kvm-060911-0ubuntu5 from PPA already supports spicevmc channel.It’s original tarball is based on git clone git:// on 06/09/2011.Also upgrade virtinst via same PPA up to 0.500.6 to have virt-install understand option “–channel spicevmc”

Install VF15 KVM guest via :-

virt-install --connect qemu:///system \
--virt-type kvm \
--os-type=linux --os-variant=fedora15 \
--name VM15VMC --ram 2048 --disk path=/dev/sda5 \
--graphics spice --video qxl --channel spicevmc \
--cdrom /usr/tmp/Fedora-15-x86_64-DVD.iso --vcpus 2

Due to absence Virt-Manager’s ability to create channels,
e.g. it’s missing required F15 patches. Then in guest environment :
# sudo yum update
# sudo yum install spice-vdagent.
It provides an option cut text in VM Spice screen and paste in KVM Server Ubuntu 11.04 desktop environment and vice versa ….
Debian qemu-kvm packages providing spicevmc support have been also tested OK on Oneiric ( Libvirt 0.9.1)

Install Natty KVM guest as follows :-

virt-install --connect qemu:///system \
--virt-type kvm \
--os-type=linux --os-variant=ubuntunatty \
--name UbuntuVMC --ram 2048 \
--disk path=/dev/sdb7 \
--graphics spice --video qxl \
--channel spicevmc \
--cdrom /usr/tmp/ubuntuDesk11.04.iso \
--vcpus 2

When done install spice-vdagent for Natty via PPA Spice on Ubuntu 11.04 and 11.10.
Update on 06/17/2011. Current versions of spice-vdagent install service and *.desktop (file) automatically and require guest restart for activation or manual gdm restart and starting service.

Next :-
1. Create file /etc/xdg/autostart/spice-vdagent.desktop

[Desktop Entry]
Name=Spice vdagent
Comment=Agent for Spice guests

2. Then create service spice-vdagentd.

Create file /etc/init/spice-vdagentd.conf

# spice-vdagent - spice-vdagent job file
description "spice-vdagentd"
author "Boris Derzhavets <>"
# Stanzas
# Stanzas control when and how a process is started and stopped
# See a list of stanzas here:
# When to start the service
start on runlevel [2345]
# When to stop the service
stop on runlevel [016]
# Automatically restart process if crashed
# Essentially lets upstart know the process will detach itself to the background
expect fork
# Run before process
pre-start script
[ -d /var/run/spice-vdagentd ] || mkdir -p /var/run/spice-vdagentd
echo "Put bash code here"
end script
# Start the process
exec /usr/sbin/spice-vdagentd

Expected result :-

boris@boris-virtual-machine:~$ ps -ef| grep spice- | grep -v grep
root 739 1 0 09:23 ? 00:00:00 /usr/sbin/spice-vdagentd
gdm 1041 1 0 09:23 ? 00:00:00 /usr/bin/spice-vdagent
boris 1248 1 0 09:23 ? 00:00:00 /usr/bin/spice-vdagent

Current Build is just for testing. All actions above should be incapsulated in debian package.
If feature doesn’t work :-
boris@boris-virtual-machine:~$ ps -ef|grep spice-
root 1044 1 0 18:25 ? 00:00:00 /usr/sbin/spice-vdagentd
boris 1439 1379 0 18:25 pts/0 00:00:00 grep –color=auto spice-
boris@boris-virtual-machine:~$ /usr/bin/spice-vdagent &
[1] 1445

Testing Oneiric Daily Build as KVM guest :-

About these ads

3 Responses to Set up Spicevmc Channel on Ubuntu 11.04 as KVM Server and spice-vdagent on Natty as a KVM guest

  1. dude says:

    Nice to see you are using a little KVM these days.

  2. dbaxps says:

    You are right. Performance is exciting. Qemu-Kvm upstream is a real miracle.
    Either Intel did something to chips (?). I am a bit confused. KVM didn’t work
    on C2D E6600. It starts to work with Quad Core 2 Duo 9550, even C2D E8500
    is not good enough. I suspect it’s not just VT-X.

  3. dude says:

    Also good to see you using spice. With approx 30fps / bi-directional sound it will hopefully live up to its promise.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

%d bloggers like this: