How can I force Ubuntu to use the BIOS internal clock instead of NTP or whatever its being used?

Solution 1:

By default, Ubuntu only sets the time when a network interface comes up. It does this with a small piece of the "ntp" system: ntpdate. If your machine stays connected and keeps running for days or weeks, even the best internal clock will eventually go out of sync.
Ubuntu also doesn't try to adjust your internal clock by default, and it sounds like your clock is badly adjusted. The real time clock (hardware clock) in most systems is also not very good over the long term.

So if you want better time, I can recommend two options:

  • Install the full "ntp" package to get the Network Time Protocol, which regularly looks at Internet time servers and keeps your clock within milliseconds of the right time. See some good instructions here: Install NTP.... You can also install it from the Ubuntu Software Center. This is easy and typically pretty foolproof, if your machine is usually on the Internet and doesn't have really nasty firewalls cutting off ntp.

  • Manually adjust the frequency of your internal clock, using the adjtimex package. Actually, when you install adjtimex, it runs adjtimexconfig which sets values in /etc/default/adjtimex. But it does so quickly using the hardware clock, and in my experience the results are usually somewhere between bad and terrible. Some machines are hard to tune well, but I've had good luck with most of my machines by doing the manual calculation necessary to figure out the right FREQ and TICK values to put in /etc/default/adjtimex. To go this route, start by installing adjtimex via Applications/Ubuntu Software Center. To figure out manual settings for FREQ and TICK, see the nice calculator at Tuning with adjtimex as an alternative to running ntpd. That page also notes that your choice of "clocksource" can affect how accurate your clock is. The hpet (High Precision Event Timer) seems more accurate than the tsc (Time Stamp Counter).

There are tips for dealing with other glitches at UbuntuTime - Help.ubuntu.com

Solution 2:

I'm not sure things work the way you're describing. I.e., there are no "software" clock process/application which either uses BIOS clock or an ntp server and which can be "broken" in Ubuntu but working in Windows. In any case the info you see on the screen comes from BIOS clock.

If NTP server is enabled, the data coming from it is used to adjust the BIOS/hardware clock, and, when the hardware clock is thought to be "incorrect", NTP daemon adjusts time gradually in small increments instead of setting it straight away. This is done to avoid sudden "jumps" in system time which may cause all sorts of trouble (i.e. an event which happens after some other event but at earlier time).

Which perfectly explains the behaviour you're seeing - as soon as the "correct" data comes from the NTP server, the daemon starts gradually adjusting your system time.

I think your timezone/daylight saving time may be set incorrectly. Another possibility may be that Ubuntu expects the BIOS clock to be set to UTC time while Windows sets the clock in your local timezone, which results in Ubuntu thinking your system clock are late/early by your GMT offset

This document may be helpful: https://help.ubuntu.com/community/UbuntuTime#Multiple%20Boot%20Systems%20Time%20Conflicts