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.

2 Likes

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

1 Like

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

2 Likes