Install the SPICE guest agent tools on a Debian-based system in VM

Max Kombarov
2 min readOct 7, 2023

--

To install the SPICE guest agent tools on a Debian-based system (such as Debian itself or Ubuntu), you can follow these steps:

Open Terminal: Open a terminal window on your Debian-based virtual machine.

Update Package Lists: It’s a good practice to update the package lists to ensure you’re installing the latest available software packages. Run the following command:

sudo apt update

Install SPICE Guest Tools:

Depending on your Debian version and repository configuration, you can typically install the SPICE guest agent tools using the following command:

sudo apt install spice-vdagent

This command will install the SPICE guest agent tools, which include the necessary components for enhanced interaction between the guest and the host when using SPICE.

Start the SPICE Agent Service:

Once the installation is complete, you should start the SPICE agent service. Use the following command:

sudo systemctl start spice-vdagent

Additionally, you can enable the service to start automatically at boot:

sudo systemctl enable spice-vdagent

Check the SPICE Agent Status:

You can check the status of the SPICE agent service to ensure it’s running without issues:

sudo systemctl status spice-vdagent

This should display information about the service, including whether it’s active and running.

Restart or Reboot: Sometimes, it may be necessary to restart the virtual machine or log out and log back in to ensure that the SPICE agent tools are fully integrated with your desktop environment.

If that the directory /etc/systemd/system/spice-vdagent.service.d/ doesn't exist by default on your system. In this case, you can create the directory and the override file manually. Here's how to do it:

Create the Directory:

Run the following command to create the necessary directory:

sudo mkdir -p /etc/systemd/system/spice-vdagent.service.d/

Create the Override File:

Now, create the override file with the necessary content:

sudo nano /etc/systemd/system/spice-vdagent.service.d/override.conf

Add the following lines to the file:

[Service] ExecStart= ExecStart=/usr/sbin/spice-vdagentd

Save the file and exit the text editor.

Reload systemd and Enable the Service:

Reload systemd to apply the changes and enable the spice-vdagent service:

sudo systemctl daemon-reload sudo systemctl enable spice-vdagent

Check the SPICE Agent Status:

Finally, you can check the status of the SPICE agent service to ensure it’s running without issues:

sudo systemctl status spice-vdagent

This should display information about the service, including whether it’s active and running.

By following these steps, you should be able to manually create the override file and enable the spice-vdagent service on your Debian-based system. This will ensure that the service starts automatically at boot with the desired configuration.

--

--