Since you have a Windows host, you can make sure you have an ntp server running locally: Link
You can verify if the server is turned on by running the following command:
w32tm /query /configuration
Keep in mind that you will need to be elevated to run this command. When you execute this, you will get back a laundry list of configuration settings. We are specifically interested in the NtpServer section:
NtpServer (Local)
DllName: C:\Windows\system32\w32time.dll (Local)
Enabled: 1 (Local)
InputProvider: 0 (Local)
AllowNonstandardModeCombinations: 1 (Local)
The third line will specify whether or not the NtpServer (aka the ‘server piece’) is turned on. If Enabled is 1, then it’s on. If you see that Enabled is 0, then it is off. If you aren’t running Vista or Server 2008, you can query the registry directly:
reg query HKLM\system\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer
You should see an entry that looks something like the following:
Enabled REG_DWORD 0x1
As before, 1 is on, 0 is off. You can turn on the NtpServer at any time by running the following commands:
reg add HKLM\system\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer /v Enabled /t REG_DWORD /d 0x1 /f
w32tm /config /update
The first command will change the Enabled flag in the registry to 1 (turning on the NtpServer), then the second command will tell the w32time service that the configuration in the registry need to be re-read, to make the changes active. You can confirm that the NtpServer is in fact running by calling w32time again:
w32tm /query /configuration
Then use that as your ntp server from within your Linux client
ntpdate 10.0.2.2
(Remember that when running NAT, 10.0.2.2
is the host address).
I was looking for the answer myself and found this useful as our firewall blocks the default ntp port.