Time sync isn't working

33 views
Skip to first unread message

Oli Sturm

unread,
Dec 9, 2019, 9:04:21 AM12/9/19
to qubes...@googlegroups.com
Hi,

I'm running 4.0 with all current updates. I'm trying to figure out why I don't get synchronized time anywhere in the system. I have found various old issues and discussions about similar problems, but unfortunately none of the scenarios described there seem to be up-to-date anymore.

As I understand, my sys-net VM is the "ClockVM". I have confirmed that it is configured as such in Qubes settings (using the UI dialog in Qube Manager). However, it seems that this VM is not set up to sync time with an NTP server. I see that all entries in the "Time" block in /etc/systemd/timesyncd.conf are commented. "ntpdate" is not installed. Is there some other NTP sync mechanism installed in this VM? If so, where is it? In any case it's clearly not working.

Further, it appears that sync between VMs is also not working. I installed ntpdate in sys-net and executed it manually, thereby changing sys-net time. Then I manually executed qvm-sync-clock in dom0 (since I found it was being started by cron there). This worked correctly, and dom0 updated to the time from sys-net.



However, other VMs are not updating. There is no cron entry for qvm-sync-clock in the cron configuration of the fedora-29 template. Am I wrong to expect these other VMs to update automatically? If I'm not wrong, how is that expected to work?

I have confirmed that if I run qvm-sync-clock manually in my VMs, the time updates correctly.

To summarize, there seem to be two problems in my system:

1. The configured ClockVM sys-net isn't set up for NTP.
2. Automatic time sync (with the ClockVM) isn't enabled for VMs other than dom0.

Any feedback is appreciated!

Thanks
Oli
signature.asc

Mike Keehan

unread,
Dec 9, 2019, 9:40:08 AM12/9/19
to qubes...@googlegroups.com, Oli Sturm
On Mon, 09 Dec 2019 14:04:10 +0000
"'Oli Sturm' via qubes-users" <qubes...@googlegroups.com> wrote:

> Hi,
>
> I'm running 4.0 with all current updates. I'm trying to figure out
> why I don't get synchronized time anywhere in the system. I have
> found various old issues and discussions about similar problems, but
> unfortunately none of the scenarios described there seem to be
> up-to-date anymore.
>
> As I understand, my sys-net VM is the "ClockVM". I have confirmed
> that it is configured as such in Qubes settings (using the UI dialog
> in Qube Manager). However, it seems that this VM is not set up to
> sync time with an NTP server. I see that all entries in the "Time"
> block in /etc/systemd/timesyncd.conf are commented. "ntpdate" is not
> installed. Is there some other NTP sync mechanism installed in this
> VM? If so, where is it? In any case it's clearly not working.
>


Ah the good old days where you just knew where and what to look for.

I suspect you need to investigate systemd's timesyncd stuff. Good luck!

Mike

Oli Sturm

unread,
Dec 9, 2019, 9:47:00 AM12/9/19
to Mike Keehan, qubes...@googlegroups.com
On Monday, December 9, 2019 2:40 PM, Mike Keehan <mi...@keehan.net> wrote:

> I suspect you need to investigate systemd's timesyncd stuff. Good luck!

I believe I would just need to switch that on to activate it. But I believe time sync should work in Qubes out of the box - I remember reading that somewhere in the docs. Maybe my expectations are wrong here?

Thanks
Oli
signature.asc

Mike Keehan

unread,
Dec 9, 2019, 10:06:03 AM12/9/19
to qubes...@googlegroups.com, Oli Sturm
On Mon, 09 Dec 2019 14:46:50 +0000
"'Oli Sturm' via qubes-users" <qubes...@googlegroups.com> wrote:

systemd-timesyncd is running on my Qubes sys-net vm. I'm assuming
that it is part of the standard installation. You need to investigate
why it is not working on your machine I think.

Mike.

Oli Sturm

unread,
Dec 9, 2019, 10:35:13 AM12/9/19
to Mike Keehan, qubes...@googlegroups.com
On Monday, December 9, 2019 3:05 PM, Mike Keehan <mi...@keehan.net> wrote:

> systemd-timesyncd is running on my Qubes sys-net vm. I'm assuming
> that it is part of the standard installation. You need to investigate
> why it is not working on your machine I think.

Thank you, this got me on the right track. I'm sure I read in an old issue on GitHub that timesyncd wasn't supposed to be running - so I saw its commented configuration as confirmation of this and didn't look at timesyncd further. I guess things might have changed.


Now I searched GitHub for "timesyncd" and immediately found https://github.com/QubesOS/qubes-issues/issues/4939 - my sys-net didn't have the "clocksync" service assigned, just as described in that issue. I never removed that entry, so I wonder how that happened... incidentally I had stumbled upon this service a couple of hours ago, but qvm-service never seemed to show anything for any VM and I disregarded it... I guess that's a different question for a different thread.

For posterity: in December 2019, the ClockVM should be running systemd-timesyncd, and this happens magically as long as the "clocksync" service is correctly assigned to the VM (and in spite of the fact that /etc/systemd/timesyncd.conf looks like all options have been disabled).
signature.asc
Reply all
Reply to author
Forward
0 new messages