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

Solve the problem of managing containers with Docker Compose

In Docker's design, a container runs only one...

Vue makes a simple random roll call

Table of contents Layout part: <div id="a...

Understand CSS3 Grid layout in 10 minutes

Basic Introduction In the previous article, we in...

Differences between Windows Server 2008R2, 2012, 2016, and 2019

Table of contents Common version introduction Com...

How to prevent website content from being included in search engines

Usually the goal of building a website is to have...

Upgrade MySQL 5.1 to 5.5.36 in CentOS

This article records the process of upgrading MyS...

How to quickly deploy Redis as a Docker container

Table of contents getting Started Data storage Co...

Detailed explanation of JavaScript axios installation and packaging case

1. Download the axios plugin cnpm install axios -...

Summary of MySQL database usage specifications

Introduction: Regarding MySQL database specificat...

How to make form input and other text boxes read-only and non-editable in HTML

Sometimes, we want the text boxes in the form to b...

How to build YUM in Centos7 environment

1. Enter the configuration file of the yum source...

Summary of Linux vi command knowledge points and usage

Detailed explanation of Linux vi command The vi e...

Some experience sharing on enabling HTTPS

As the domestic network environment continues to ...