Ubuntu Time Issues – How to Fix

esxintptime zoneUbuntu

I am having a tough time getting my Ubuntu Virtual Machine to display the proper time. It is on an ESXi server and the version is 8.10 LTS it came with a virtual appliance for Opsview. I have installed ntp and have it pointed to pool.ntp.org. I think it is working with ntpd because when I try to manaully sync it, it says the NTP socket is in use. I have set the time zone to eastern (which is my time zone) using sudo dkpg-reconfigure tzdata and set the date manaully by entering date mmddhhmmyyyy.ss. I also synced the hardware clock by typing hwclock --systohc and everything works fine.

Here is where the problems begin: upon first reboot the system time jumps 5 hours ahead (this is true every time I reproduce it) but the hardware clock stays in sync. Upon a second reboot the hardware clock moves out of sync five hours with system clock. So now I have both clocks that are five hours ahead. What is going here? Please help me get my clocks synced to the proper time.

additional info: The ESXi is set to the proper time and has 12 other vm's running on the proper time including other ubuntu installs(version 10.10), the opsview appliance is the only vm with 8.10. I open for solutions as well as work arounds, I check the site constantly while I am awake so feel free to ask if you need additional info.

Best Answer

You don't want to run NTP or NTPDATE on a virtual machine. It should get its time from the system clock.

Check the UTC value in /etc/default/rcS. Try setting it from no to yes or vice-versa.

While you are at it add an exit 0 line to /etc/default/ntp. Alternatively set the NTPOPTION value to "-q". This will disable NTP on the virtual server.