How to coordinate the clock when dual-booting with Windows

Duane Whitty duane at nofroth.com
Mon Dec 11 23:15:42 UTC 2017



On 17-12-11 06:48 PM, Kevin O'Gorman wrote:
> On Mon, Dec 11, 2017 at 1:07 PM, Drew Einhorn <drew.einhorn at gmail.com
> <mailto:drew.einhorn at gmail.com>> wrote:
> 
>     This is interesting, but I'm uncertain how to use it.  I found the
>     list of servers in the registry.  I didn't put them there, but there
>     are 5, and number 5 appears as the default.  It is time-b.nist.gov
>     <http://time-b.nist.gov> which I sure hope is not unreliable. 
>     However, I still get Windows showing the time off by 8 hours when it
>     boots up, and I'm supposing that's because it is using the time in
>     the BIOS DRAM, but I'm unsure because as near as I can tell the BIOS
>     is set to local time; at least that's what I see when I'm in BIOS
>     setup.  Frankly I'm all confused.
> 
>     It would be nice if Windows would use nist.gov <http://nist.gov> and
>     apply the timezone, ignoring BIOS completely.
> 
>     -- 
>     Kevin O'Gorman
>     #define QUESTION ((bb) || (!bb))   /* Shakespeare */
> 
>     	Please consider the environment before printing this email.
> 
> 
>     NTP is probably assuming system clock is UTC and correcting based on
>     your time zone settings. This way ntp can assume all clocks are UTC
>     and not have figure out all the relevant time zone corrections.
> 
>     Does this make sense for your time zone?
> 
>     Remote users can set their time zone environment variables for their
>     local time zone. Things work out nicely on Unix or Linux based systems.
> 
>     I don't know If there is a right way to configure Windows so it
>     knows the hardware clock is UTC and the user time zone is different.
>     If not, you have different issues depending on whether the hardware
>     clock is UTC or local time. You may have to decide which issues are
>     the bigger problem.
> 
>     Windows may screw things up for spring and fall daylight savings
>     adjustments, if Windows thinks the hardware is on local time when
>     it's really on UTC.
> 
>     If the latest updates are not installed, your systems may change to
>     or from daylight savings on the wrong weekend. This can be an issue
>     for all operating systems.
> 
>     My daughter's alarm clock switched itself from daylight savings time
>     to standard time on the wrong weekend this year. And, there is no
>     way to update the rules for when to change.
> 
> 
> I reorganized this reply.  Please bottom-post on the list.
> 
> What you say sounds good, but it's a bit confusing to me.  Both Windows
> and Linux are NTP-capable, so when you write "NTP is ...." you don't say
> which one you mean.  But I take it you're writing about Linux NTP, and
> what you wrote agrees with what I think I knew about Linux.  I am not
> aware of a way to configure Windows to do what Linux does, but there's
> been some talk about making Linux do what Windows does instead.  I
> thought I had done it but it didn't work, and now I have a situation I
> don't understand at all.  Follow along with me....
> 
> I'm running Linux and Linux thinks it's 2 PM on Dec 11 PST.  Which it is.
> I reboot and enter BIOS setup.  BIOS thinks it's 2 PM on Dec 11, which
> it still is in this time zone but AFAIK BIOS has no concept of time
> zones.  Maybe my fix worked and linux is storing local time.  But wait,
> let's check.
> I boot into Windows.  Windows thinks it's 6 AM on Dec 11, which is 8
> hours off.  I didn't think Windows could do that, as I wrote above.
> So I fix it.  Windows now thinks it's 2 PM on Dec 11.  I reboot.
> In BIOS, the time is 22:xx (10 PM). off by 8 hours.  So Windows changed
> the BIOS time either when I changed the time or when it shut down, or
> both, and set it to UTC based on Windows' knowledge that we're in the
> UTC-8:00 zone.
> Linux comes up and thinks it's 2 PM on Dec 11 PST.  Which it is.  But
> this is weird.  I was expecting it to accept the BIOS time of 10 PM as
> being local time.
> 
> On a hunch, I ran ntpdate, and here's a new piece of the puzzle:
> 11 Dec 14:37:01 ntpdate[6074]: no servers can be used, exiting
> 
> So now I think I should be configuring NTP.
> 
> /etc/ntp.conf contains a few lines that look like NTP servers.  They
> must have come with the distro:
> # Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board
> # on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for
> # more information.
> pool 0.ubuntu.pool.ntp.org <http://0.ubuntu.pool.ntp.org> iburst
> pool 1.ubuntu.pool.ntp.org <http://1.ubuntu.pool.ntp.org> iburst
> pool 2.ubuntu.pool.ntp.org <http://2.ubuntu.pool.ntp.org> iburst
> pool 3.ubuntu.pool.ntp.org <http://3.ubuntu.pool.ntp.org> iburst
> 
> # Use Ubuntu's ntp server as a fallback.
> pool ntp.ubuntu.com <http://ntp.ubuntu.com>
> 
> So why are no servers usable?  Is it possible my router is blocking
> NTP?  Is it possible the standard config file is bad?  This is Ubuntu
> 16.04.3.
> 
> Clues, anyone?
> 
> -- 
> Kevin O'Gorman
> #define QUESTION ((bb) || (!bb))   /* Shakespeare */
> 
> 	Please consider the environment before printing this email.
> 
> 
> 
> 
I'm pretty sure Windows has ever only supported setting the hardware
clock to local time. Also, doesn't Microsoft run some time servers that
Windows systems should use?  If so I wouldn't connect to NTP servers
that expect UTC.

Could hwclock (8) work?  I.e., manually set the bios/hardware clock to
local time which Windows uses/expects and use #hwclock -w to set the
system time from the hardware time on your Linux system.

Best Regards,
Duane

-- 
Duane Whitty
duane at nofroth.com



More information about the ubuntu-users mailing list