Virtualization is great! It allows me to mess up with my Jenkins setup trying to figure out how to configure iOS jobs with tests (jumping through a number of hoops on the way, hi Apple!). One point though is that the guest OS X in VirtualBox has terribly slow graphics, and also freezes after some time. Only restart helps. Hopefully, I usually need
jenkins web interface only. Read about how to set that up here: Jenkins in OSX guest in VirtualBox for iOS jobs – full setup guide.
Anyway, due to missing VBox additions on OSX guest, time doesn’t update when the machine is suspended and then resumed. Plus, there is a constant time drift. Explanations here: https://forums.virtualbox.org/viewtopic.php?f=22&t=48233.
My solution is to synchronize with NTP time server repeatedly. Linux distros have the famous
cron daemon, and so does OS X, however it’s deprecated in favor of
launchd. Create file at
/Library/LaunchDaemons/org.virtualbox.updatetime.plist with the following contents:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
The owner and group should be
root:wheel, so you can run
if you downloaded the file. It has to be a system daemon (indicated by its location in
/Library/LaunchDaemons/) because updating system time requires the
The daemon will run at system startup, and you can launch it right away:
Now, the time is updated every three minutes automagically, which is especially important for Jenkins builds.