Search
⏲️

[Windows 10/11] WSL/Hyper-V 시간 동기화 문제

요약
chrony.conf 파일 수정하기
게시일
2023/03/05
태그
Windows
1 more property
Windows 10/11에서 Hyper-V를 사용하면서 골치 아팠던 문제 중 하나가 시간 동기화다. 랩탑 뚜껑을 닫아두었다가 열면 이상하게 WSL이나 Hyper-V 게스트의 시간이 늘 뒤쳐져 있었다.
chrony.conf 파일에서 다음행을 찾아서 수정하거나 추가하고, chrony 데몬을 재시작한다.
local stratum 2 refclock PHC /dev/ptp_hyperv poll 3 dpoll -2 offset 0 makestep 1.0 -1
Bash
복사
chrony 데몬을 재시작하려면
# Red Hat 계열 sudo systemctl restart chronyd.service # Debian 계열 sudo systemctl restart chrony.service
Bash
복사
chrony 데몬을 재시작한 후 다음 timedatectl 명령으로 동기화 상태를 확인한다. 아래와 비슷하게 나오면 동기화된 것이다.
Local time: Thu 2023-03-09 14:18:17 KST Universal time: Thu 2023-03-09 05:18:17 UTC RTC time: Thu 2023-03-09 05:18:17 Time zone: Asia/Seoul (KST, +0900) System clock synchronized: yes NTP service: active RTC in local TZ: no
Bash
복사
chronyc sources -v 명령으로 동기화에 사용된 타임 소스를 확인한다.
.-- Source mode '^' = server, '=' = peer, '#' = local clock. / .- Source state '*' = current best, '+' = combined, '-' = not combined, | / 'x' = may be in error, '~' = too variable, '?' = unusable. || .- xxxx [ yyyy ] +/- zzzz || Reachability register (octal) -. | xxxx = adjusted offset, || Log2(Polling interval) --. | | yyyy = measured offset, || \ | | zzzz = estimated error. || | | \ MS Name/IP address Stratum Poll Reach LastRx Last sample =============================================================================== #* PHC0 0 3 377 4 +11us[ +14us] +/- 1824ns
Bash
복사

관련 문서