Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AL2 / WSL2 time issue. #7

Open
mrpackethead opened this issue Sep 4, 2020 · 1 comment
Open

AL2 / WSL2 time issue. #7

mrpackethead opened this issue Sep 4, 2020 · 1 comment
Labels
wontfix This will not be worked on

Comments

@mrpackethead
Copy link

I'm finding that i cant' keep my WSL image time synced... ntp and chronyd both fail

bash-4.2# sudo service chronyd start
Redirecting to /bin/systemctl start chronyd.service
Failed to get D-Bus connection: Operation not permitted

The temp fix, was to update it manually.

bash-4.2# sudo ntpdate pool.ntp.org
5 Sep 10:49:17 ntpdate[5592]: step time server 43.252.70.34 offset 3455.750697 sec

This was affecting my ability to connect to AWS with temporary credentials as the time was sufficently wrong that it would not stay in sync.

It appears that if i shut down my machine, the wsl machine clock actually stops, were as the host machine's clock does'nt, and it restarts from where it started off.

@yosukes-dev
Copy link
Owner

yosukes-dev commented Sep 27, 2020

It seems to be an issue of WSL itself.
system date is not same with windows (WSL 2) #4245 - microsoft/WSL
It seems that you need to create a script that uses ntpdate as in your post,
or end the session and then start it again...

For the time being until it is fixed, it can be handled with the following command.
sudo hwclock -s

@yosukes-dev yosukes-dev added the wontfix This will not be worked on label Sep 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants