I have a VirtualBox VM running Centos 6.5 with Guest Additions installed and I need to be able to disable and enable time sync from within the guest at will. By default, the guest syncs its time with the host every 10 seconds[1], this is functionality built into the Guest Additions.
There are ways to disable the time sync but they are inadequate for my needs:
-
Disable the time sync at VM startup:
VBoxManage setextradata "VM name" "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" 1
-
Disable the guest additions from within the VM at runtime:
sudo service vboxadd-service stop
The reasons they don't work for me are:
- The first option only works at startup – I need to be able to do this at runtime
- The second option stops other functions that I need from the guest additions
When I run sudo VBoxControl guestproperty enumerate
I don't see anything to do with time syncing.
So… a way to disable and enable time sync from within a VirtualBox VM without disabling the vboxadd-service
service please 🙂
[1] https://www.virtualbox.org/manual/ch09.html#disabletimesync – Section 9.13.4
Best Answer
You should be able to edit the
vboxadd-service
script on the client and add the--disable-timesync
option. Thensudo service vboxadd-service restart
and time sync should be disabled.See also https://www.winklerweb.net/index.php/blog/11-tools/25-disabling-time-synchronization-in-virtualbox-ubuntu-16-04