Proxmox, LXC and time sync

avp

New Member
Nov 3, 2020
2
0
1
44
Hello,
I use LXC with NTP.
Is it relevant to setup ntpd on the lxc container?
 
Last edited:
Hi,
NTP is already set up in PVE, and containers use the host system time, so you don't need to set this up in the container.
 
[1] refers to the Time Synchronization section of PVE Admin Guide, where NTP in PVE is discussed.
I do not see any specific documentation online referring to containers use of the host system time. However, system time is managed in the kernel and LXC containers by definition share the host kernel rather than virtualising their own, as a VM would. Therefore, their time is coming from the system time. See also [2]-[4].

[1] https://pve.proxmox.com/pve-docs/pve-admin-guide.html#_time_synchronization
[2] https://forum.proxmox.com/threads/lxc-not-getting-host-time.38255/post-188893
[3] https://forum.proxmox.com/threads/lxc-ntpd.23840/post-119661
[4] https://forum.proxmox.com/threads/ntp-and-proxmox.986/post-7136
 
Hello.

the idea in my case is to use the container to make it an NTP server for my domain. all my machines will then synchronize on the NTP server

thank
[1] refers to the Time Synchronization section of PVE Admin Guide, where NTP in PVE is discussed.
I do not see any specific documentation online referring to containers use of the host system time. However, system time is managed in the kernel and LXC containers by definition share the host kernel rather than virtualising their own, as a VM would. Therefore, their time is coming from the system time. See also [2]-[4].

[1] https://pve.proxmox.com/pve-docs/pve-admin-guide.html#_time_synchronization
[2] https://forum.proxmox.com/threads/lxc-not-getting-host-time.38255/post-188893
[3] https://forum.proxmox.com/threads/lxc-ntpd.23840/post-119661
[4] https://forum.proxmox.com/threads/ntp-and-proxmox.986/post-7136
 
Hello both,

I have a similar challenge and found this thread. How have you finally resolved this, Darius?

I need an NTP Server for my local net, which goes beyond Proxmox and its VMs / Containers.
I cannot use the Proxmox server itself, since this sits in my management network and is not accessible from the different VLANs.

Any chance, I can take advantage of the NTP Server inside my OPNsense firewall, which is hosted in a KVM on top of Proxmox?
Can this set my time? -- (With the little disadvantage, that the VM is not yet available at startup of Proxmox, it comes a bit later)

Regards,
Marcus