1, Kiểm tra tình trạng đồng bộ thời gian
sudo systemctl status systemd-timesyncd
○ systemd-timesyncd.service - Network Time Synchronization
Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/systemd-timesyncd.service.d
└─enable-with-daemon.conf
Active: inactive (dead)
Condition: start condition failed at Wed 2024-05-15 12:36:04 +07; 23s ago
Docs: man:systemd-timesyncd.service(8)
2, Kiểm tra hệ thống đang chạy nền tảng ảo hóa nào:
systemd-detect-virt
wsl
3, Chỉnh sửa file cấu hình đồng bộ
sudo su -
cat /etc/systemd/system/systemd-timesyncd.service.d/enable-with-daemon.conf
[Unit]
ConditionVirtualization=
ConditionVirtualization=wsl
sudo cat /etc/systemd/timesyncd.conf
[Time]
NTP=pool.ntp.org
FallbackNTP=ntp.ubuntu.com
RootDistanceMaxSec=5
PollIntervalMinSec=32
PollIntervalMaxSec=2048
4, Khởi động lại dịch vụ
sudo systemctl daemon-reload
sudo systemctl start systemd-timesyncd.service
sudo systemctl status systemd-timesyncd.service