Score:0

Linux guest on Hyper-V host, realtime clock, UTC or local - sync with AD DC

it flag

I'm installing a Debian 11 Linux guest on a Hyper-V cluster. Hosts' realtime clocks are set to local time, as is the norm for Windows Servers; unlike the preference of Unix-like OSes. Should I execute timedatectl set-local-rtc 1 on the Linux guest, to be in line with its hosts?

Setting real time clock to local time on Linux systemd servers reports this:

Warning: The system is configured to read the RTC time in the local time zone.
     This mode can not be fully supported. It will create various problems
     with time zone changes and daylight saving time adjustments. The RTC
     time is never updated, it relies on external facilities to maintain it.

If time is synced with an NTP source or from the hypervisor, will there be any potential problems? That's the first part of my question.

Second part,

  • Can systemd timesyncd or ntpd sync time with a Windows AD time server (the DC holding the PDC emulator role)? My initial attempt failed for both services. Of course sync time with host was unchecked on VM's settings.
  • As an alternative, is syncing time from HyperV host (which in turn is in sync with AD DC) trustworthy?
cn flag
In Windows AD is always the preferred time sync source, anything else is last resort.
Score:0
cn flag
timedatectl set-local-rtc 0

Set RTC to UTC. Per that warning, the annoyance of local RTC is not worth it when the clock can actually be managed with other means.

pool ad.example.net
# Optional PTP config for chrony
#refclock PHC /dev/ptp0 poll 3 dpoll -2 offset 0

AD DS runs a NTP service on all DCs by default. Set ntp.conf or chrony.conf to the domain name. Hyper-V also makes available a PTP "hardware" clock to share the hosts time with very low latency.

Confirm Hyper-V hosts have the correct time. Probably they should be domain members and follow the domain in this regard.

Ensure Hyper-V guest integration is installed. May be already, I'm not positive what Debian kernels are doing. hv_vmbus driver is sufficient to allow Time Synchronization.

You may use NTP, Hyper-V time sync, or both.

Krackout avatar
it flag
But if I set the VM on UTC and sync with host, will I get proper time, since host is set on local time? I'll check. I'll also try domain name in ntp.conf; in my first failed tests I used the name of the DC holding the PDC emulator role. (dns resolving works correctly)
John Mahowald avatar
cn flag
I cannot find a citation for exactly how Hyper-V manages RTC separate from the time sync service. If you run NTP pointed at the domain, the guest will agree with the rest of domain joined machines. Watch for big steps by NTP in the log, which might not be a big problem depending on what this host requires.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.