KVM - The Linux Kernel-Based Virtual Machine
News, Blogs and Resources on the Linux (KVM) Kernel-Based Virtual Machine

Getting Started with SPICE on Fedora 12

If you’re running Fedora 12, getting started with SPICE is super easy. In this post I’ll demonstrate getting the most basic implementation working with Red Hat’s spice client that was released two days ago. Please note that because the windows binaries ( qxl drivers and agent ) have not been released yet you won’t be able to get the full SPICE experience using this procedure. According to the spice website these windows binaries are to be released soon. So let’s begin.

 

 

 

Install SPICE client , SPICE server and Qemu with SPICE backend

Fedora has made it very simple to setup the required dependencies to get spice client and server up and running. Again, I’ll re-emphasize that this is procedure currently only works if you’re running Fedora 12 on your KVM host. Install the spice repository using the following commands.

sudo wget -P /etc/yum.repos.d/ http://spice-space.org/download/spice.repo
sudo rpm --import http://spice-space.org/download/RPM-GPG-KEY-spice-fedora-12-x86_64

Next install the spice client and qemu packaged with the spice using the following commands.

sudo yum install spice-client
sudo yum install qemu-spice

Now you are ready to give spice client a test run.

 

Start up your qemu with the spice backend

For this part you can either install a new guest machine or you can use an existing disk image that you’ve already installed using kvm. The only additional options you really need in order to get this “spiced” version of qemu up and running is the –spice option as shown below. Note that this package installs the qemu spiced binary at /usr/libexec/qemu-spice .

/usr/libexec/qemu-spice \
-hda /var/lib/libvirt/images/Centos4-Devel.qcow2 \
-m 512 \
-qxl 1 \
-spice port=5930,disable-ticketing &

The –qxl option specifies the number of qxl display devices. You can safely use this option even without qxl drivers since it supports standard VGA even when no drivers are installed. The spice option disable-ticketing enables a spice client connection with no password. Because we are just trying to get a basic working implementation of spice client and server we won’t be using any passwords. The port number is the port the spice server will be listening on. In this case I used 5930. When you execute that command you’ll probably see lots out output to your terminal similar to below.

Don’t worry about this as it’s just status information.

 

Startup your spice client

Now you can startup your spice client using the following command assuming you installed the client and server on the same machine.

/usr/bin/spicec –h localhost –p  5930

If you installed client and server on separate machines then replace localhost with the ip address of your server. Now you’ll see your spice client window startup. Below is a snapshot of what your spice client window should look like.

 

 

NOTE: To release your cursor from the guest you need to use key combination of Shift+F12

If you’re curious about SPICE and you have a KVM host running Fedora, 12 go ahead and give this procedure a try. As mentioned earlier this is the most basic implementation and so you won’t get the full SPICE experience due to lack of qxl driver and guest agent availability. I think it would be nice to eventually see integration of spice into virt-manager but it might be some time before we see this due to the work involved. In any case you at least have the components to work with SPICE.
 

See Also

Comments

Impressive

Very impressive. Even with server and client on the same box, you can feel the improvement in responsiveness in the guest's GUI. Couldn't quite figure out how to leave the guests window again though: had to shutdown the guest to get the pointer back on my desktop :)

Darn slow on localhost for me

Maxim,

I ran it on a fast machine but it was very, very slow for me. It worked and I understand why it was slow. I find it strange that you were able to get the improvement in responsiveness?

Slow for me

Maxim,

It was darn slow for me on a very fast machine so I'm not sure how you were able to notice an improvement in responsiveness. I understand why it is slow though... because, as mentioned, some of its pieces aren't there so it is default to something slow just to work at all.

Thanks for posting though, it was fun to play with.

Release cursor from guest

 I updated to post to include the keystrokes needed to release your cursor from the guest. I had the same issue and specifically wanted to mention this but it slipped me somehow. Performance will be noticeably better if you use qxl drivers so we'll just have to wait until they're released.  

You need driver to make spice work fast

without the QXL driver installed, spice will render at the speed of qemu std-vga.

(No point in using it if not having the driver installed in the guest)

You can use RHEL /Centos 5

You can use RHEL /Centos 5 guest with the qxl driver:

http://rhn.redhat.com/errata/RHEA-2009-1308.html

are there a way to integrate

are there a way to integrate it to virt-manager?

I'm using remote server for hosting VMs. Would like to either patch virt-manager or config xmls in order to get spice work.

Re: are there a way to integrate

There upstream qemu developer community is currently discussing the integration of SPICE. A large part of the integration will have to happen there so it's going to be some time. There will probably have to be some kind of GTK widget for the client side (virt-manager) as well. If you're interested in the discussion you can read it at the following link.

http://lists.gnu.org/archive/html/qemu-devel/2009-12/msg01168.html 

It's quite a lengthy discussion but if you're interested in SPICE integration, it's a good read

 

Spice windows drivers were released

Now you can checkout spice with windows guests, huge improvment over working without the driver

Re: Spice windows drivers were released

 Thanks for the update. I caught the announcement and I'm almost finished writing a post about this.

Update: You can find the post at http://www.linux-kvm.com/content/rhev-spice-guest-drivers-released-windows

Re: release cursor correction

I've updated the post to correct typo for key combination to release the cursor. The correct key combination is

Shift + F12

Trouble Starting spicec

I had some trouble starting spicec with the command you stated here. It complained about unexpected positional arguments. Worked like a charm when i used --host and --port as arguments. Not documented at all so i thought i share my findings. Maybe someone else stumbled upon that.
Thx for the guide.

Re: Trouble Starting spicec

Out of curiosity, are you using Fedora or did you manually install the client?

Re: Re: Trouble Starting spicec

i am using fedora 12, used the yum way illustrated above.
Its running fine now, btw. Installed the windows drivers, works like a charm. Win7 "performance measures" give almost bare metal results, except graphics.

Still can't get the qxl

Still can't get the qxl driver working. Installed, still poor performance. Any ideas? What about ubuntu?

Send ctrl-alt-del

Does anyone know how to send ctrl-alt-del to a Windows guest from within the spicec window ?
Thanks

re: send ctrl-alt-del

You should have access to the monitor by typing ctrl-alt-2 then use the sendkeys command.

That isn't working because i

That isn't working because i have a putty connection to the spice fedora 12 server. In this connection i start the guest via /usr/libexec/qemu-spice -hda /kvm/images/XXX.qcow2 -m 512 -qxl 1 -spice port=5930,disable-ticketing &.
after this i start the spicec from my putty windows via /usr/bin/spicec -h localhost -p 5930. The Window appear as a remote x11 windows on my windows xp. Now the question again, how can i send the ctrl-alt-del combination.
Thanks

Re: That isn't working because

In that case you need to add the following monitor option when starting up your guest virtual machine

-monitor telnet::4444,server,nowait 

With this option you can access the guest monitor across the network. See the following post for more information on this.

http://www.linux-kvm.com/content/two-ways-access-your-virtual-machine-monitor-across-network

Post new comment

The content of this field is kept private and will not be shown publicly.