Configuring ntp server on Ubuntu

1

I am trying to configure the time on my system, as per one of the ntp servers provided on net. However, the time doesn't change. I am doing this on Ubuntu 12.04 which is installed in Oracle VirtualBox with Windows 7 as the host system.

saasbook@saasbook:~$ su 
Password: 
root@saasbook:/home/ubuntu# pgrep ntpd
1392
root@saasbook:/home/ubuntu# cd ..
root@saasbook:/home# cd ..
root@saasbook:/# ls
bin    dev   initrd.img  media  proc  sbin     sys  var
boot   etc   lib         mnt    root  selinux  tmp  vmlinuz
cdrom  home  lost+found  opt    run   srv      usr
root@saasbook:/# vi etc/ntp.conf

In there, I add one server as shown

driftfile /var/lib/ntp/ntp.drift

statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable

# The server specified by me
server in.pool.ntp.org

# Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board
# on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for
# more information.


server 0.ubuntu.pool.ntp.org
server 1.ubuntu.pool.ntp.org
server 2.ubuntu.pool.ntp.org
server 3.ubuntu.pool.ntp.org

After that I save the changes and restart the ntp as follows

root@saasbook:/# /etc/init.d/ntp restart
 * Stopping NTP server ntpd                                              [ OK ] 
 * Starting NTP server ntpd                                              [ OK ]

Even after doing all these, the time on my system does not change. Is there something I am mising ?

OneMoreError

Posted 2012-12-09T05:34:56.790

Reputation: 111

1It probably won't work because you're on a virtual server and you can't adjust the clock of the Windows host. What happens if you try this as root? ntpdate ntp.ubuntu.com – None – 2012-12-09T05:45:40.980

It gives me this time 8 Dec 21:46:41 ntpdate[2498]: the NTP socket is in use, exiting. However, the time in my country is different. – None – 2012-12-09T05:47:41.603

Seems that you're trying to use ntpd and ntpdate at the same time. ntpdate is for manual updates, ntpd is a daemon which does updates automatically. – None – 2012-12-10T03:43:15.933

One more thing -- why did you decide that your time doesn't change? Could you show "grep ntpd /var/log/daemon"? – None – 2012-12-10T03:47:05.670

Please add the output of ntpq -p. – Reinstate Monica - M. Schröder – 2012-12-12T20:23:03.097

Welcome to [su]! Your post was migrated here from [so]. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question. – Reinstate Monica - M. Schröder – 2012-12-12T20:24:27.043

No answers