1 diff --git i/qga/commands-posix.c w/qga/commands-posix.c
2 index 954efed01b..39c4b916ce 100644
3 --- i/qga/commands-posix.c
4 +++ w/qga/commands-posix.c
5 @@ -123,6 +123,8 @@ void qmp_guest_shutdown(bool has_mode, const char *mode, Error **errp)
6 execl("/sbin/shutdown", "shutdown", shutdown_flag, "-g0", "-y",
7 "hypervisor initiated shutdown", (char *)NULL);
9 + execl("/run/current-system/sw/bin/shutdown", "shutdown", "-h", shutdown_flag, "+0",
10 + "hypervisor initiated shutdown", (char *)NULL);
11 execl("/sbin/shutdown", "shutdown", "-h", shutdown_flag, "+0",
12 "hypervisor initiated shutdown", (char *)NULL);
14 @@ -158,11 +160,13 @@ void qmp_guest_set_time(bool has_time, int64_t time_ns, Error **errp)
16 Error *local_err = NULL;
18 + static const char hwclock_path_nix[] = "/run/current-system/sw/bin/hwclock";
19 static const char hwclock_path[] = "/sbin/hwclock";
20 static int hwclock_available = -1;
22 if (hwclock_available < 0) {
23 - hwclock_available = (access(hwclock_path, X_OK) == 0);
24 + hwclock_available = (access(hwclock_path_nix, X_OK) == 0) ||
25 + (access(hwclock_path, X_OK) == 0);
28 if (!hwclock_available) {
29 @@ -208,6 +212,7 @@ void qmp_guest_set_time(bool has_time, int64_t time_ns, Error **errp)
31 /* Use '/sbin/hwclock -w' to set RTC from the system time,
32 * or '/sbin/hwclock -s' to set the system time from RTC. */
33 + execl(hwclock_path_nix, "hwclock", has_time ? "-w" : "-s", NULL);
34 execl(hwclock_path, "hwclock", has_time ? "-w" : "-s", NULL);