vmware虚拟机设置时区、时间
首先查看时间发现和百度的时间不一样
[root@www ~]# date
Wed Dec 5 14:00:32 CST 2018
1、配置ntp服务器,设置时区同步,请参照ntp篇 https://www.cnblogs.com/effortsing/p/10011459.html
上面操作完后时间仍然无法同步,需要操作下面才可以
2、设置vmare虚拟机时区:
2.1 设置时区为上海
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 设置时区为上海
2.1 然后通过tzselect命令来修改时区
执行tzselect命令 --> 选择Asia --> 选择China --> 选择Beijing — 选择yes ,
执行完tzselect命令选择时区后,时区并没有更改,将export TZ=Asia/Shanghai 添加到/etc/profile文 件中去,然后退出并重新登陆即可。
sed -i '$a\export TZ=Asia/Shanghai' /etc/profile && source /etc/profile && date
下面是执行过程
[root@www ~]# tzselect
Please identify a location so that time zone rules can be set correctly.
Please select a continent or ocean.
1) Africa
2) Americas
3) Antarctica
4) Arctic Ocean
5) Asia
6) Atlantic Ocean
7) Australia
8) Europe
9) Indian Ocean
10) Pacific Ocean
11) none - I want to specify the time zone using the Posix TZ format.
#? 5
Please select a country.
1) Afghanistan 18) Israel 35) Palestine
2) Armenia 19) Japan 36) Philippines
3) Azerbaijan 20) Jordan 37) Qatar
4) Bahrain 21) Kazakhstan 38) Russia
5) Bangladesh 22) Korea (North) 39) Saudi Arabia
6) Bhutan 23) Korea (South) 40) Singapore
7) Brunei 24) Kuwait 41) Sri Lanka
8) Cambodia 25) Kyrgyzstan 42) Syria
9) China 26) Laos 43) Taiwan
10) Cyprus 27) Lebanon 44) Tajikistan
11) East Timor 28) Macau 45) Thailand
12) Georgia 29) Malaysia 46) Turkmenistan
13) Hong Kong 30) Mongolia 47) United Arab Emirates
14) India 31) Myanmar (Burma) 48) Uzbekistan
15) Indonesia 32) Nepal 49) Vietnam
16) Iran 33) Oman 50) Yemen
17) Iraq 34) Pakistan
#? 9
Please select one of the following time zone regions.
1) Beijing Time
2) Xinjiang Time
#? 1
The following information has been given:
China
Beijing Time
Therefore TZ='Asia/Shanghai' will be used.
Local time is now: Wed Dec 5 13:57:48 CST 2018.
Universal Time is now: Wed Dec 5 05:57:48 UTC 2018.
Is the above information OK?
1) Yes
2) No
#? 1
You can make this change permanent for yourself by appending the line
TZ='Asia/Shanghai'; export TZ
to the file '.profile' in your home directory; then log out and log in again.
Here is that TZ value again, this time on standard output so that you
can use the /usr/bin/tzselect command in shell scripts:
Asia/Shanghai
[root@www ~]# sed -i '$a\export TZ=Asia/Shanghai' /etc/profile
[root@www ~]# sed -i '$d' /etc/profile
查看时间已经正常
[root@www ~]# date
Wed Dec 5 14:11:49 CST 2018
https://blog.csdn.net/weixin_38323645/article/details/83046172
vmware虚拟机设置时区、时间的更多相关文章
- 给vmware虚拟机设置Ip,使用xshell远程连接Centos
参考下面两位的分享才弄好,发表之前先对原作者表示感谢! 给Centos配置网络以及使用xshell远程连接Centos http://www.cnblogs.com/fuly550871915/p/4 ...
- VMWare虚拟机设置固定ip上网方法
转自:http://blog.csdn.net/cyberrusher/article/details/7269795 1. 在VMWare工具栏中打开:编辑--->虚拟机网络编辑器, 打开VM ...
- Vmware虚拟机设置静态IP地址
一.安装好虚拟后在菜单栏选择编辑→ 虚拟网络编辑器,打开虚拟网络编辑器对话框,选择Vmnet8 Net网络连接方式,随意设置子网IP,点击NAT设置页面,查看子网掩码和网关,后面修改静态IP会用到. ...
- VMWare 虚拟机设置网络访问
使用桥接模式 将本机IP设置为和虚拟机IP在同一个可以上网的网段中
- vmware 虚拟机设置 redhat 桥接模式
1.设置 vmware 网络模式 2.设置 linux 网络模式
- Vmware虚拟机设置主机端口映射
转载自:https://blog.csdn.net/Mrqiang9001/article/details/80820321
- VMware虚拟机怎么从U盘启动
VMware虚拟机怎么从U盘启动 发布时间:2016-01-12 18:50发布者:系统城-xtcjh浏览数:41951 VMware Workstation虚拟机可以安装各种操作系统,很多用户就想在 ...
- VMware中Linux系统时间与主机同步以及时区设置
网络上有各种资料,但最简单的一种方法就是修改虚拟机的配置文件 *.vmx .修改 tools.syncTime = "FALSE" 为 tools.syncTime = " ...
- VMware 12安装虚拟机Mac OS X 10.10使用小技巧(虚拟机Mac OS X 10.10时间设置,虚拟机Mac OS X 10.10通过代理上网,Mac OS X 10.10虚拟机优化,VMware虚拟机相互复制)
1:修改Mac OS 系统时间 2:Mac OS系统 通过代理上网 VMware 12安装Mac OS X 10.10虚拟机优化心得 虚拟显卡硬伤,所以必须要优化下才能用,优化的原则就是能精简的精简, ...
随机推荐
- Laying out a webpage is easy with flex
Flex写起来省劲很多,只用加上flex-wrap:wrap在container上.Html5 playground
- TP5 中的redis 队列
首先我们看一下自己的TP5的框架中的 TP5\vendor\topthink ,这个文件中有没有think-queue这个文件夹,如果没有请安装, 安装这个是要用到Composer的如果没有安装co ...
- QT的DPI支持
在main函数第一行加入: QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); 鼠标不按下也响应移动事件: setMouseTra ...
- qt类表
- Spring前台填充数据
举例: <div>${userinfo.name}</div> 显示规则 1.先判断对象有没有存在,对象存在的时候,才会查找对象里的字段.这个时候字段必须正确.2.如果对象 ...
- python 文件定位
tell()方法告诉你文件内的当前位置, 换句话说,下一次的读写会发生在文件开头这么多字节之后. seek(offset [,from])方法改变当前文件的位置.Offset变量表示要移动的字节数.F ...
- CF 354 div2 B 酒杯金字塔
B. Pyramid of Glasses time limit per test 1 second memory limit per test 256 megabytes input standar ...
- POJ 1087 最大流裸题 + map
A Plug for UNIX Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 15597 Accepted: 5308 ...
- 【POJ1011】Sticks
[题目概括] 现在有\(n\)个长度不超过\(50\)的木棍,请你把这些小木棍拼成若干根长度相同的木棍. 请你最小化拼成后的长度. [思路要点] 考虑枚举最后的长度,然后判断是否可以,这样就不需要最优 ...
- cmake 简单操作
实例一: main.c #include <stdio.h> int main( int argc, char *argv[] ) { printf("hello cmake!\ ...