我在 VMware Fusion 中构建了一个 Centos 6.9 VM,并关闭了同步时间,并遵循了以下文档:
但是,当我暂停和恢复虚拟机时仍然存在问题,时钟仍然关闭,因为它不会自动重新同步。
这就是我所拥有的:
uname -a
Linux demo.bluetalon.local 2.6.32-696.el6.x86_64 #1 SMP 2017 年 3 月 21 日星期二 19:29:05 UTC x86_64 x86_64 x86_64 GNU/Linux
ntpd --version
ntpd 4.2.6p5
ntpd [email protected] Thu Oct 26 10:57:32 UTC 2017 (1)
/boot/grub/grub.conf
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS 6 (2.6.32-696.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-696.el6.x86_64 ro root=/dev/mapper/vg_cdh-lv_root rd_NO_LUKS rd_LVM_LV=vg_cdh/lv_root rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_LVM_LV=vg_cdh/lv_swap rd_NO_DM LANG=en_US.UTF-8 rhgb quiet clock=pmtmr divider=10
initrd /initramfs-2.6.32-696.el6.x86_64.img
/etc/ntp.conf
# For more information about this file, see the man pages
# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).
tinker panic 0
driftfile /var/lib/ntp/drift
# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
# Permit all access over the loopback interface. This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 127.0.0.1
restrict -6 ::1
# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst
#broadcast 192.168.1.255 autokey # broadcast server
#broadcastclient # broadcast client
#broadcast 224.0.1.1 autokey # multicast server
#multicastclient 224.0.1.1 # multicast client
#manycastserver 239.255.254.254 # manycast server
#manycastclient 239.255.254.254 autokey # manycast client
# Enable public key cryptography.
#crypto
includefile /etc/ntp/crypto/pw
# Key file containing the keys and key identifiers used when operating
# with symmetric key cryptography.
keys /etc/ntp/keys
# Specify the key identifiers which are trusted.
#trustedkey 4 8 42
# Specify the key identifier to use with the ntpdc utility.
#requestkey 8
# Specify the key identifier to use with the ntpq utility.
#controlkey 8
# Enable writing of statistics records.
#statistics clockstats cryptostats loopstats peerstats
同步时间的唯一方法是运行:
service ntpd stop;ntpd -gq;service ntpd start;date
知道如何修复这个问题吗?
答案1
我决定不使用 NTP,而是使用 Vmware Tools。
vi /etc/yum.repos.d/vmware.repo
[vmware-tools]
name=VMware Tools for Red Hat Enterprise Linux $releasever - $basearch
baseurl=http://packages.vmware.com/tools/esx/latest/rhel6/$basearch
enabled=1
gpgcheck=1
gpgkey=http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-RSA-KEY.pub
sudo yum install -y vmware-tools-esx-nox