Qemu guest agent on Hetzner Cloud doesn't work

I’m using the option services.qemuGuest.enable = true in my config and I can see the qemu-ga service is running correctly. Now, when I try resetting the root password from the Hetzner Cloud dashboard, which uses the qemu guest agent, I get a “server password reset has failed” (but I get a “info: guest-ping called” in the qemu guest logs).

However if I stop the service, run qemu-ga manually (as root) and try the “reset root password” feature in the dashboard, it works.

Any idea what’s going on? Could it be related to the way systemd runs the service?

I found the culprit by stracing the agent process:

access("/nix/store/gd3nl6hcc8mzq8fmxdvl6czh3l0n4la5-coreutils-8.31/bin/chpasswd", X_OK) = -1 ENOENT (No such file or directory)

In the systemd unit, the PATH is set to a list of directories, but it’s missing the path to shadow. I added the following and now it’s working. :tada:

systemd.services.qemu-guest-agent.path = [ pkgs.shadow ];

1 Like