How do I use NTP on my JumpBox?

WARNING: This documentation is out of date. All up to date documentation is now in the JumpBox Wiki All relevant documentation has been ported to the wiki and is updated there. These FAQs are here strictly for historical reasons.

NTP is the Network Time Protocol. It is a standard way to keep system clocks synced for internet attached computers. You may consider using this if your JumpBox has access to the internet (or your own NTP servers) and the clock is drifting.

First, VMware users must disable host time sync by shutting down their JumpBox and setting tools.syncTime = "0" in the .vmx file (or disabling it in the virtual machine settings UI). Then boot the JumpBox back up and install ntpd as follows:

  sudo apt-get update
  sudo apt-get install ntp

Now save a copy of the ntp config file and edit it:

  sudo mv /etc/ntp.conf /etc/ntp.conf-bak
  sudo nano /etc/ntp.conf 

to match:

# ntpd.conf
tinker panic 0
restrict 127.0.0.1
restrict default kod nomodify notrap
server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org
server 3.pool.ntp.org

You can substitute alternative NTP servers if they are available to you. Now, stop ntp, run ntpdate once and then restart ntp.

  sudo /etc/init.d/ntp stop
  sudo ntpdate pool.ntp.org
  sudo /etc/init.d/ntp start
  ntpq -pn

The last command should show non-zero delays and offsets and jitters below 100.

Additional VMware specific details on regarding timekeeping can be found here: http://www.vmware.com/pdf/vmware_timekeeping.pdf

NOTE: VMware now recommends "Whenever possible, use NTP instead of VMware Tools periodic time synchronization." See "NTP Recommendations" on page 14 of the VMware Linux Guest Install Document.

NOTE 2: You can disable the Host Time Sync from within the jumpbox itself by issuing the following command:

sudo vmware-guestd --cmd "vmx.set_option synctime 1 0"