« Previous 1 2 3 4 Next »
Controlling virtual machines with VNC and Spice
Well Seasoned
Layer Cake
Spice comprises three components:
- The Spice server is indicated directly in QEMU/KVM. It is responsible for external communication – that is, for letting the user control the virtual machine across a network connection. For the virtual machine, the Spice server looks like a VGA graphics card.
- The Spice client (on current distributions, this is the
spicy
command from thespice-gtk-tools
package; on older distributions, thespicec
command from thespice-client
package) is comparable to a VNC viewer, which displays the graphics system from the virtual machine in a window. Current versions of the Virtual Machine Managers, fromvirt-viewer
orvinagre
, are also Spice compatible. The Spice client is also available as a Windows program. - The QXL driver is installed on the virtual machine and ensures that the virtual machine supports the graphics system efficiently and with high resolutions. The QXL driver is currently available both for X (Linux) and for Windows. Spice also works without the QXL driver; however, only with resolutions of up to 1024x768 pixels on the virtual machine. Additionally, Spice then offers no speed benefits compared with other graphics solutions.
With current versions of RHEL or Fedora, you can use Spice directly with Virtual Machine Manager: To do so, set Type = Spice
in the Display
tab of the detailed view. Additionally, you need to set Model = qxl
in the Video
tab. After starting, the graphics system is displayed in the normal way in the Virtual Machine Manager's console window. From a purely visual point of view, you will not notice any difference from VNC.
For optimum support of QXL by the guest, you need to install a QXL driver on the guest. On current Linux distributions, this is often the default. On some Linux distributions, you will need to install the QXL driver package yourself (i.e., xserver-xorg-video-qxl
or xorg-x11-drv-qxl
). If the driver is not automatically enabled the next time you start X, add the following lines to /etc/X11/xorg.conf
or /etc/X11/xorg.conf.d/spice.conf
on the guest:
Section "Device" Identifier "device0" Driver "qxl" EndSection
On the network, the same rules basically apply for Spice as for VNC: Libvirt assigns the Spice server on a newly launched virtual machine the first free port above 5900 and an IP address of 127.0.0.1 by default. You can change various global Spice settings for the Libvirt tools in /etc/libvirt/qemu.conf
.
On Fedora and RHEL, the firewall, which is enabled by default, blocks external Spice connections. To change this, use SSH with port forwarding as for a VNC connection, or add an exception to your firewall ruleset. You will find predefined rules in the Other Ports tab of the firewall configuration program.
Spice up your Ubuntu
The best Spice support is available with the Fedora and RHEL Linux distributions. Ubuntu, as of Version 12.04 at least, provides a Spice-compatible version of QEMU/KVM. To use the Spice-ready version, you will need to install the required packages manually:
apt-get install qemu-kvm-spice spice-client-gtkpython-spice-client-gtk
On Ubuntu 12.04, use of Spice in the Virtual Machine Manager fails because the program does not call the Spice variant of qemu-kvm
. On Ubuntu, the Spice support resides in a separate program (qemu-kvm-spice
). Thus, the only way to use Spice in Ubuntu 12.04 is at the command line.
The Virt-manager version on Ubuntu 12.10 has a better configuration, so at least everything works on the host side. An attempt to run Ubuntu 12.10 Beta 2 as a guest on a virtual machine with Spice and QXL graphics failed because of an issue with the QXL driver (at least the driver is enabled). Whether this bug (Launchpad #1056381) will be fully addressed in Ubuntu 12.10 is still not clear at the time I am writing this article.
Windows
The previous examples all assumed that a Linux distribution was running on the virtual machines. However, KVM is also Windows compatible. Virtual Machine Manager automatically selects the vga
graphics driver for Windows guests (Figure 1). This is a good choice: Both Windows XP and Windows 7 have no problems with the driver and support virtually unlimited resolutions (tested up to 2560x1600). On Windows 7, you will need to do without the Aero effects.
Theoretically, you could use Spice for Windows guests. QXL Windows drivers are available online [2] (search for "windows guest tools").
In practical terms, QXL driver 0.1 on Windows 7 fails because of signature issues (Figure 2). The Device Manager tells you that the driver is not correctly signed (Error 52).
« Previous 1 2 3 4 Next »