解决VMware 虚拟机中Linux系统时间不准确问题(安装VMware Tools)

2022-06-22 14:36:35 浏览数 (1)

环境介绍:

CentOS 7.5

VMware Workstation 15 pro

安装VMware Tools:

选中要安装VMware Tools的虚拟机,点击鼠标右键,点击安装 VMware Tools。如果安装了早期版本的 VMware Tools,则菜单项是更新 VMware Tools。

在这里插入图片描述 创建挂载点目录并挂载

代码语言:javascript复制
[root@test2 ~]# mkdir /mnt/cdrom

[root@test2 ~]# mount /dev/cdrom /mnt/cdrom
mount: /dev/sr0 写保护,将以只读方式挂载

[root@test2 ~]# df -h
文件系统                 容量  已用  可用 已用% 挂载点
/dev/mapper/centos-root   17G   12G  5.6G   68% /
devtmpfs                 1.1G     0  1.1G    0% /dev
tmpfs                    1.1G     0  1.1G    0% /dev/shm
tmpfs                    1.1G  9.6M  1.1G    1% /run
tmpfs                    1.1G     0  1.1G    0% /sys/fs/cgroup
/dev/sda1               1014M  130M  885M   13% /boot
tmpfs                    211M     0  211M    0% /run/user/0
/dev/sr0                  55M   55M     0  100% /mnt/cdrom

[root@test2 ~]# cd /mnt/cdrom/

[root@test2 cdrom]# ls
manifest.txt  run_upgrader.sh  VMwareTools-10.3.2-9925305.tar.gz  vmware-tools-upgrader-32  vmware-tools-upgrader-6

`报错:`

 如果直接在挂载点目录下解压,会出现以下报错:“tar: vmware-tools-distrib:无法 mkdir: 只读文件系统”,可以将VMware Tools安装包拷贝到其他目录再解压即可。

代码语言:javascript复制
[root@test2 cdrom]# tar -zxvf /mnt/cdrom/VMwareTools-10.3.2-9925305.tar.gz
vmware-tools-distrib/
tar: vmware-tools-distrib:无法 mkdir: 只读文件系统
vmware-tools-distrib/bin/
tar: vmware-tools-distrib:无法 mkdir: 只读文件系统
tar: vmware-tools-distrib/bin:无法 mkdir: 没有那个文件或目录
vmware-tools-distrib/bin/vm-support
tar: vmware-tools-distrib:无法 mkdir: 只读文件系统
tar: vmware-tools-distrib/bin/vm-support:无法 open: 没有那个文件或目录
vmware-tools-distrib/bin/vmware-config-tools.pl
tar: vmware-tools-distrib:无法 mkdir: 只读文件系统
tar: vmware-tools-distrib/bin/vmware-config-tools.pl:无法 open: 没有那个文件或目录
vmware-tools-distrib/bin/vmware-uninstall-tools.pl
tar: vmware-tools-distrib:无法 mkdir: 只读文件系统
tar: vmware-tools-distrib/bin/vmware-uninstall-tools.pl:无法 open: 没有那个文件或目录
vmware-tools-distrib/vgauth/
tar: vmware-tools-distrib:无法 mkdir: 只读文件系统
tar: vmware-tools-distrib/vgauth:无法 mkdir: 没有那个文件或目录
vmware-tools-distrib/vgauth/schemas/
tar: vmware-tools-distrib:无法 mkdir: 只读文件系统
tar: vmware-tools-distrib/vgauth/schemas:无法 mkdir: 没有那个文件或目录
vmware-tools-distrib/vgauth/schemas/xmldsig-core-schema.xsd
tar: vmware-tools-distrib:无法 mkdir: 只读文件系统
tar: vmware-tools-distrib/vgauth/schemas/xmldsig-core-schema.xsd:无法 open: 没有那个文件或目录
vmware-tools-distrib/vgauth/schemas/XMLSchema.xsd
tar: vmware-tools-distrib:无法 mkdir: 只读文件系统

拷贝VMware Tools安装包并解压

代码语言:javascript复制
[root@test2 cdrom]# cp VMwareTools-10.3.2-9925305.tar.gz /tmp/

[root@test2 cdrom]# cd /tmp/

[root@test2 tmp]# ls *.tar.gz
VMwareTools-10.3.2-9925305.tar.gz     

[root@test2 tmp]# tar -zxvf VMwareTools-10.3.2-9925305.tar.gz
vmware-tools-distrib/
vmware-tools-distrib/bin/
vmware-tools-distrib/bin/vm-support
vmware-tools-distrib/bin/vmware-config-tools.pl
vmware-tools-distrib/bin/vmware-uninstall-tools.pl
vmware-tools-distrib/vgauth/
vmware-tools-distrib/vgauth/schemas/
vmware-tools-distrib/vgauth/schemas/xmldsig-core-schema.xsd
vmware-tools-distrib/vgauth/schemas/XMLSchema.xsd
vmware-tools-distrib/vgauth/schemas/saml-schema-assertion-2.0.xsd
vmware-tools-distrib/vgauth/schemas/catalog.xml
vmware-tools-distrib/vgauth/schemas/XMLSchema.dtd
vmware-tools-distrib/vgauth/schemas/xml.xsd
vmware-tools-distrib/vgauth/schemas/xenc-schema.xsd
vmware-tools-distrib/vgauth/schemas/datatypes.dtd
vmware-tools-distrib/vgauth/schemas/XMLSchema-instance.xsd
vmware-tools-distrib/vgauth/schemas/XMLSchema-hasFacetAndProperty.xsd
vmware-tools-distrib/caf/
vmware-tools-distrib/caf/etc/
vmware-tools-distrib/caf/etc/vmware-caf/
vmware-tools-distrib/caf/etc/vmware-caf/pme/
vmware-tools-distrib/caf/etc/vmware-caf/pme/config/
vmware-tools-distrib/caf/etc/vmware-caf/pme/config/CommAmqpListener-appconfig
.......

安装VMware Tools

在安装VMware Tools的时候,会有很多设置项,除了以下两项需要更改,其余的设置项直接默认回车即可。

代码语言:javascript复制
[root@test2 tmp]# cd vmware-tools-distrib/

[root@test2 vmware-tools-distrib]# ./vmware-install.pl
open-vm-tools packages are available from the OS vendor and VMware recommends
using open-vm-tools packages. See http://kb.vmware.com/kb/2073803 for more
information.
Do you still want to proceed with this installation? [no] y
-你还想继续这个安装吗?(默认是no)
INPUT: [y]

Creating a new VMware Tools installer database using the tar4 format.

Installing VMware Tools.
...
The path "" is not a valid path to the 3.10.0-862.el7.x86_64 kernel headers.
Would you like to change it? [yes] no
-路径“”不是3.10.0-862.el7x86_64内核头的有效路径。你想换一下吗?(默认是yes)
INPUT: [no]

WARNING: This program cannot compile any modules for the following reason(s)...
...
Creating a new initrd boot image for the kernel.
Generating the key and certificate files.
Successfully generated the key and certificate files.
The configuration of VMware Tools 10.3.2 build-9925305 for Linux for this
running kernel completed successfully.

You must restart your X session before any mouse or graphics changes take
effect.

To enable advanced X features (e.g., guest resolution fit, drag and drop, and
file and text copy/paste), you will need to do one (or more) of the following:
1. Manually start /usr/bin/vmware-user
2. Log out and log back into your desktop session
3. Restart your X session.

Enjoy,

--the VMware team

Found VMware Tools CDROM mounted at /mnt/cdrom. Ejecting device /dev/sr0 ...

查看时间是否已同步

代码语言:javascript复制
[root@test2 vmware-tools-distrib]# date
2020年 05月 25日 星期一 14:02:15 CST

0 人点赞