Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable VirtualBox time sync from within the guest at runtime

Tags:

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:

  1. Disable the time sync at VM startup:

    VBoxManage setextradata "VM name" "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" 1

  2. Disable the guest additions from within the VM at runtime:

    sudo service vboxadd-service stop

The reasons they don't work for me are:

  1. The first option only works at startup - I need to be able to do this at runtime
  2. 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

like image 330
Nat Ritmeyer Avatar asked Jul 30 '14 15:07

Nat Ritmeyer


People also ask

How do I turn off mouse control in VirtualBox?

When the keyboard and mouse input is captured in the virtual machine, you cannot move the pointer out of the virtual machine window and all keystrokes and button clicks go to the virtual machine. To release the keyboard and mouse back to the primary OS, press Ctrl+Alt.

What is VBoxManage?

As briefly mentioned in Section 1.18, “Alternative Front-Ends”, VBoxManage is the command-line interface to Oracle VM VirtualBox. With it, you can completely control Oracle VM VirtualBox from the command line of your host operating system.


1 Answers

You should be able to edit the vboxadd-service script on the client and add the --disable-timesync option. Then sudo 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

like image 161
Stefan Winkler Avatar answered Sep 23 '22 19:09

Stefan Winkler