We continue to digest the spices of
SPICE RedHat Desktop Virtualization . In this note, the SPICE server will be considered solely as an alternative to the
VNC server, and the experiment on tuning in the
Fedora 17 operating system and in the operating systems of the
Ubuntu 12.04 Precise Pangolin family, for example
LinuxMint, will also be considered.
QXL vs. VNC
The QXL virtual video card was originally developed for use in a
KVM emulator to improve graphics output via the SPICE protocol. Recently, a virtual video card QXL can be used on real hardware to provide remote access over the network via SPICE to the server screen under control of the
X server, as an alternative to the VNC server.
To start the VNC server, you need an X server, which must be run locally and needs a video card to work. Unlike the VNC server, the SPICE server is built into the driver of the virtual QXL video card, and as a result, it can run the X server without a real video card.
Working with a computer without using a video card can be used not only to reduce the cost of configuration and use, but also to forward all installed PCI video cards to virtual machines using Vt-d and IOMMU technologies.
')
The QXL virtual video card imposes some restrictions that must be considered when deciding on its use:
- The work on the image output is transferred from the graphics processor and the memory of the video card to the central processor and RAM of the computer, which in turn affects the performance. Although if the computer processor has several cores and sufficient RAM, the increase in computing resources consumption will not be so noticeable.
- Due to the transfer of calculations on the processing of graphics output from a video card to a computer, not only is performance reduced, but some possibilities become unavailable. For example: 3D graphics acceleration through hardware rendering, video acceleration support via overlay, etc. etc.
- The inability to debug the download until the launch of the X-server. Debugging in case of errors at the download stage is performed by connecting a video card or using SSH or outputting the console to a serial port.
- In contrast to the VNC server, the SPICE server has a bug whose essence is that XKB falls off due to the launch of QXL for this reason, you need to initialize the layouts every time you start with the * command:
setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll us,ru
- Unlike a virtual machine, a real computer does not have a virtual channel to work with the hypervisor, as a result of which work with the clipboard, forwarding of USB devices will not be available.
- After installing a QXL video card, the X server will not use a real video card.
Thus, the use of a virtual QXL video card is inconvenient for accessing work computers directly, but can be used on servers, for example, on virtualization nodes. However, it is worth noting that if you wish, you can virtualize work computers and remotely transfer necessary USB equipment to them thereby ensuring remote access.
Installation and Setup
As an example, we will conduct an experiment on setting up remote access through a SPICE server on virtual machines running Ubuntu 12.04 and Fedora 17 after setting up from which we will remove video cards. If you can experiment with virtual machines, you can proceed to the real hardware.
Before starting the experiment, on computers running the GNU / Linux operating system of the Ubuntu 12.04 family (Ubuntu) we connect the
repo.umvirt.org repository:
sudo -i
Attention: currently packages for amd64 are presented in the repository only!
On computers running Fedora17 (hereinafter referred to as Fedora), you do not need to connect the repository. Other versions and distributions have not been tested.
In order to start using a QXL video card you need:
- Install the QXL driver (at least version 0.0.17) and the SPICE server .
Fedora:
yum -y install xorg-x11-server-Xspice
Ubuntu:
apt-get install xserver-xorg-video-qxl xserver-xspice
- Install and configure SSH for remote console access:
Fedora:
yum -y install openssh-server service sshd start
Ubuntu:
apt-get install openssh-server
If the SSH connection is working proceed to the next step.
- Explicitly use the QXL video card and the SPICE server settings in the /etc/X11/xorg.conf file in the X server settings :
Section "Device" Identifier "XSPICE" Driver "spiceqxl" # Enable regular port. Either this or SpiceTlsPort, or one of XSPICE_PORT or # XSPICE_TLS_PORT environment variables must be specified # Defaults to 5900. Option "SpicePort" "5900" # Do not request any password from client Option "SpiceDisableTicketing" "0" # Set password client will be required to produce. Option "SpicePassword" "password" EndSection Section "InputDevice" Identifier "XSPICE POINTER" Driver "xspice pointer" EndSection Section "InputDevice" Identifier "XSPICE KEYBOARD" Driver "xspice keyboard" EndSection Section "Monitor" Identifier "Configured Monitor" EndSection Section "Screen" Identifier "XSPICE Screen" Monitor "Configured Monitor" Device "XSPICE" DefaultDepth 24 EndSection Section "ServerLayout" Identifier "XSPICE Example" Screen "XSPICE Screen" InputDevice "XSPICE KEYBOARD" InputDevice "XSPICE POINTER" EndSection # Prevent udev from loading vmmouse in a vm and crashing. Section "ServerFlags" Option "AutoAddDevices" "False" EndSection
If the file does not exist it should be created. For verification, through SSH and the clipboard, you can paste the above code into the file.
- You need to install the necessary packages on the client's machine :
Fedora:
yum -y install spice-gtk-tools spice-client
Ubuntu:
apt-get install spice-client spice-client-gtk
- Connect as a client to the SPICE server . For example, to access the SPICE server located at 192.168.122.10, execute the command:
spicec -h 192.168.122.10 -p 5900 -w password
or
spicy
As proof that the SPICE server can run an X server without a video card, I’m providing screenshots of Fedora and Mint 13 Maya (Ubuntu family 12.04) with a list of PCI devices for confirmation using the lspci command:
- Fedora 17

- Mint 13 Maya

* Ways to automate loading layouts are given
here.