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?
1 Answer
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:
- Remove the socket file (if it exists) - this is what the original did.
- 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
/run
, but/var/run
, which is not cleared when restarting. Just create the missing directory withsudo mkdir /var/run/spice-vdagentd
and try to start again:sudo service spice-vdagent start