NOTE: When referring to the PDC or Primary Domain Controller I am referring to the PDC Emulator Master that is a member of the FSMO Roles. The original concept of a PDC was discontinued prior to Windows 2000's release
I ran across this problem at home, where I have a Hyper-V server that runs all of my other servers, one of which is our home Domain Controller. It is also the Primary Domain Controller which means that by default it provides NTP and Time Synchronization services for the rest of the Domain, and in some cases the network. By default when you setup a new domain the NTP Service is installed and configured. If for some reason this is not the case see the following TechNet article:
http://technet.microsoft.com/en-us/library/cc786897.aspx
If you are not familiar with Hyper-V you should know that Hyper-V just like VMWare installed "Integration" or "Client" tools, which is really just a fancy term for Drivers and Services that enhance the client-to-host communications. Typically as part of these tools the time service for the Client Server will synchronize itself with the host machine, primarily because the host machine has the Motherboard which has the CMOS Battery that allow the computer to keep time. Again, this is a great idea; otherwise your clients might get out of whack.
The problem comes in when your Primary Domain Controller (PDC) which is providing time service to client machines is on the same domain as the host computer that is not a domain controller. The problem is that the time service continues to synchronize the host machine with the client, but in reality the host should be getting its time information from the PDC. The PDC in turn should synchronize with an external NTP Server or Pool. (Read: http://en.wikipedia.org/wiki/Primary_Domain_Controller).
So, over time the clock of both machines either speeds up or slows down, but either way does not keep proper time. Eventually this causes major problems, especially for laptops that travel and instead try to sync with another time server as a last resort, because once you bring it back on the domain and it is outside of the 10 minute difference window it stops all communication.
My Fix:
I actually have two. The first tells the host machine to look at an NTP Pool and not talk to the Domain to get time information. The second disables the Hyper-V Time Synchronization service, there-by allowing the virtual machine to look to an external NTP pool and get the right time. See below for the steps:
NOTE: These changes all take place from the host machine and not the virtual domain controller!
Fix 1 – Change NTP Settings:
NOTE: This solution modifies the registry. Make sure you know what you're doing, as no one else can be held responsible for killing YOUR computer.
- Stop the Time Service, you can use the Service Control Manager MMC Snap-In or at the cmd prompt: "net stop w32time"
- Open the registry editor, Start, Run, "regedit"
- Browse for the following key: "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters"
- Change the key "Type" from "NT5DS" to "NTP". If you do not have NT5DS I would stop now!
By default Windows uses the Microsoft NTP Pool. For most this is fine. If you want to use a more open source and larger pool I suggest doing the following:
- Change the key "NTP Server" to "north-america.pool.ntp.org" (See http://www.pool.ntp.org for other pools around the world)
- Browse for the following key: "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config"
- Change the key "AnnounceFlags" from "10" to "5"
- Close the registry editor
- Start the Time Service, you can again use the MMC Snap-In or "net start w32time"
Normally it can take a while for the time to update itself, but we can override this and force it to run. Do the following:
- From the cmd prompt: "w32tm /resync /rediscover"
- If it fails to sync the first time run it again, I have had problems where this sometimes fails the first time.
Fix 2 – Disable Integration Service Time Settings:
- Open the Hyper-V MMC Snap-In
- Select the Virtual Machine running your Active Directory
- Right-Click on the machine and select "Settings"
- Under "Management" select "Integration Services"
- Un-Check Time Synchronization
So from the steps above the obvious choice should be Fix 2, its much simpler and you don't have to deal with the registry or the time service. Just remember that the virtual machine by default will not have a battery to keep track of the time. So if you take a DC offline for a day or two, the clock will be totally off, because you have disabled the time synchronization service. Lastly, if you have multiple virtual domain controllers on different host machines you only need to make the change to the domain controller that serves as the PDC Emulator, because everything else will flow downhill and get the proper time.
-Brent