[TIP] Time sync between FreeNAS (11) and virtual machine

Status
Not open for further replies.

elagil

Dabbler
Joined
Jan 12, 2017
Messages
13
Hello!

I had a problem, where a debian-VM had a time of +2h relative to the host machine. This is problematic for some services, like resilio-sync that rely on accurate time and date information.

It seems like FreeBSD uses the RTC such that it reflects the TZ time, and not UTC. So, the virtual machine has to be configured equally, with:

root@debian:~# timedatectl set-local-rtc true

This needs to be run as root.

Confirm with:

timedatectl

Code:
root@debian:~# timedatectl
	  Local time: So 2017-06-25 16:29:57 CEST
  Universal time: So 2017-06-25 14:29:57 UTC
		RTC time: So 2017-06-25 16:29:56
	   Time zone: Europe/Berlin (CEST, +0200)
 Network time on: yes
NTP synchronized: no
 RTC in local TZ: yes

Warning: The system is configured to read the RTC time in the local time zone.
		 This mode can not be fully supported. It will create various problems
		 with time zone changes and daylight saving time adjustments. The RTC
		 time is never updated, it relies on external facilities to maintain it.
		 If at all possible, use RTC in UTC by calling
		 'timedatectl set-local-rtc 0'.


It will give you this warning, but I found no other way to synchronize the times correctly.

Adrian
 

m0nkey_

MVP
Joined
Oct 27, 2015
Messages
2,739
This also works:

In the Debian VM, edit /etc/systemd/timesyncd.conf and modify the NTP= line to the IP address of your FreeNAS server. Then run timedatactl set-ntp true.
 
Status
Not open for further replies.
Top