Synchronize a Virtualized Domain Controller with External Time Servers

In: Active Directory| VirtualBox| Windows


19 Aug 2008

Sitting on my couch one night, I noticed that the time on my laptop was about 10 minutes slow compared to every other time source in my house (mobile phone, cable box, etc.)… Since I’m running a domain environment, I knew that most of my OS installations would be syncing to the domain controller, so I was a bit baffled by the prospect that things were not syncing. After a quick RDC to my PDC, I noticed that it was the culprit of the slowed time. First, a quick Google on how to synchronize with an external time source. With that figured out, time to pick out a reliable time source. Now let’s run it:

w32tm /config /manualpeerlist:pool.ntp.org /syncfromflags:MANUAL
w32tm /config /update
w32tm /resync

Well that was easy… Oops, the time just re-sync’d back. After a little digging, it dawned upon me that by installing VirtualBox Guest Additions, VirtualBox was attempting to synchronize the guest OS time to the host OS. From the manual:

Time synchronization
With the Guest Additions installed, VirtualBox can ensure that the guest’s system time is better synchronized. This fixes the problem that an operating system normally expects to have 100% of a computer’s time for itself without interference, which is no longer the case when your VM runs together with your host operating system and possibly other applications on your host. As a result, your guest operating system’s timing will soon be off significantly. The Guest Additions will re-synchronize the time regularly.

Unfortunately, this is causing my time synchronization headaches. The solution for the time being was to re-run the re-sync detailed above, but also adding in this snippet:

w32tm /resync /computer:HOSTCOMPUTERIP

This forced the host computer to synchronize to its time source (the domain controller) and all is well. You can use the above snippet to force other computers to manually update in case of access problems related to time desyncronization. But most computers should start updating almost immediately.

Update: After some more digging, I found a way to disable time synchronization from guest to host. Run the following command on your host, replacing <vmname> with the target Virtual Machine:

VBoxManage setextradata <vmname> "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" "1"
  • Share/Bookmark

1 Response to Synchronize a Virtualized Domain Controller with External Time Servers

Avatar

cboese

January 5th, 2010 at 8:30 am

Check the xml file of the machine if its not working, because it gets corrupted when being manipulated from the command line very easily.

Comment Form

  • ERNST: HOW TO SYNC MULTIPLE GOOGLE CALENDARS IN IPHONE: To show Multiple Google calendars in iPhone, ope [...]
  • linuxfueled: WINDOWS 7 users read..... If your main OS is Windows 7 (the host machine) and you just cannot get [...]
  • Kurt Hitchen: A friend has let me "see" there calendar in Google Calendar, but because their calendar is set to pr [...]
  • bugoy8: https://www.google.com/calendar/dav/nba_13_%4cos+%41ngeles+%4cakers#sports@group.v.calendar.google.c [...]
  • Speaker: Wasn't able to understand how to access the shared folder in the quest OS from this tutorial. Hmmm [...]


This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States.