[SOLVED] Time is Correct in Linux, But Wrong in Domain Controller

Linux thinks the time is set to UTC by default, so I used timedatectl set-local-utc true to have it set it to local time instead of UTC. Both Windows and Linux had Eastern time zone set correctly. But in Windows domain controller, the time is 5 hours ahead. As a domain administrator, how do I get the time in my Windows domain controller to match with Linux?

Note: Even as a domain administrator, Windows won’t let me set the time in Date and Time settings because it’s been managed by my organization; however, I am not an organization; I have Windows Server setup in my virtual homelab.

Okay, I solved the problem. Domain administrators managing the domain controller VM in a Linux host must edit the registry in order to change from local time to UTC.

In case the site goes down, this is what needs to be added:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
  "RealTimeIsUniversal"=qword:00000001

I really wish Microsoft should start changing the time from local time to UTC time in the future in order to co-exist with Linux, but I know Microsoft does not want Linux in servers and desktop computers.

Oh, and edit the registry with the above setting for the secondary domain controller as well. And since my Windows desktop is now a member of Windows Server Active Directory, I would have to restart my computer in order to force the synchronization of time, as the “Sync Now” button is greyed out.

Update: Now 2FA for Twitter is now working with the correct time set! Hooray! :grinning:

Windows time is junk! I fight with my dedicated AD servers often and run local GPS NTP clocks to sync them with.

That said, I don’t remember having time issues when I had Server 2022 eval running on XCP-NG, it just seemed to work as well as it ever does. I’ll be finding out soon as I move my AD from dedicated hardware over to XCP-NG.

1 Like