How to disable NTP on virtualized TrueNAS install?

Hello!

I just re-setup my TrueNAS instance virtualized on a Proxmox host and was wondering how I could try to (semi-permanently) disable chrony. As this is a VM, the hypervisor is taking care of the clock anyway, so it doesn’t make a lot of sense to have TrueNAS itself trying to sync. I thought about using init scripts to disable the system unit, as nothing else would really persist across updates. However I wanted to ask if there would be a simpler approach I didn’t think of yet.

Best regard

You could mask off the chrony service using the API call to add extra kernel boot parameters via midclt call system.advanced.update '{ "kernel_extra_options": "systemd.mask=chrony" }'. This will prevent systemd from trying to start the service on boot.

My experience with VMs is to the contrary. The clock of a VM will get off quickly unless you run NTP. AFAIK that’s e.g. the best practice for VMware for all “unixy” guests. Windows is a different matter, but not Linux or BSD.

Thank you for the replies. Based on the answer from @pmh I decided to dig a bit deeper into this topic and found out I had quite a misconception about how time keeping with VMs actually work.

tl;dr: No continuous syncing from the host is taking place, NTP should stay on.

While the host does sync time at certain events to keep VM clock skew low, it does not happen on a regular basis, thus active NTP clients help with keeping everything in sync. However it is important to keep them pointed to the same source of time, to avoid skew during sync events from the host (e.g. fs freeze/thaw for snapshots).

It does if the guest OS is Windows and VMware tools are installed, and “time synchronisation” is enabled in the VM settings.

That just does not work as well for Linux. Check the VM settings and make sure time synchronisation is disabled when running NTP inside the VM.

I use Proxmox as hypervisor, so my findings should be valid for Windows VMs as well. Though I don’t really bother about Windows, I don’t have any plans on running such VMs as well :sweat_smile:

However thank you regardless for claryfing :+1:

As an aside, for anyone who runs 2FA secured stuff at home, I’d suggest investing in a centerclick.com or like NTP. They cost relatively little and ensure that all network devices in your home sing from the same hymn book re: time, even if your ISP temporarily blocks port 123 enquiries due to a DDOS attack.

If you’re already running a raspberry pi (for pi-hole or whatever), consider adding a TCXO module, that will allow you to turn that pi into a higher stratum but still useful time server as well. These cost next to nothing. Being a pi, getting it all to work takes a bit of time though.

I have found the center click gear to be exceptionally well-behaved and they have versions that can be powered by a DC jack and versions that can run off DC and POE (ie dual-input). Not an investor / owner / influencer for center click, just a happy customer.

And if you have lots of excess 12VDC power supplies from shucking external HDDs like @jgreco and I did, Dave Johnson at center click will take them off your hands if you ship them to him.

Seconded. I could not be happier with both the device and their support.

Thirded, though I can’t speak to their support, as I haven’t needed it–mine Just Works™.

I built the Raspberry Pi 5B NTP Server - Stratum 1 (with Uputronics GPS HAT). I wanted to add an NVMe hAT so I used a different case. I would recommend it if you want to expand your Raspberry PI skills but CenterClick unit seems to be well priced.

There be dragons associated with Pi and Uputronics if you use the USB3 bus on a Pi 4 or 5.

Thanks to GPS-related signals being “stupidly weak” in the words of a RasPi engineer, the USB3 bus puts out enough interference to make the Uputronics module stop working almost immediately. The fix is to only use the USB 2 jacks or to plug USB2 cables into the USB3 jacks.

I have had problems with noise in the Pi4. Fortunately, with the Pi5 design I am not using USB3 ports.

The crazy thing is that even the folk at Uputronics had no idea that there was this EMI issue. I was pulling my hair out to do something as simple as a SMB1 server for Sonos and Pi NTP in one.

The server kept losing its sat signals even though it had a beautiful view of the sky, a known-good antenna, etc. Over at the Raspberry Pi forums, helpful users pointed me to a prior posting re: USB3, WiFi, wreaking havoc on GPS because the GPS signal is 1/4 the wavelength of the 5GHz used in the USB3 bus..

When I contacted Uputronics, they did some testing, I did some testing, and the only “safe” option with a Pi and the Uputronics hat is not to use USB3. That’s not the end of the world but a real life caution how crummy EMI design in the Pi and lack of adequate shielding on the Uputronics module can bite you in the butt.

On my lan, ntp server runs on the firewall (*sense). There’s dnat rule that intercepts any calls not going to the firewall and redirects to it. This keeps all vm’s on the same time without bothering to change each one’s target ntp server.

Good point. I do something similar with my gateway redirecting NTP requests to the NTP server pool (stratum 1 vs. stratum 2) and DNS requests to the DNS server pool.

Works reasonably well, as long as the equipment plays nice and protocol norms were observed. Always hilarious to catch the usual suspects (Sonos) doing something naughty. Oh well.