Migrating Spice-based Virtual Machines to VNC
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. This migration ensures continued VM console access by replacing the removed Spice protocol with VNC, which is widely supported and actively maintained. 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 #
Spice support for VMs has been removed beginning with SLES 16.
Attempting to start Spice-based VMs on SLES 16 will result in an error.
Existing VMs created on SLES 15 SP7 or older that use Spice must be converted to use VNC if run on SLES 16.
The virt-xml tool can be used to do this automatically beginning with virt-manager version 5.0.0.
1.1.1 Automatic conversion with virt-xml #
To automatically convert a VM using virt-xml (virt-manager 5.0.0 or newer), follow these steps:
First, back up your VM XML if you do not like what virt-xml does.
>sudovirsh dumpxml VM-NAME > VM-NAME.xmlRun the conversion command:
>sudovirt-xml VM-NAME --edit --convert-to-vnc qemu-vdagent=onWhere:
- VM-NAME
The name of the VM. See
virsh list --allon the host.--editEdit an existing XML block.
--convert-to-vncConvert an existing VM to exclusively use a single VNC graphics device.
qemu-vdagent=onUsed with
--convert-to-vncto add a qemu-vdagent device if one is not already configured. This is for copy and paste functionality between host and guest on SLES 16.
See the
virt-xmlman page for more options and details.
1.1.2 Manual conversion #
If you prefer manual conversion, follow the step-by-step guide below.
Shut down your Spice-based VM.
>sudovirsh shutdown VM-NAMESave the current XML definition for your Spice-based VM.
>sudovirsh dumpxml VM-NAME > VM-NAME.xmlOptionally save a copy of the original Spice-based definition if you mess something up.
>cp VM-NAME.xml VM-NAME-spice.xmlUsing your favorite text editor, proceed to edit the XML definition to remove or modify the Spice-based devices as follows.
1.2 Spice elements to remove #
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 Spice elements to modify #
1.3.1 Graphics and audio #
Modify the following elements:
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'/>
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>You could specify more details about the above virtio video device, but libvirt will fill in any missing details.
1.4 Applying the new configuration and starting the VM #
Redefine the guest VM based on the newly edited XML definition.
>sudovirsh undefine VM-NAME>sudovirsh define VM-NAME.xmlStart the VNC based guest VM.
>sudovirsh start VM-NAME
1.5 Restoring copy and paste functionality on VNC #
With the absence of Spice on SLES 16, the copy and paste functionality between host and guest was lost. The following steps may be done to restore this capability.
Update the
gtk-vncRPMs on the SLES 16 host to the latest available version. Copying and pasting via VNC requires an updated system. It is not supported by the packages shipped in the initial SLES 16 installation media.>sudozypper update libgtk-vnc-2_0-0 typelib-1_0-GtkVnc-2_0 libgvnc-1_0-0Enable spice-vdagentd in the running SLES guest VM.
If not installed, run
zypper in spice-vdagent.>sudosystemctl enable spice-vdagentdShut down the guest VM.
Add the channel device XML below to the guest VM XML definition. This can be done in virt-manager: select › , then set to QEMU vdagent. Alternatively, add it manually as shown below.
<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>Boot the guest VM.
2 For more information #
For further steps in virtualization, refer to the following sources:
Converting VMware Virtual Machines to KVM with virt-v2v
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.