Virtualbox Linux Guest Draws Incorrect Time from Windows Host - Solution

The Linux guests running in Virtualbox on my Windows 7 host OS all run something like 12 hours fast with default settings. This seems like a minor inconvenience but is actually very problematic since I prefer to run everything save for Photoshop and Premier in Linux. Accidentally post-dating an invoice isn’t particularly charming.

I’m not sure what causes the time synchronization difficulties for me - it doesn’t seem to be a widespread issue so could be caused by something exotic; all my local network traffic routes through a VPN exiting the other side of the world, for instance, which probably isn’t a common usage scenario.

The UTC time setting tick box in the graphical VirtualBox manager doesn’t help as it seems it should:

virtualbox windows host linux guest time setting screenshot

Luckily the the Virtualbox user manual, of all things, does contain a solution under the Disabling the Guest Additions time synchronization heading:

Once installed and started, the VirtualBox Guest Additions will try to synchronize the guest time with the host time. This can be prevented by forbidding the guest service from reading the host clock:

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

I’m not a big Windows user so it wasn’t immediately clear to me how this command was supposed to be executed. What worked for me was to open cmd.exe, navigate to the Virtualbox installation folder (C:\Program Files\Oracle\VirtualBox) then enter the command as seen above (replacing VM name with the name of the virtual machine you wish to effect).

For the record, all the above relates to Ubuntu 12.04 and Linux Mint 14.1 running in Virtualbox 4.2.4 on a Windows 7 host.