How to disable time sync between host and guest

Discussions about using Windows guests in VirtualBox.

How to disable time sync between host and guest

Postby nabamer. » 8. Aug 2008, 06:03

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

Postby Andre.Ziegler » 8. Aug 2008, 07:50

You can't do this. The only chance to set back the Date in VirtualBox is to run the following command:

Code: Select all   Expand viewCollapse view
VBoxManage modifyvm <name> -biossystemtimeoffset -<milliseconds>
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)

Postby h1d » 8. Aug 2008, 08:09

I thought there's a process called vbox-timesync or something that does it. You should be able to disable it via 'msconfig'.
h1d
Volunteer
 
Posts: 170
Joined: 3. Jul 2008, 02:10

Postby nabamer. » 11. Aug 2008, 08:49

I found that there is only vboxservice.exe on my Windows. Unfortunately, killing it doesn't stop time sync :(
nabamer.
 

Postby TerryE » 11. Aug 2008, 13:13

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.
TerryE
Site Moderator
 
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

Postby Sasquatch » 11. Aug 2008, 20:45

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.
Sasquatch
Volunteer
 
Posts: 17800
Joined: 17. Mar 2008, 13:41
Location: /dev/random
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux

Postby war59312 » 12. Aug 2008, 05:42

/etc/init.d/vboxadd-timesync stop

That? Well thats for linux I guess. So surly must be a way on windows too...
war59312
 
Posts: 26
Joined: 12. Aug 2008, 05:09
Location: U.S.A

Postby h1d » 12. Aug 2008, 12:16

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

Re: How to disable time sync between host and guest

Postby velrum » 16. Sep 2009, 05:23

Why the hell is doing this anyway!

Bloody annoying and unwanted.
velrum
 
Posts: 7
Joined: 16. Sep 2009, 05:19
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: XP

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

Postby cabetza1 » 17. Sep 2009, 21:43

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.
cabetza1
 
Posts: 1
Joined: 17. Sep 2009, 21:01
Primary OS: Ubuntu 8.10
VBox Version: OSE Debian
Guest OSses: 2

Re: How to disable time sync between host and guest

Postby ubshreenath » 21. Mar 2010, 18:30

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

Re: How to disable time sync between host and guest

Postby mpack » 24. Mar 2010, 12:41

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

Re: How to disable time sync between host and guest

Postby msa.operations » 2. Sep 2010, 05:53

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

Re: How to disable time sync between host and guest

Postby fvanhoof » 15. Oct 2010, 12:40

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

Re: How to disable time sync between host and guest

Postby Lior.Albaz » 23. Feb 2011, 18:03

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

Next

Return to Windows Guests

Who is online

Users browsing this forum: Google [Bot], slicendice and 15 guests