Docker Community Forums

Share and learn in the Docker community.

Non-working time-sync in containers/MobyLinux

(Afischer211) #1

Expected behavior

Time in MobyLinux or started containers is (and stays) in sync with host-time of the Windows-System.

Actual behavior

After fresh restart the time is in sync, after Windows-suspend or other actions without restart of Docker4Win the time is not in sync anymore.
docker run -it --rm alpine sh
/ # date
Thu May 26 03:14:12 UTC 2016

Restart docker (nothing else!)
docker run -it --rm alpine sh
/ # date
Thu May 26 09:49:29 UTC 2016

(Afischer211) #2

I have the same problem again. After suspended my laptop for > 1 hour, the result is:
docker run -it --rm alpine sh
/ # date
Thu May 26 13:08:54 UTC 2016

The current date/time is Thu May 26 14:58:54 UTC 2016.

(Michael Friis) #3

Does the guest not re-sync some time after you wake up your computer?

(Afischer211) #4

I don’t think so. Also after approx. an hour the time is not resynced. What do you mean with some time?
The time-sync in hyper-v is enabled, but it seems not to work.

(Michael Friis) #5

Just to be sure, you’re saying time-sync is enabled in integration services?

(Afischer211) #6

That is right, the Time synchronization is activated (all checkboxes have the same state on my system like in your screenshot).
I have made one more test. I have disabled and reenabled time synchronization (toggle the corresponding checkbox in hyper-v manager) without restarting docker. Now the time in a fresh startet alpine container is correct again (was strong shifted before in a fresh started alpine container because of laptop in suspend mode over night).
So I have to retrigger time-sync after every suspend with toggling the checkbox?

(Afischer211) #7

One more question:
Is the time-sync service in the MobyLinux guest running? After some searches and reading some articles I understand, that the Hyper-V is only responsible for correcting the time on guest-startup and so on - this is also working.
The time-sync for a running guest is only working, if time-sync inside the guest is running. See

(Rolf Neugebauer) #8

We do have the time synch feature enabled and it should be handled by the Linux kernel

(Kutny) #9

I have the same problem. Have you found any solution? Thanks

(Bradqwood) #10

agreed – definitely not working on my build - seems like a bug

(Erwin Steffens) #11

Same problem here. Ntpd service was not running. Started it manually and now the time is in sync.

(Greg) #12

I think this is the same what I’m seeing in this report. Definitely seems like a bug.

(Nicolas Bihan) #13

Just looked into my Alpine container and indeed the date is completely off. Unchecking and checking back the time sync in Hyper-V fixed it. But this looks like a proper bug.