Solving SPICE Agent Issues in Debian Trixie on VirtManager

Debian 13 “Trixie,” currently in its alpha stage, is an exciting release for those who enjoy exploring the latest in Linux development. However, setting it up as a virtual machine (VM) on Virt-Manager can present some challenges, especially when configuring features like automatic screen resizing and clipboard sharing between the host and guest using the SPICE agent.

If you’re trying to set up Debian Trixie and run into issues, this guide will walk you through the steps to resolve them.

To install Debian Trixie, you can download the latest netinstall ISO from the official Debian website

Screenshot of the official Debian website showing the download page for Debian 13 Trixie netinstall ISO for installation in VirtManager.

The Problem:
SPICE Agent Fails to Enable

After installing Debian Trixie in a VM on Virt-Manager, you might notice that features like screen resizing and copy-paste between the host and guest don’t work as expected. Installing the spice-vdagent package and starting its service
sudo systemctl start spice-vdagent
works without errors, but enabling it
sudo systemctl enable spice-vdagent
throws a warning or error like this:

The unit files have no installation config (WantedBy=, RequiredBy=, UpheldBy=, Also=, or Alias= settings in the [Install] section, and DefaultInstance= for template units …

This issue occurs because the spice-vdagent.service file lacks an [Install] section that tells systemd how to enable it at boot.

The Solution:
Fixing the SPICE Agent Service File

To resolve this issue, follow these steps:

Step 1: Edit the Service File

  1. Open the spice-vdagent.service file with a text editor:
    sudo nano /lib/systemd/system/spice-vdagent.service

  2. Add the following lines at the end of the file:
    [Install]
    WantedBy=multi-user.target


  3. Save and close the file.

Step 2: Reload System

After editing the service file, reload systemd to apply your changes:
sudo systemctl daemon-reload

Step 3: Enable the Service

Now you can enable the SPICE agent service without errors:
sudo systemctl enable spice-vdagent

Step 4: Reboot Your VM

To activate automatic screen resizing and clipboard sharing features, reboot your VM:
sudo reboot

After rebooting, ensure that:

  • Automatic screen resizing works when you resize your VM window. Go to:
    • View
    • Scale Display
    • and select: Autoresize VM with window
  • Copy-paste functionality between host and guest is enabled
Screenshot showing how to enable the 'Autoresize VM with window' option in Virt-Manager for Debian Trixie, located under View > Scale Display settings.

If you’re setting up Debian Trixie on Virt-Manager and encounter this issue, I hope this guide helps you solve it quickly so you can focus on exploring everything Debian has to offer!
Feel free to share your experiences or additional tips in the comments below. Let’s make Linux accessible for everyone! 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.