Virtual Machine Linux and host time synchronization

Source: Internet
Author: User
Tags i18n local time locale

Go Linux synchronizes time in a virtual machine

http://www.enkj.com/help/newscontent/55643

The time synchronization can be achieved by experiment.


The time display problem was found after rebooting the system:
[[Email protected] ~]# Date
Sat Mar 7 08:58:27 PST 2009
In fact, it is Beijing time March 8, 2009 00:58, a difference of 16 hours.
Online Search PST time, the original PST time for the United States Pacific Standard Time, this time zone is located in Greenwich West 8 time zone, late Beijing time 16 hours. (This is the vmware6.5 automatic installation of RHEL5 system to blame)

Discover/etc/sysconfig/clock files are configured in United States time:
[Email protected] ~]# Cat/etc/sysconfig/clock
Zone= "America/los_angeles"
Utc=true
Arc=false

UTC is true to indicate that the RTC is saved in UTC time, and False indicates that the local time is saved.
It is then modified to:
[Email protected] ~]# Cat/etc/sysconfig/clock
Zone= "Asia/shanghai"
Utc=false
Arc=false

The problem continues after rebooting the system! So I thought of the locale
[Email protected] ~]# locale
Lang=en_us. UTF-8
Lc_ctype= "en_US. UTF-8 "
Lc_numeric= "en_US. UTF-8 "
Lc_time= "en_US. UTF-8 "
Lc_collate= "en_US. UTF-8 "
Lc_monetary= "en_US. UTF-8 "
Lc_messages= "en_US. UTF-8 "
Lc_paper= "en_US. UTF-8 "
Lc_name= "en_US. UTF-8 "
Lc_address= "en_US. UTF-8 "
Lc_telephone= "en_US. UTF-8 "
Lc_measurement= "en_US. UTF-8 "
Lc_identification= "en_US. UTF-8 "
Lc_all=

[Email protected] ~]# cat/etc/sysconfig/i18n
Lang= "en_US. UTF-8 "
Sysfont= "Latarcyrheb-sun16"
Modified to:
[Email protected] ~]# cat/etc/sysconfig/i18n
Lang= "ZH_CN. UTF-8 "/* English environment can be changed to Zh_us. UTF-8 * *
Sysfont= "Latarcyrheb-sun16"

Save exit Log on again to execute date
[[Email protected] ~]# Date
March 07, 2009 Saturday 09:13:44 PST


If the above is not set, try the following command

Or show PST time,

# Rm/etc/localtime
# Ln-sf/usr/share/zoneinfo/asia/shanghai/etc/localtime

Virtual Machine Linux and host time synchronization

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.