Virtualization
- WHAT?
Migrating Spice-based virtual machines to VNC is a configuration process that replaces the deprecated Spice graphical console protocol with VNC on SUSE Linux Enterprise Server 16.0 using libvirt and KVM.
- WHY?
This migration ensures continued VM console access on SUSE Linux Enterprise Server 16.0 by replacing the removed Spice protocol with VNC, which is widely supported and actively maintained.
- EFFORT
It takes approximately 20 minutes to complete this procedure and requires basic knowledge of libvirt, virsh commands and XML configuration files.
- GOAL
By the end of this guide, your existing virtual machine will be reconfigured to use VNC instead of Spice and will start successfully on a SUSE Linux Enterprise Server 16.0 host.
1 Deprecation of Spice and Migration to VNC in SUSE Linux Enterprise Server 16 #
1.1 Overview of Spice Deprecation #
Starting with SUSE Linux 16, support for the Spice remote computing protocol for virtual machines (VMs) has been completely removed in favor of VNC, which is a more universally adopted standard. Consequently, any attempt to start a Spice-based VM on an SLES 16 host will fail with an error. All existing VMs that were created on SLES 15 SP7 or earlier and are configured to use Spice for the graphical console must be manually converted to use VNC. Currently, no automated conversion tool is provided, so this process requires manually editing the VM's XML configuration file.
The following procedure outlines the steps to convert a VM from Spice to VNC.
Ensure the virtual machine is completely shut down before making any changes. This prevents any potential data corruption or configuration mismatches.
>sudovirsh shutdown VM-NAMEExport the current XML configuration of the VM to a file. This file will be edited in the next steps.
>sudovirsh dumpxml VM-NAME > VM-NAME.xmlCreate a backup of the original XML definition. This allows you to restore the original configuration if something goes wrong during the editing process.
>cp VM-NAME.xml VM-NAME-SPICE.xmlManually edit the VM's XML configuration file to remove all Spice-related elements and modify others to use VNC. For detailed information, see the subsequent sections.
1.2 Removing Spice-Specific XML Elements #
The following XML snippets are specific to the Spice protocol and must be removed from the VM's configuration file. These elements enable features like the Spice agent channel and USB redirection over Spice, which are no longer supported.
<!-- This channel is for the Spice agent and is no longer needed -->
<channel type='spicevmc'>
<target type='virtio' name='com.redhat.spice.0'/>
<address type='virtio-serial' controller='0' bus='0' port='2'/>
</channel>
<!-- These elements enable USB redirection over Spice and must be removed -->
<redirdev bus='usb' type='spicevmc'>
<address type='usb' bus='0' port='2'/>
</redirdev>
<redirdev bus='usb' type='spicevmc'>
<address type='usb' bus='0' port='3'/>
</redirdev>1.3 Modifying XML Elements for VNC Compatibility #
After removing the Spice-specific elements, modify several other XML elements to switch the VM from using Spice to VNC for its graphical console and other devices.
1.3.1 Graphics and Audio #
The primary change is to switch the graphics display protocol from Spice to VNC. You should also disable the audio device, as Spice-based audio is no longer supported.
Replace the Spice graphics configuration:
<graphics type='spice' autoport='yes' listen='127.0.0.1'>
with the VNC equivalent:
<graphics type='vnc' autoport='yes' listen='127.0.0.1'>
Then, replace the Spice audio configuration:
<audio id='1' type='spice'/>
with:
<audio id='1' type='none'/>
1.3.2 QXL Video Device Conversion for Windows VMs #
The QXL video driver is optimized for the Spice protocol and is commonly used in Windows VMs. For better compatibility with VNC, we recommend replacing it with the more generic virtio video driver.
If your VM, especially a Windows guest, uses a QXL video device like this:
<video>
<model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
</video>Replace the entire <video> block with a simpler virtio model definition:
<video>
<model type="virtio"/>
</video>When you define the VM, libvirt will automatically fill in the necessary default values for the virtio video device, so you don't need to specify details like RAM or bus address.
1.4 Applying the new configuration and starting the VM #
After you have finished editing the XML file and saved your changes, you need to make libvirt aware of the new configuration. This is done by first undefining the VM, which removes its old configuration from libvirt, and then defining it again using the modified XML file.
Undefine the existing VM configuration and then define it again with the modified XML file:
>sudovirsh undefine <vm_name>>sudovirsh define <vm_name>.xmlStart the VM, which will be using VNC for its graphical console.
>sudovirsh start <vm_name>
1.5 Restoring copy-paste functionality #
A common feature available with Spice is copy-paste functionality between the host and the guest VM, which is handled by the Spice agent. After migrating to VNC, this functionality will be lost. However, you can restore it by using the QEMU guest agent.
Ensure you have updated
gtk-vncpackages on your SLES 16 host. The versions shipped with the initial release of SLES 16 may not have support for copy-paste over VNC.Inside the guest VM, ensure the QEMU guest agent is installed and the corresponding service is enabled to start on boot.
>sudosystemctl enable qemu-guest-agentAdd a new channel definition to the VM's XML configuration. This channel allows communication with the QEMU guest agent for features like copy-paste.
<channel type="qemu-vdagent"> <source> <clipboard copypaste="yes"/> </source> <target type="virtio" name="com.redhat.spice.0"/> <address type="virtio-serial" controller="0" bus="0" port="1"/> </channel>Shut down and restart the VM for the changes to take effect.
2 For more information #
For further steps in virtualization, refer to the following sources:
3 Legal Notice #
Copyright© 2006–2026 SUSE LLC and contributors. All rights reserved.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or (at your option) version 1.3; with the Invariant Section being this copyright notice and license. A copy of the license version 1.2 is included in the section entitled “GNU Free Documentation License”.
For SUSE trademarks, see https://www.suse.com/company/legal/. All other third-party trademarks are the property of their respective owners. Trademark symbols (®, ™ etc.) denote trademarks of SUSE and its affiliates. Asterisks (*) denote third-party trademarks.
All information found in this book has been compiled with utmost attention to detail. However, this does not guarantee complete accuracy. Neither SUSE LLC, its affiliates, the authors, nor the translators shall be held liable for possible errors or the consequences thereof.