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?
Asked
Active
Viewed 6,183 times
1
lanoxx
- 1,155
- 2
- 11
- 26
-
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 '17 at 17:26
-
On my system (Ubuntu 17.04) /var/run is just a symlink to /run – lanoxx Feb 20 '17 at 05:54
-
You are right. What if starting servive spice-vdagent manually? – ridgy Feb 20 '17 at 10:12
1 Answers
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:
- Remove the socket file (if it exists) - this is what the original did.
- Make the
/var/run/spice-vdagentddirectory if it doesn't exist.
Now, save your changes and do this to start the daemon:
# sudo systemctl start spice-vdagent
BeastOfCaerbannog
- 12,964
- 10
- 49
- 77
russellr
- 81
- 1
- 6