apphancer
8/10/2017 - 10:49 AM

Vagrantfile to set some time synchronization configs

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