- QXL QEMU driver. Please note that all the information about video RAM sizes below should be taken with grain of salt. Nobody knows the perfect ultimate answer to that topic, there are different guest OS drivers and as stated above, things may completely change in oVirt 4. Users should be able to override the computed default settings if they.
- In this video, I follow up from the last video on running Windows 10 within KVM/QEMU and show how to install the QXL graphics drivers as well as exploring ho.
The SPICE project aims to provide a complete open source solution for remote access to virtual machines in a seamless way so you can play videos, record audio, share usb devices and share folders without complications.
Virtio Windows Drivers
It is not user documentation and should not be treated as such.
Documentation is available here.
There is a lot of confusion about video RAM settings and workings in libvirt/QEMU. This page provides compilation of information on the topic gathered from many sources and represents the best knowledge available as of December 2015.
State in oVirt until 3.6
The following video RAM settings were applied in oVirt per PCI device:
- ram = 64 MB * number_of_heads
- vram = 32 MB
- vgamem = unset (default 16 MB set by libvirt)
Note: If single-PCI option is not set, number_of_heads is always 1 and “heads” option in the Engine defines number of separate video devices. If single-PCI option is set, there is only single video device and “heads” Engine option transforms to number_of_heads above.
libvirt
Meanings of <video>
element attributes in domain XML:
ram
(KB) specifies primary memory bar size, corresponds toram_size
(B) QEMU command line option.vram
(KB) specifies secondary memory bar size, corresponds tovram_size
(B) QEMU command line option.vgamem
(KB) must be set to at least certain minimum value based on screen resolution and number of heads, corresponds tovgamem_mb
(MB) QEMU command line option.vgamem
libvirt option is available since RHEL-7.1;vgamem_mb
QEMU option is available since RHEL-6.7.
QXL QEMU driver
Please note that all the information about video RAM sizes below should be taken with grain of salt. Nobody knows the perfect ultimate answer to that topic, there are different guest OS drivers and as stated above, things may completely change in oVirt 4. Users should be able to override the computed default settings if they use uncommon arrangements or the computed values don’t work well for them. This can be done using before_vm_start VDSM hook.
You can look for implementation details in qxl.c in QEMU sources. But don’t rely on anything, things may change, so it’s a good idea to get confirmation from QEMU and/or libvirt developers about everything.
libvirt ram
represents primary memory bar, 32-bit only. libvirt vram
represents secondary memory bar, 64-bit (it may not be true as of now, there is a separate vram_size_mb
QEMU command line option for that, not necessarily used by libvirt).
vgamem
is allocated within ram
. Minimum ram
size, as enforced by QEMU regardless the command line settings, is 2 * vgamem
. vram
is allocated separately.
Maximum supported screen resolution is 4 megapixels (2560x1600). Maximum number of heads is 4.
The required memory sizes are basically dependent on screen resolution multiplied by number of heads. But this should actually be the bounding rectangle of the screen arrangement. For instance, let’s assume 4 screens with resolution 1024x768 each. If they are arranged compactly in a single row or in two rows and two columns, it’s fine, memory for 3 megapixels is required. But if three screens are in a row and the fourth screen is below them then the required memory may correspond (depending on the driver) to 4.5 (3072x1536) megapixels; when all the screens are arranged diagonally, it’s 12 (4096x3072) megapixels. We don’t assume such setups when computing memory values.
Due to 32-bit addressing in QEMU, total (for all video cards together) maximum size of ram
is 256 or 512 MB. TODO: Check what happens when we specify more.
All memory sizes should be specified as powers of 2. This is not a strict requirement, it’s just advised.
Video RAM is allocated in addition to specified guest main RAM, not within it.
The recommended memory sizes are dependent on particular guest OS and its drivers:
- Windows:
- vgamem = screen_width * screen_height * 4
- ram = 4 * vgamem
- vram unimportant (can be e.g. 8 MB)
- RHEL-6 (uses UMS driver):
- vgamem = screen_width * screen_height * 4 * number_of_heads
- ram = 4 * vgamem
- vram unimportant (can be e.g. 8 MB)
- Note:
ram
may (or may not) work even when it’s reduced to2 * vgamem
, but developers recommend using the larger value.
- RHEL-7 (uses KMS driver):
- vgamem = screen_width * screen_height * 4 * number_of_heads
- ram = 4 * vgamem
- vram >= vgamem * 2
- Note:
ram
may (or may not) work with much smaller values, but it’s suggested to set it at least so thatram + vram >= 3 * vgamem
. - Note: An alternative formula for
vram
isscreen_width * screen_height * 4 * (number_of_heads + 1)
. But developers strongly recommend using at leastvgamem * 2
.
It may not be a good idea to use excessively large memory values just to be safe. The extra (above required minimum) memory may be actually utilized by the guest OS drivers and applications (e.g. Excel or Firefox) for purposes not necessarily very important for graphics performance. As the result, physical RAM may be wasted for no useful purpose.
vnc/vga and vnc/cirrus
- The better choice of the two is clearly vnc/vga.
- Multihead is not supported on any of the drivers.
- Default
vram
value, 16 MB, is fine for most common uses, except for full HD on Wayland (needs twice as much due to two framebuffers—page-flipping). - Supported by libvirt only on RHEL-7.
New settings in oVirt 3.6.X
We use the following settings in new oVirt versions (per PCI device):
- QXL
- vgamem = 16 MB * number_of_heads
- ram = 4 * vgamem
- vram = 2 * vgamem for RHEL-7 guest OS
- vram = 8 MB for other guest OSes
- vnc/vga and vnc/cirrus:
- vram = 16 MB
Introduction
SPICE (Simple Protocol for Independent Computing Environments) is an open remote computing solution built for virtual environments which allows users to view a computing 'desktop' environment. The integrating of Spice into Proxmox VE provides a solution for interaction with virtualized desktop devices, like keyboard, mouse, audio and video. Interaction between front-end and back-end is done using Virtual Device Interfaces (VDI).
Spice achieves a user experience similar to an interaction with a local machine. It is suitable for both LAN and WAN usage, without compromising on the user experience.
Using Spice on Proxmox VE is easy and secure. It is integrated in the cluster environment, the user- and authentication system - and of course, all traffic is fully encrypted.
Spice was first introduced with Proxmox VE 3.1.
Requirements for SPICE
Qxl Driver Windows Xp
In order to use Spice you need the following:
- Spice client on your desktop OS
- Spice drivers inside your VM (VirtIO, QXL Graphic card drivers)
SPICE client
- Windows: virt-viewer 0.5.6 or higher, http://www.spice-space.org/download.html
- Linux: virt-viewer 0.5.6 or higher
- OS X (not yet working as expected): virt-viewer 0.5.7 or higher, https://www.spice-space.org/osx-client.html
Enable SPICE for a VM
Spice is not enabled by default. To enable it set the Display in the Hardware section of the VM to Spice (shown in the screenshot at the top). Increase the memory if you intend to use SPICE with high resolutions. 32 MiB is plenty for 4K resolutions.
Caution
Before changing the Display setting to SPICE check the following section. You may need to install QXL/SPICE drivers depending on the guest OS.
OS specific settings for VM
Windows
Windows 7/8/10 and Windows 2012/2016
Fully supported. Before you switch the Display to SPICE install the Windows SPICE guest tools 0.132 or higher (spice-guest-tools-0.132.exe or higher)
- http://www.spice-space.org/download.html
Linux
All Linux distributions released after 2011 have the necessary qxl driver included as a part of the Xorg package.
Start your SPICE session
A Spice session can be started by clicking directly on the Console button or by opening the Console sub menu and selecting Spice explicitly. This will trigger the download of the connection config file.
Open this file with Remote Viewer to start the session.
The association is automatic for Chrome and Internet Explorer (they use the mime type association from the OS).For Firefox, the association must be done manually, as Firefox has his own internal mime type association (See Options/Applications).
Using client USB devices
You can pass USB devices from the client into the VM. Add a USB device of the type Spice Port in the Hardware section of the VM.
Old methods of editing the config file directly are not necessary anymore with recent versions of Proxmox VE.
Caution
- The Windows version of the virt-viewer does not support it.
Using Audio
Qxl Driver Source Code
Audio devices can be added in the Hardware section of the VM. Three audio devices are supported:
- ich9-intel-hda: emulates Intel HDA Audio on ICH9 chipsets
- intel-hda: emulates Intel HDA Audio on ICH6 chipsets. Use if the ICH9 one does not work properly
- AC97: useful for older OS`s like Windows XP
Manually editing the config file of the VM is not necessary with recent versions of Proxmox VE.
SPICE Enhancements
SPICE Enhancements are optional features that can improve the remote viewer experience.They can be enabled in the Options panel of a VM.
Two enhancements are currently available:
- Foldersharing
- Videostreaming
Foldersharing enables you to share a local folder with the VM you are connecting to. The 'spice-webdavd' daemon needs to be installed in the VM.
HINT: only the Linux version of Virt-viewer (remote-viewer) supports this.
Videostreaming will encode fast refreshing areas in a lossy video stream. A general recommendation cannot be given but depending on your situation this can greatly improve the performance.
More information can be found in the reference manual by clicking the 'Help' button in the dialog to enable the enhancements.
Qxl Driver Windows 98
Troubleshooting
Can't start Spice session
If you can't start a Spice session from the PVE Web gui, you can try the following shell script:https://git.proxmox.com/?p=pve-manager.git;a=blob_plain;f=spice-example-sh;hb=HEAD
Guest resolution does not resize to Remote Viewer window
Make sure the spice-vdagent service is installed and running in the VM.
If the guest stops resizing once you go higher than a certain size it is possible that the video memory is not enough. Increase the Memory settings of the Display in the Hardware section of the VM by a few MiB. For the changes to take effect you have to shutdown the VM and do a clean start.
Alternatives
Depending on your situation SPICE might not be the best solution.Alternatives are:
- RDP (Remote Desktop Protocol) for Windows Guests
- X2GO for Linux Guests