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虚拟机优化心得 虚拟显卡硬伤,所以必须要优化下才能用,优化的原则就是能精简的精简, ...
随机推荐
- 17JQuery高级
1. 动画 1. 三种方式显示和隐藏元素 1. 默认显示和隐藏方式 1. show([speed,[easing],[fn]]) 1. 参数: 1. speed:动画的速度.三个预定义的值(" ...
- spring+mybatis 多数据源的配置
方式一: 参见博客https://www.cnblogs.com/AmbitiousMice/p/6027674.html 此种方式每次需要在调用dao的时候设置对应的数据源. 方式二: 直接在myb ...
- 自我介绍 & 友链
"Never say never until the very end." --Flere825 想了想其实没什么可介绍的--毕竟我这么菜也没多少人认识我qwq还是写一点吧. 某弱 ...
- SQL手工注入技巧
MYSQL篇 1.内置函数和变量 @@datadir,version(),database(),user(),load_file(),outfile() 2.利用concat(),group_conc ...
- HttpServlet容器响应Web客户请求流程?
1)Web客户向Servlet容器发出Http请求: 2)Servlet容器解析Web客户的Http请求: 3)Servlet容器创建一个HttpRequest对象,在这个对象中封装Http请求信息: ...
- Python实现PDF文件截取
python3截取PDF文件中的一部分. from PyPDF2 import PdfFileWriter, PdfFileReader # 开始页 start_page = 0 # 截止页 end_ ...
- C# webapi
HttpContextBase context = (HttpContextBase)Request.Properties["MS_HttpContext"];//获取传统cont ...
- Python天天学_05_模块
Python_day_05 金角大王: http://www.cnblogs.com/alex3714/articles/5161349.html ------Python是一个优雅的大姐姐 学习方式 ...
- Nowcoder Circulant Matrix ( FWT )
题目链接 题意 : 给你一个a数组和b数组,构造出A[i][j]矩阵(A[i][j] = a[i xor j]) 给出等式 A * x = b ( mod p ) n等于4的时候有: A[0][0]* ...
- 报错:没有与参数列表匹配的构造函数 "CFileDialog::CFileDialog" 实例
如果是在解决方案管理器窗口内,右击你的项目“项目”,然后选“属性”(最后一项),再点“配置属性”,是个“+”号,把它展开,然后选“常规”选项卡,倒数第三项“字符集”,选择“使用多字节字符集”.再编译应 ...