How to disable time sync between host and guest

Discussions about using Windows guests in VirtualBox.
nabamer.

How to disable time sync between host and guest

Post 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
Andre.Ziegler
Posts: 62
Joined: 17. Jul 2007, 13:45
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Windows Embedded Standard 7, Windows Vista Sp2, Linux (Ubuntu, Linux Mint, Zorin)

Post 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>
h1d
Volunteer
Posts: 170
Joined: 3. Jul 2008, 02:10

Post 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'.
nabamer.

Post by nabamer. »

I found that there is only vboxservice.exe on my Windows. Unfortunately, killing it doesn't stop time sync :(
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post 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.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post 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.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
war59312
Posts: 33
Joined: 12. Aug 2008, 05:09
Location: U.S.A
Contact:

Post by war59312 »

/etc/init.d/vboxadd-timesync stop

That? Well thats for linux I guess. So surly must be a way on windows too...
h1d
Volunteer
Posts: 170
Joined: 3. Jul 2008, 02:10

Post 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. 
velrum
Posts: 7
Joined: 16. Sep 2009, 05:19
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: XP

Re: How to disable time sync between host and guest

Post by velrum »

Why the hell is doing this anyway!

Bloody annoying and unwanted.
cabetza1
Posts: 1
Joined: 17. Sep 2009, 21:01
Primary OS: Ubuntu 8.10
VBox Version: OSE Debian
Guest OSses: 2

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

Post 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.
ubshreenath
Posts: 1
Joined: 21. Mar 2010, 18:12
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Win 2003, Win 2008, Ubuntu, Vista, XP
Location: Bangalore
Contact:

Re: How to disable time sync between host and guest

Post 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
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: How to disable time sync between host and guest

Post 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.
msa.operations
Posts: 3
Joined: 24. Feb 2009, 01:10

Re: How to disable time sync between host and guest

Post 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!
fvanhoof
Posts: 3
Joined: 19. Jan 2010, 21:47
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: WindowsXP, DOS, Ubuntu
Location: Philadelphia, PA, USA

Re: How to disable time sync between host and guest

Post 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.
Lior.Albaz
Posts: 4
Joined: 30. Dec 2009, 01:34
Primary OS: MS Windows XP
VBox Version: OSE Debian
Guest OSses: DOS

Re: How to disable time sync between host and guest

Post 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.
Locked