Skip to content

Instantly share code, notes, and snippets.

@apphancer
Forked from aboutte/Vagrantfile
Created August 10, 2017 10:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apphancer/5f060fd42b1002c6a07d80a9ce508db0 to your computer and use it in GitHub Desktop.
Save apphancer/5f060fd42b1002c6a07d80a9ce508db0 to your computer and use it in GitHub Desktop.
Vagrantfile to set some time synchronization configs
Vagrant.configure("2") do |config|
config.vm.provider :virtualbox do |virtualbox|
# set timesync parameters to keep the clocks better in sync
# sync time every 10 seconds
virtualbox.customize [ "guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-interval", 10000 ]
# adjustments if drift > 100 ms
virtualbox.customize [ "guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-min-adjust", 100 ]
# sync time on restore
virtualbox.customize [ "guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-on-restore", 1 ]
# sync time on start
virtualbox.customize [ "guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-start", 1 ]
# at 1 second drift, the time will be set and not "smoothly" adjusted
virtualbox.customize [ "guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold", 1000 ]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment