Windows Can Serve Time via Windows Time Service / w32tm
There is an old MSDN blog entry by Ryan Sizemore about running Windows as a time server:
Recently, I had a customer ask if they can use w32time as a time source for other computer & devices on their network. The Windows Time Service is fully capable of acting as a time source for anything that is NTPv3 compliant.
Running a server
Start the w32tm service
You can start the Windows Time
service from the Services
area of the control panel.
Verify via elevated command prompt / powershell
Win + x will give you an option of Command prompt (Admin)
, where you can enter:
w32tm /query /configuration
You are looking for a line which reads:
Enabled: 1 (Local)
If not enabled, you can query the registry and add the right key if necessary:
query: reg query HKLM\system\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer
add: reg add HKLM\system\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer /v Enabled /t REG_DWORD /d 0x1 /f
update: w32tm /config /update
Use the Windows PC as a time source for the Pi
You say you are already aware of how to get the Pi to use a particular address, but if you are running a Debian-based Pi distro (eg Raspbian), you can usually use ntpdate
, eg
# ntpdate windowsPCaddr
when elevated (ie either root / sudo
); where windowsPCaddr
is the address of the Windows PC that you have determined already.
Troubleshooting
I was able to find and start the service on a fresh install of Windows 10. However you might get
The following error occurred: The serveice has note been started. (0x80070426)
in which case you need to start the service from the Services
section of the control panel (or it can be found from the Start menu by searching for 'Services'- it is listed as a 'Desktop app').
Others have run into the following error:
w32tm does not exist as an installed service
In this case, the command to use is:
w32tm /register
[this is] the actual way to install it (using a command prompt which was Run as Administrator). Sometimes you need a reboot to put things in order, but I actually just waited a while without rebooting.
With credit to Tomasz Gandor's answer.
1Welcome to Super User! I see you've tagged your question
ntp
- have you tried anything to do with this yet? – bertieb – 2018-07-30T14:18:55.707I'm aware that you can configure the Pi to use a specific address, but how would I set up the Windows PC to handle the requests? – cryptiblinux – 2018-07-30T14:41:34.157