Solve the problem that the VMWare virtual machine centos time is inconsistent with the local time

Solve the problem that the VMWare virtual machine centos time is inconsistent with the local time

The time of VM Ware virtual machine centos is inconsistent with the local time, as shown in the figure below. It is probably a problem with the time zone setting. Just set it to China Standard Time, CST.

insert image description here

Solution

1. Install the time synchronization plug-in ntpdate yum install ntpdate

insert image description here

2. Start the service service ntpdate restart or systemctl restart ntpdate

insert image description here

3. Set the time zone

1). Delete local time (US time): rm -rf /etc/localtime

2). Set the time zone to Shanghai: ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

4. Verification

Enter the date to see if it is correct

insert image description here

5. But after reboot, it failed.

insert image description here

6. Put it in crond

NTP Network Time Protocol, put it in crond, that is, it is the same as the network time at all times. After restart, it still takes effect. OK!

crond -e

Add this line of information:

* * * * * /usr/sbin/ntpdate us.pool.ntp.org | logger -t NTP

insert image description here
insert image description here

This is the end of this article about the inconsistency between VMWare virtual machine centos time and local time. For more relevant VMWare virtual machine centos time content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • VMware installation of CentOS virtual machine and configuration network graphic tutorial
  • CentOS7 network configuration under VMware virtual machine (host wireless Internet access)
  • Detailed explanation of VMware12 installation centOS8 configuration graphic tutorial (vm virtual machine installation centos8 tutorial)
  • How to install centOS8 in VMware12 (tutorial on installing centos8 in vm virtual machine)
  • Tutorial diagram of installing centos7.3 on vmware virtual machine

<<:  Use Typescript configuration steps in Vue

>>:  Fixed table width table-layout: fixed

Recommend

Complete example of Vue encapsulating the global toast component

Table of contents Preface 1. With vue-cli 1. Defi...

MySQL joint table query basic operation left-join common pitfalls

Overview For small and medium-sized projects, joi...

JavaScript to implement dynamic digital clock

This article shares the specific code for impleme...

base target="" specifies the target of the base link to open the frame

<base target=_blank> changes the target fram...

How to create a child process in nodejs

Table of contents Introduction Child Process Crea...

Vue v-model related knowledge summary

​v-model is a Vue directive that provides two-way...

How to forget the root password in Mysql8.0.13 under Windows 10 system

1. First stop the mysql service As an administrat...

Example of disabling browser cache configuration in Vue project

When releasing a project, you will often encounte...

js dynamically generates tables (node ​​operations)

This article example shares the specific code of ...

Detailed installation process of MySQL5.6.40 under CentOS7 64

MySQL5.6.40 installation process under CentOS7 64...

How to choose between MySQL CHAR and VARCHAR

Table of contents VARCHAR and CHAR Types Conclusi...