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 ssh and 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:
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 root privileges.
The daemon will run at system startup, and you can launch it right away: