Page 1 of 2

How to disable time sync between host and guest

Posted: 8. Aug 2008, 06:03
by nabamer.
Hello,

Could anybody please tell me if there is anyway I could disable the time synchronization between Linux host and Windows guest (with VBox Addition installed)? I can't find any option in VirtualBox to do this.

Thank you in advance

Posted: 8. Aug 2008, 07:50
by Andre.Ziegler
You can't do this. The only chance to set back the Date in VirtualBox is to run the following command:

Code: Select all

VBoxManage modifyvm <name> -biossystemtimeoffset -<milliseconds>

Posted: 8. Aug 2008, 08:09
by h1d
I thought there's a process called vbox-timesync or something that does it. You should be able to disable it via 'msconfig'.

Posted: 11. Aug 2008, 08:49
by nabamer.
I found that there is only vboxservice.exe on my Windows. Unfortunately, killing it doesn't stop time sync :(

Posted: 11. Aug 2008, 13:13
by TerryE
AFAIK, the time sync runs as a service in NT guests. Look for it in the service manager . This still won't help because when you boot NT still takes its time from the BIOS.

Posted: 11. Aug 2008, 20:45
by Sasquatch
I recall a command that one of the devvers here posted to disable timesync. It was asked before and that command stopped it. I just don't know who and where it was posted, other than that it was on the forums here.

Posted: 12. Aug 2008, 05:42
by war59312
/etc/init.d/vboxadd-timesync stop

That? Well thats for linux I guess. So surly must be a way on windows too...

Posted: 12. Aug 2008, 12:16
by h1d
I don't know why you need this done, but perhaps, run a custom script upon bootup to set the time to the zone you wish it to be after stopping the timesync process maybe.
 Edit:  i actually went to see about the process, but there's only vboxtray in the guest, not in the services list either. 

Re: How to disable time sync between host and guest

Posted: 16. Sep 2009, 05:23
by velrum
Why the hell is doing this anyway!

Bloody annoying and unwanted.

Solved Re: How to disable time sync between host and guest

Posted: 17. Sep 2009, 21:43
by cabetza1
Well... Silly, but works me (test script for automated charges to database involving periods of time) just change the time of the HOST, the guest automatic change the time, at least work with Win XP sp3 as guest.

Re: How to disable time sync between host and guest

Posted: 21. Mar 2010, 18:30
by ubshreenath
If this is still unsolved, here is what worked for me:
If your guest operating system is Windows (Any ver), Time Sync will happen only when you have installed the Guest Additions.

So method 1 would be to uninstall the Guest Additions - but then you lose mouse integration and display resoultion adaptation along with other benefits.

Other option would be to go to the Services mmc (services.msc) and disable the VirtualBox Guest Additions service and stop it. This will stop the time sync as it did for me while the mouse pointer and display resoultion did not get affected.

There were command line options for the VirtualBoxService.exe (--disable-timesync) but that did not work for me. If that worked for anyone, please let me know how you achieved it. Also got to know of running the VBoxManage.exe from the host machine and setting a paramter for the specific Virtual Image but I didn't try that either since disabling and stopping the service was easier for me! Got this info from the Virtual Box Help so you can use that as reference to do your own thing.

Cheers
Sreenath
http://sreenath.net

Re: How to disable time sync between host and guest

Posted: 24. Mar 2010, 12:41
by mpack
ubshreenath wrote:If your guest operating system is Windows (Any ver), Time Sync will happen only when you have installed the Guest Additions.
It rather depends what you mean by "time sync". Even Win98 has time sync (in the sense of showing the same date/time as the host on startup), despite the GAs not being available at all for that platform. The guest reads time from the BIOS, which in turn reads it from a virtual RTC (real time clock) device: virtual hardware, not a GA service. The virtual hardware of course gets the current date and time from the host as the VM starts up. .... So if you are hoping that your trial software will not expire if you disable time sync then I'm afraid you are out of luck.

AFAIK: the time-sync service in the GAs has nada to do with the above, the only thing I can think it is responsible for is maintaining close sync with the host (and the outside world) if the VM is left running for long periods, rather than depending on (say) a timer interrupt running inside the guest.

Re: How to disable time sync between host and guest

Posted: 2. Sep 2010, 05:53
by msa.operations
Sorry to resurrect such an old thread, but it's the #1 Google search result for the topic.

This can now be done using VBoxManage utility. It's a command-line tool, which is available in the Virtualbox install folder in Windows or in ~/Library/Virtualbox on Mac.

Turn off time syncing:
vboxmanage setextradata [VMname] "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" "1"

Turn it back on:
vboxmanage setextradata [VMname] "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" "0"

note: [VMname] is the name of your virtual machine.

Hope this helps someone!

Re: How to disable time sync between host and guest

Posted: 15. Oct 2010, 12:40
by fvanhoof
Worked great and helped a lot. To answer those who can't wrap their mind around why someone would want to do that I'll give you my reason. Software testing. I run multiple guests to simulate a network of PCs. They have their own built in time sync mechanism. I have to test that so I need the ability to drive them out of sync in order to test their ability to synchronize.

Re: How to disable time sync between host and guest

Posted: 23. Feb 2011, 18:03
by Lior.Albaz
Only note that the above comman-line actully add a new entry in mechine XML file under <ExtraData>
The problem is that VM still sync time/date after power-up.

<ExtraData>
<ExtraDataItem name="GUI/InfoDlgState" value="400,450,normal"/>
<ExtraDataItem name="GUI/LastCloseAction" value="shutdown"/>
<ExtraDataItem name="GUI/LastGuestSizeHint" value="800,600"/>
<ExtraDataItem name="GUI/LastWindowPostion" value="132,44,800,642"/>
<ExtraDataItem name="GUI/MiniToolBarAlignment" value="bottom"/>
<ExtraDataItem name="GUI/SaveMountedAtRuntime" value="yes"/>
<ExtraDataItem name="GUI/ShowMiniToolBar" value="yes"/>
<ExtraDataItem name="VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" value="1"/>
</ExtraData>

so change this entry in <BIOS> when 31104000000 is in msec back in time one year.
calculate for other time.
<TimeOffset value="-31104000000"/>

Too bad there isn't away to set VM RTC (real time clock) to a fix date/time beftor VM start.