From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 717D41FF0DE for ; Thu, 19 Nov 2026 11:43:22 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 0F761217D3; Thu, 19 Nov 2026 11:43:08 +0100 (CET) From: Jakob Klocker To: pve-devel@lists.proxmox.com Subject: [PATCH pve-docs] qm: guest agent: document sync-time-on-resume option Date: Thu, 19 Nov 2026 11:39:24 +0100 Message-ID: <20261119103924.156068-1-j.klocker@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1795084803284 X-SPAM-LEVEL: Spam detection results: 0 AWL 1.181 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: 7BP4BOL2WIB6BKI6U2L4BBPB7A4VGYL4 X-Message-ID-Hash: 7BP4BOL2WIB6BKI6U2L4BBPB7A4VGYL4 X-MailFrom: j.klocker@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Add a section about the new 'sync-time-on-resume' agent option to the QEMU Guest Agent docs. Signed-off-by: Jakob Klocker --- qm.adoc | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/qm.adoc b/qm.adoc index 18a4fbe..6e86b60 100644 --- a/qm.adoc +++ b/qm.adoc @@ -1660,6 +1660,68 @@ IMPORTANT: Disabling this option can potentially lead to backups with inconsistent filesystems. Therefore, adapting the QEMU Guest Agent configuration in the guest is the preferred option. +[[qm_qga_time_sync]] +Guest Clock Synchronization +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +While a VM is paused, the guest's clock does not advance. The same applies when +a VM continues from a previously saved state, for example after hibernation or +after rolling back to a snapshot that includes RAM. Once the VM runs again, the +guest's clock lags behind the host's time. A time synchronization service in +the guest, such as NTP, may correct a large offset only slowly or not at all, +depending on its configuration. Until then, time-sensitive services can +misbehave. + +With the `sync-time-on-resume` option enabled, {pve} sets the guest's clock to +the host's current time via the `guest-set-time` QEMU Guest Agent command right +after the following operations: + +* resuming a paused VM +* resuming a hibernated VM +* rolling back to a snapshot that includes RAM +* taking a snapshot of a running VM +* live migrating a VM to another node +* performing a backup in suspend mode + +The option is disabled by default. To enable it in the GUI, open the 'Options' +panel of the virtual machine, then the 'QEMU Guest Agent' dialog, and enable +the 'Synchronize guest clock after resume, snapshot, rollback or migration' +option. On the command line, add `sync-time-on-resume=1` to the `agent` option, +keeping any other agent options you have already set, for example: + +---- +# qm set --agent 1,sync-time-on-resume=1 +---- + +.Overriding the Option for a Single Operation +For a single operation, the configured value can be overridden with the +`--sync-time-on-resume` parameter. This is supported when resuming a paused or +hibernated VM (`qm resume`), starting a hibernated VM (`qm start`), and rolling +back to a snapshot with RAM (`qm rollback`). With `1`, the clock is +synchronized even if the option is disabled; with `0`, it is not +synchronized even if the option is enabled. For example, to resume a +VM without synchronizing its clock: + +---- +# qm resume --sync-time-on-resume 0 +---- + +Taking a snapshot, live migrations and backups always use the configured value. + +.Rolling Back to a Snapshot +When rolling back to a snapshot with RAM, {pve} decides whether to synchronize +the clock as follows: + +* If the `--sync-time-on-resume` parameter is given, its value is used. +* Otherwise, if the guest agent is enabled in the configuration before the + rollback, its `sync-time-on-resume` setting is used (disabled if not set). + This way, the current setting also applies to snapshots taken before the + option was enabled. +* Otherwise, the `sync-time-on-resume` setting stored in the snapshot is used. + +In any case, the guest agent must be enabled in the snapshot's configuration, +since the restored VM runs with the hardware configuration of the snapshot. + Troubleshooting ^^^^^^^^^^^^^^^ -- 2.47.3