0

I have hyper-v virtual machine with Centos OS. My system time is always an hour ahead. I tried disabling the time sync in Hyper-V VM settings but to no avail. As I can see, the hardware time is ok..

Screenshot of WebMin:

screenshot

This problem causes many other problems... how can I solve this?

I'm not so good in Linux management but i have full control.

** I fixed this problem with webmin "Time server sync"

2 Answers2

0

Clock skew is very common in most Virtualization platforms.

Before taking action to fix the clock skew by other means first check the timezone information to see if that is correct. If your timezone is not correct that would easily explain the one hour difference.

Next have you tried to run NTP? NTP is designed to keep a systems clock in sync with a master time source and thus can help adjust for the skew. However sometimes NTP will stop working if it detects too much jitter with the internal clock. This is not uncommon on virtualized systems. In such cases it can be useful to restart NTP in a cron process periodically along with issuing a manual clock sync.

Red Tux
  • 2,074
  • 13
  • 14
0

I believe the root of your trouble lies in the fact that Hyper-V always sets the current local time for the virtual guest "hardware" clock whereas Centos Linux could expect the hardware clock to be in UTC instead. In this case, the clock time difference you are seeing when your guest is running equals your system's time offset from UTC.

Bottom line: you should configure Centos to expect local time from the CMOS clock by setting UTC=no or UTC=false in /etc/sysconfig/clock when running as a guest in Hyper-V.

the-wabbit
  • 40,319
  • 13
  • 105
  • 169