1

I just installed spice-vdagent inside one of my VMs but it seems that spice-vdagentd is not currently running. Checking its systemd unit status shows some error about /var/run/spice-vdagentd/spice-vdagentd.pid not existing. Since /run is reset during each start it does not make sense to manually create this folder, where should I configure spice-vdagentd such that this folder gets created automatically?

3
  • The error does not mention /run, but /var/run, which is not cleared when restarting. Just create the missing directory with sudo mkdir /var/run/spice-vdagentd and try to start again: sudo service spice-vdagent start
    – ridgy
    Feb 19, 2017 at 17:26
  • On my system (Ubuntu 17.04) /var/run is just a symlink to /run
    – lanoxx
    Feb 20, 2017 at 5:54
  • You are right. What if starting servive spice-vdagent manually?
    – ridgy
    Feb 20, 2017 at 10:12

1 Answer 1

2

I've been running Ubuntu 18.04 for some years, and I've just started seeing this problem. Perhaps some update has broken things.

Every time I update packages I see this error.

Here's my fix:

# sudo vi /lib/systemd/system/spice-vdagentd.service

Find this line:

ExecStartPre=/bin/rm -f /var/run/spice-vdagentd/spice-vdagent-sock

and replace it with these lines:

#ExecStartPre=/bin/rm -f /var/run/spice-vdagentd/spice-vdagent-sock
ExecStartPre=/bin/sh -c '/bin/rm -f /var/run/spice-vdagentd/spice-vdagent-sock ; /bin/mkdir -p /var/run/spice-vdagentd'

In other words, comment out the original ExecStartPre (always good practice to leave the original code there), then put in a new ExecStartPre which does 2 things:

  1. Remove the socket file (if it exists) - this is what the original did.
  2. Make the /var/run/spice-vdagentd directory if it doesn't exist.

Now, save your changes and do this to start the daemon:

# sudo systemctl start spice-vdagent

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .