Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.4: Automatic time resync after Boot Camp usage System 10.4
I've noticed a wrong time setting every time I'm booting in Boot Camp. One possible solution to avoid this issue is to automatically set the date and time at every Mac OS X login. To do that, you can set "Users Deamons" in Lingon to send ntpdate -u.

Please post if you have a better solution...
    •    
  • Currently 2.33 / 5
  You rated: 3 / 5 (6 votes cast)
 
[37,053 views]  

10.4: Automatic time resync after Boot Camp usage | 19 comments | Create New Account
Click here to return to the '10.4: Automatic time resync after Boot Camp usage' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Automatic time resync after Boot Camp usage
Authored by: slb on May 07, '07 04:16:01PM

A little more detail on your Lingon setup would be nice here.
Never used it before, and it's not totally obvious.

Thanks,
SB



[ Reply to This | # ]
10.4: Automatic time resync after Boot Camp usage
Authored by: fds on May 08, '07 07:47:17AM
Check this hint from last year for a better solution:
http://www.macosxhints.com/article.php?story=2006072022590888

[ Reply to This | # ]
10.4: Automatic time resync after Boot Camp usage
Authored by: luomat on May 08, '07 08:11:25AM
I recommend that people NOT use http://www.macosxhints.com/article.php?story=2006072022590888 as there are many potential pitfalls with it, whereas this solution is much cleaner.

[ Reply to This | # ]
10.4: Automatic time resync after Boot Camp usage
Authored by: alfrank on May 08, '07 08:36:36AM

And which are these so-called pitfalls ?

I didn't experience any, I've done it several times that way without any problem !



[ Reply to This | # ]
10.4: Automatic time resync after Boot Camp usage
Authored by: TonyT on May 08, '07 04:08:49PM

Here's why not to use this hint:
http://www.cl.cam.ac.uk/~mgk25/mswish/ut-rtc.html



[ Reply to This | # ]
10.4: Automatic time resync after Boot Camp usage
Authored by: eric_trepanier on May 08, '07 09:46:28AM
  • Download Lingon: http://prdownloads.sourceforge.net/lingon/Lingon-1.2.dmg?download
  • Copy the Lingon application to your /Applications folder
  • Launch the Lingon application
  • Click the toolbar's "Assistant" button (bow-tie icon)
  • Make sure that "Run a job at startup" radio button is selected and click "Next"
  • In the "Label" field, type in a name for this task, using reverse-domain naming (e.g. org.johndoe.ntpdate)
  • Uncheck the "Launch only when I log in" checkbox
  • Check "Must be run as root" (this checkbox will be enabled when you un-select the one above)
  • Click "Next"
  • In the "Job" field, type "/usr/sbin/ntpdate -u" and click "Create"
  • At this point, you should be prompted to authenticate as an admin user

If you successfully authenticated yourself, you should now be looking at the "User Daemons" tab, with your new entry (identified by the label you provided) marked as Loaded (prefixed by green little play-like icon).

You can quit Lingon at this point - that ntpdate command should be issued as root the next time you reboot, which will cause an immediate re-synch of the of the system's date & time against Apple's time servers.

Obviously, you must be online for the time-synch operation to succeed.

[ Reply to This | # ]

10.4: Automatic time resync after Boot Camp usage
Authored by: slb on May 08, '07 04:29:31PM

Thank you, Eric.
I was close, but not quite there on my own.

Cheers,
Scott



[ Reply to This | # ]
10.4: Automatic time resync after Boot Camp usage
Authored by: gxw on May 08, '07 05:29:54PM

Been awhile since I used boot camp but I am sure this issue was fixed in either a Bootcamp update or an imac firmware update.



[ Reply to This | # ]
Boot Camp 1.1.2 fixes this
Authored by: gxw on May 08, '07 05:47:04PM
Bootcamp 1.1.2 fises the time sync issue

http://www.apple.com/macosx/bootcamp/?www.reghardware.co.uk

"Updated drivers, including but not limited to trackpad, AppleTime (synch), audio, graphics, modem, iSight camera"

[ Reply to This | # ]
Boot Camp 1.1.2 fixes this
Authored by: slb on May 08, '07 06:08:53PM

I've still seen it happen in 1.1.2.

SB



[ Reply to This | # ]
Boot Camp 1.1.2 fixes this
Authored by: eric_trepanier on May 08, '07 07:38:28PM

For me, going from Mac to Windows keeps the correct time, but when going back to Mac from Windows, I always lose 4 hours, even with the latest Boot Camp 1.2 drivers.

The proposed fix above seems to work for me, so I am happy, but I still wish Apple would solve this issue once and for all. This is getting pretty ridiculous.



[ Reply to This | # ]
Boot Camp 1.1.2 fixes this
Authored by: wallybear on May 09, '07 02:29:34AM

I confirm that the problem was fixed in previous release of BootCamp. I installed lot of MacBook/MacBookPro/iMac/Mini from then once with no more time issues.
Try reinstalling BootCamp drivers, you could find that not all of them were installed correctly.



[ Reply to This | # ]
10.4: Automatic time resync after Boot Camp usage
Authored by: BC_ME on May 08, '07 06:34:05PM

We have seen a similar issue in our machines, the only issue is that in an AD environment you need the time to sync before login. To combat this, we added (or edited, if one already exists) the rc.local file in /etc with the following bash script that kills ntpd, tries up to 5 times to see if a timeserver can be contacted and then restarts network time to resync the time. This seems to work ok. It probably could be cleaner but it works for us.

#!/bin/bash

killall ntpd

/usr/sbin/ntpdate
RETVAL=$?
TRIES=1
sleep 1
until [[ "$RETVAL" == "0" || "$TRIES" == "5" ]]; do
/usr/sbin/ntpdate
RETVAL=$?
sleep 1
TRIES=`expr $TRIES + 1`
done;

. /System/Library/StartupItems/NetworkTime/NetworkTime start



[ Reply to This | # ]
10.4: Automatic time resync after Boot Camp usage
Authored by: apfhex on May 08, '07 07:25:22PM

This is a question about incorrect time settings in OS X after having been in Windows, yeah? So far my Mac always has the correct time when I boot OS X because it syncs with the network time servers immediately after login (I assume — there's no clock on the login screen)... I guess this question would then be for people who don't have always-on internet, or don't want to sync with Apple's time servers, or need the time to be corrected before login?



[ Reply to This | # ]
10.4: Automatic time resync after Boot Camp usage
Authored by: BC_ME on May 08, '07 07:52:02PM

Exactly. Kerberos logins require no more than a 5 minute tme difference between client machine and authenticating server so a time sync is almost required before login in this situation. As a side note, there is a clock on the loginwindow in 10.4. Just click on the Computer Name a few times, it will cycle throug serial number, OS version, Date and time and some other things.



[ Reply to This | # ]
10.4: Automatic time resync after Boot Camp usage
Authored by: mchinemail on Jul 05, '07 06:00:50PM

I've seen some incorrect information regards this issue and would like to clarify. 1) Bootcamp utility AppleTime only solves the issue of booting from OSX into Vista. It does not address the reverse situation of booting BACK into OSX from Vista.

2) In theory, if OS X checked the internet time right after login, there would be no issue, but I found on every system I use that even after login, OS X does NOT automatically check the internet and reset the clock back to correct time. This is even with the "set date and time automatically" option checked in System Prefs. I've personally watched and waited, and have seen some systems go several hours before correcting the clock. I don't know what the algorithm is that is used (anyone know?), but one would think that right after login would be a logical time to sync the clock, if the option is checked. Now, it may be I have something else wrong, and would welcome any input, but other than checking the box for "set date and time automatically", what else is to be done? (Other than manually opening system prefs and selecting Date/Time, then OS X dutifully goes out to the time server and retrieves the correct time.)

Therefore, this Lingon solution is useful, and not just for people who need correct time before login, as I can attest, even after login, OS X does not automatically sync the clock. I learned this the hard way using file synchronization software (Chronosync). I ran Chronosync after booting back from Vista one day, without noticing the clock, and Chronosync thought my source files were OLDER than the targets and overwrote them. This was because due to the clock being wrong, OS X thought the file modification time stamps on the source files were all 12 hours back from what they "really" were, and decided they need to overwritten by targets, even though in reality the targets were either older or the same.

My solution up till now (before I learned of Lingon) was to set Vista to use GMT time.



[ Reply to This | # ]
10.4: Automatic time resync after Boot Camp usage
Authored by: mchinemail on Jul 05, '07 06:31:44PM

Well, I tried Lingon, and it ran, but didn't update the clock. After a little more investigation in the logs, I figured out why, and it also explains why OS X doesn't resync at login, even with the "set date and time automatically" option checked.

It's because for some reason, my system doesn't have internet access at the point just before login. I confirmed by clicking on the version Number at the login screen. It shows my network isn't connected yet.

So the solution to my problem is trying to understand why I don't have access to the internet at the time of login. If I fix that, then OS X's automatic sync option should work.

I'm on a home network, cable modem, Apple Airport Extreme router (11g version). Everything is set to DHCP. It appears I have an assigned IP.

Other option is to run the /usr/sbin/ntpdate -u command after login using a script or CRON.



[ Reply to This | # ]
10.4: Automatic time resync after Boot Camp usage
Authored by: genr8r on Sep 05, '07 11:07:58AM
I saw this in the Apple support section and I wondered if this might work?

http://docs.info.apple.com/article.html?artnum=303731

I have performed all the steps but I haven't gone through booting Windows and then back to see if it worked. I will post back later if I get bored and need to play some games.

[ Reply to This | # ]
10.4: Automatic time resync after Boot Camp usage
Authored by: downcat on Nov 05, '08 04:42:33AM
Although this issue is old, the "don't have to download something" solution is this:

(1) Create a file with the following contents:
#!/bin/sh
/usr/sbin/ntpdate -u

(2) Create a login hook which points to that script:
sudo defaults write com.apple.loginwindow LoginHook /path/to/script

(3) There is no 3.

Info on login hook: http://support.apple.com/kb/HT2420

Down Cat

[ Reply to This | # ]