I'm running Ubuntu in a VM. How do I disable ntpd?

share|improve this question
1  
Out of curiosity, why would you want to? Does it do harm when running on a VM? – Snekse Dec 19 '12 at 19:04
    
Use case: To test what happens to an embedded system if ntp is not available. – Martin Hennings May 24 '17 at 12:45

To stop ntpd:

sudo /etc/init.d/ntp stop

or

sudo service ntp stop

To prevent it from starting at boot:

sudo update-rc.d -f ntp remove
share|improve this answer

Uninstall ntpd if it is installed. You will still have ntpdate installed. (It is difficult to remove.) Prevent it from executing by adding exit 0 to /etc/default/ntpdate.

share|improve this answer

With systemd, the two commands are:

sudo systemctl stop ntp
sudo systemctl disable ntp

Output (I think the warning can be ignored)

ntp.service is not a native service, redirecting to systemd-sysv-install
Executing /lib/systemd/systemd-sysv-install disable ntp
insserv: warning: current start runlevel(s) (empty) of script `ntp' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (1 2 3 4 5) of script `ntp' overrides LSB defaults (1).
insserv: warning: current start runlevel(s) (empty) of script `ntp' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (1 2 3 4 5) of script `ntp' overrides LSB defaults (1).

Check:

systemctl is-enabled ntp

Output

ntp.service is not a native service, redirecting to systemd-sysv-install
Executing /lib/systemd/systemd-sysv-install is-enabled ntp
disabled
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.