Automatic Time Sync in Parallels Virtual Machines

Posted by Mike Brittain on July 29, 2006
Apple, Microsoft

I’ve been running Parallels on my MacBook so I can boot up a few of the Windows applications I still rely on… which I can tell you is a dwindling number. I noticed a few weeks ago that the clock in Windows XP had gone out of sync on the machine. Basically, if the virtual machine was not running, the Windows clock was completely asleep.

For the first few weeks of running Parallels, I solved this by writing a very simple .bat file that would execute at startup of Windows XP. It ran the Windows time manager and told it to check one of the time servers on the Internet and reset the time on my laptop. I don’t run on a domain or any fancy network at home, so I don’t have a local server I can use for syncing the time.

Anyway, here’s how to set that up:

  1. Open a new text file in Notepad
  2. Paste the following command (without the quotes) into the file: “w32tm /resync /rediscover”
  3. Save the file as synctime.bat. You may find that Notepad automatically helps you by adding on the default .txt extension. If that happens, just rename the file and take off that extension.
  4. Put the file somewhere in your path, maybe c:Windowssystem32.
  5. Create a shortcut to the synctime.bat file and put it into your Startup folder.

When the operating system is restarted, a command prompt will briefly appear showing the w32tm process running, and then it should go away after your clock has been updated.

Voila!

Well… not exactly. After running this for a few weeks with no trouble, I found that the clock was no longer updating. I opened the command prompt today and entered the w32tm command manually and found the following error:

The computer did not resync because the required time change was too big.

A quick Google search landed me at Microsoft’s TechNet article for Windows Time Service Tools and Settings, which provides in-depth detail on the switches and parameters for using the w32tm utility. Since I’m not running my own time server, most of it was irrelevant to me. I found a couple of registry settings that would correct the issue. These are MaxNegPhaseCorrection and MaxPosPhaseCorrection, and they are found in the registry at:

HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesW32TimeConfig

The default (decimal) value for both of these keys was 54,000, which is 15 hours. This means that if your local clock and the Internet clock that you are syncing to are within 15 hours of each other, the time on your PC will be updated. If they are more than 15 hours apart, forget it.

The TechNet article highlighted a special case for this setting: “0xFFFFFFFF means always make time correction.” So fixing this issue is just a matter of editing a couple of Registry keys.

  1. Open up the Registry Editor. (From your Start Menu, select “run” and enter “regedit”.)
  2. Browse down to the “config” key to find the phase correction settings.
  3. Double-click on MaxNegPhaseCorrection to edit the value. It will read “d2f0” in the hexidecimal value, or 54000 in the decimal value. Select “hexidecimal” and enter “ffffffff” in the field.
  4. Click “OK”.
  5. Make the same change for MaxPosPhaseCorrection.
  6. Close the Registry Editor

Re-run the synctime.bat file and you should fine that the time in Windows has been updated.

If there is a better way to do this, or a different setting that should be used, I’m happy to hear about it. This seems to have fixed my problem with time syncing in Windows, but I’m also pretty new to how Windows manages time syncing on a local network or on a managed domain.

If you have a better suggestion, please post it in the comments area below.

4 Comments to Automatic Time Sync in Parallels Virtual Machines

  • UPDATE: After looking around for a proper solution for this problem, I found that within Parallels, there is an option to install “Parallel Tools”. This set of tools allows for automatic time sync, improved network, video, and mouse support, shared folders between Mac and Windows, and a shared clipboard between both operating systems.

    This was found in the Parallels Support Forum.

  • In case after following all the steps above the error occurs again, just restart the windows time service and try the command again