Windows 与 Linux 在同一部机器运作,会有时间错误的问题,解决的方式,可以分别朝 2 个系统去做好设定,这一篇贴文,我想先纪录一下 2 支我目前比较常使用的 Linux Distro 上单方面的做法:
ubuntu:
sudo apt-get install ntpdatesudo ntpdate time.windows.com
Clear Linux:
先用 touch 这个指令在 /etc/systemd/ 产出名为 timesyncd.conf 的档案,并且用 gedit 开启这个档案。sudo touch /etc/systemd/timesyncd.confsudo gedit /etc/systemd/timesyncd.conf
[Time]NTP=time.windows.com
timedatectl set-ntp true
启用 systemd-timesyncd 服务。
其他:
我在 iMac 上面,走到这边就已经解决时间问题,但,我另外找一部 x86 的主机来试,发现还是不行,所以,再下一道指令 sudo hwclock --localtime --systohc
,并且透过 timedatectl
这个指令来观察。
后续在 2 个系统的切换时,就没有问题。