Getting time from host

Hi,
got two centos 6 lxd running, but time is wrong, is there a way to sync the container time with host? the container does not have connection to the internet, thanks.

Container and host clocks are the same, so it’s impossible for a container to have a different time than the host.

What may be different is the timezone as that’s purely a userspace configuration.
If that’s the case, just make sure you configure the timezone in your container to match that of the host, it’s usually done through /etc/localtime and /etc/timezone.

1 Like