VCSA中linux系统虚拟机 (CentOS/RHEL最小化安装版) 安装 VMware Tools

本文详细描述了在VCSA环境中,如何在CentOS/RHEL最小化安装的Linux虚拟机上安装VMwareTools,包括挂载镜像、验证文件、解压和执行安装脚本的过程,以及安装完成后如何卸载镜像。
摘要由CSDN通过智能技术生成

VCSA中linux系统虚拟机 (CentOS/RHEL最小化安装版) 安装 VMware Tools

一、简介

# 在VCSA中创建完虚拟机后,创建的虚拟机默认是没有安装VMware Tools工具的。
本文以VCSA中部署的最小化安装的CentOS 7虚拟机为例,详细介绍了在VCSA中如何安装VMware Tools工具。

二、进安装VMware Tools前准备工作

1)在VCSA页面中,点击 “安装VMware Tools”,如下图所示

# 注意:执行该步骤时,虚拟机要在开机的情况下才可以执行成功

image-20230913211704830

2)点击 “挂载”,如下图所示

image-20230913220656311

3)在虚拟机的编辑设置中,查看CD/DVD驱动器中“VMware Tools”镜像文件的状态为“已连接”

image-20230913221020495

三、进入系统后的相关操作

1)验证“VMware Tools”镜像文件在系统内部是否可以看到,创建挂载目录,并挂载

# 1、在/dev/目录下有cdrom
[root@localhost ~]# ll /dev/cdrom 
lrwxrwxrwx. 1 root root 3 913 22:07 /dev/cdrom -> sr0

# 2、创建挂载点
[root@localhost ~]# mkdir /mnt/cdrom

# 3、挂载“VMware Tools”镜像文件
[root@localhost ~]# mount -t iso9660 /dev/cdrom /mnt/cdrom
mount: /dev/sr0 写保护,将以只读方式挂载

[root@localhost ~]# ll /mnt/cdrom/
总用量 56840
-r-xr-xr-x. 1 root root     1976 102 2019 manifest.txt
-r-xr-xr-x. 1 root root     4943 102 2019 run_upgrader.sh
-r--r--r--. 1 root root 56405224 102 2019 VMwareTools-10.3.21-14772444.tar.gz
-r-xr-xr-x. 1 root root   872044 102 2019 vmware-tools-upgrader-32
-r-xr-xr-x. 1 root root   918184 102 2019 vmware-tools-upgrader-64

2)拷贝“VMware Tools”镜像文件中的tar包文件至家目录,并解压

# 拷贝“VMware Tools”安装程序的tar包文件
[root@localhost ~]# cp /mnt/cdrom/VMwareTools-10.3.21-14772444.tar.gz ~
[root@localhost ~]# 
[root@localhost ~]# ls
anaconda-ks.cfg  VMwareTools-10.3.21-14772444.tar.gz

# 解压tar包文件
[root@localhost ~]# tar zxvf VMwareTools-10.3.21-14772444.tar.gz 


# 进入解压后的文件夹
[root@localhost ~]# ls
anaconda-ks.cfg  VMwareTools-10.3.21-14772444.tar.gz  vmware-tools-distrib
[root@localhost ~]# cd vmware-tools-distrib/
[root@localhost vmware-tools-distrib]#
[root@localhost vmware-tools-distrib]# ls
bin  caf  doc  etc  FILES  INSTALL  installer  lib  vgauth  vmware-install.pl
[root@localhost vmware-tools-distrib]# ll
总用量 380
drwxr-xr-x.  2 root root     84 102 2019 bin
drwxr-xr-x.  5 root root     36 102 2019 caf
drwxr-xr-x.  2 root root     64 102 2019 doc
drwxr-xr-x.  5 root root   4096 102 2019 etc
-rw-r--r--.  1 root root 146996 102 2019 FILES
-rw-r--r--.  1 root root   2538 102 2019 INSTALL
drwxr-xr-x.  2 root root     91 102 2019 installer
drwxr-xr-x. 14 root root   4096 102 2019 lib
drwxr-xr-x.  3 root root     20 102 2019 vgauth
-rwxr-xr-x.  1 root root 227024 102 2019 vmware-install.pl

3)执行VMware Tools安装 : 预置环境部署

# 前置条件:系统中需已安装gcc,gcc++环境,若未安装,需执行以下命令
[root@localhost ~]# yum install -y gcc gcc*
执行安装程序时,报错提示:/usr/bin/perl: 坏的解释器: 没有那个文件或目录
[root@localhost vmware-tools-distrib]# ./vmware-install.pl                                                         
-bash: ./vmware-install.pl: /usr/bin/perl: 坏的解释器: 没有那个文件或目录  
# 报错原因为:没有安装perl环境,需手动安装perl环境,执行以下命令:
[root@localhost vmware-tools-distrib]# yum install -y perl

4)安装VMware Tools可执行文件:vmware-install.pl

[root@localhost 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] yes			#  此处手动输入yes,其他位置直接回车,选择默认即可

INPUT: [yes]

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

Installing VMware Tools.

In which directory do you want to install the binary files? 
[/usr/bin]

INPUT: [/usr/bin]  default

What is the directory that contains the init directories (rc0.d/ to rc6.d/)? 
[/etc/rc.d]

INPUT: [/etc/rc.d]  default

What is the directory that contains the init scripts?
[/etc/rc.d/init.d]

INPUT: [/etc/rc.d/init.d]  default

In which directory do you want to install the daemon files? 
[/usr/sbin]

INPUT: [/usr/sbin]  default

In which directory do you want to install the library files?
[/usr/lib/vmware-tools]

INPUT: [/usr/lib/vmware-tools]  default

The path "/usr/lib/vmware-tools" does not exist currently. This program is
going to create it, including needed parent directories. Is this what you want?
[yes]

INPUT: [yes]  default

In which directory do you want to install the common agent library files? 
[/usr/lib]

INPUT: [/usr/lib]  default

In which directory do you want to install the common agent transient files? 
[/var/lib]

INPUT: [/var/lib]  default

In which directory do you want to install the documentation files? 
[/usr/share/doc/vmware-tools]

INPUT: [/usr/share/doc/vmware-tools]  default

The path "/usr/share/doc/vmware-tools" does not exist currently. This program
is going to create it, including needed parent directories. Is this what you
want? [yes]

INPUT: [yes]  default

The installation of VMware Tools 10.3.21 build-14772444 for Linux completed 
successfully. You can decide to remove this software from your system at any
time by invoking the following command: "/usr/bin/vmware-uninstall-tools.pl".

Before running VMware Tools for the first time, you need to configure it by 
invoking the following command: "/usr/bin/vmware-config-tools.pl". Do you want
this program to invoke the command for you now? [yes]

INPUT: [yes]  default

Initializing...


Making sure services for VMware Tools are stopped.

Stopping vmware-tools (via systemctl):  [  确定  ]


The module vmci has already been installed on this system by another installer 
or package and will not be modified by this installer.

The module vsock has already been installed on this system by another installer
or package and will not be modified by this installer.

The module vmxnet3 has already been installed on this system by another
installer or package and will not be modified by this installer.

The module pvscsi has already been installed on this system by another
installer or package and will not be modified by this installer.

The module vmmemctl has already been installed on this system by another
installer or package and will not be modified by this installer.

The VMware Host-Guest Filesystem allows for shared folders between the host OS 
and the guest OS in a Fusion or Workstation virtual environment.  Do you wish
to enable this feature? [no]

INPUT: [no]  default

The vmxnet driver is no longer supported on kernels 3.3 and greater. Please
upgrade to a newer virtual NIC. (e.g., vmxnet3 or e1000e)

The vmblock enables dragging or copying files between host and guest in a 
Fusion or Workstation virtual environment.  Do you wish to enable this feature?
[no]

INPUT: [no]  default


Skipping configuring automatic kernel modules as no drivers were installed by
this installer.

Do you want to enable Guest Authentication (vgauth)? Enabling vgauth is needed 
if you want to enable Common Agent (caf). [yes]

INPUT: [yes]  default

Do you want to enable Common Agent (caf)? [no]

INPUT: [no]  default

No X install found.


Skipping rebuilding initrd boot image for kernel as no drivers to be included
in boot image were installed by this installer.

Generating the key and certificate files.
Successfully generated the key and certificate files.
manageSELinux install: The 'semanage' utility was not found.
There was an error configuring the SELinux security context for VMware Tools.
Please make certain that SELinux is configured correctly.

The configuration of VMware Tools 10.3.21 build-14772444 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.

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

--the VMware team

[root@localhost vmware-tools-distrib]# 

四、安装完成后,需卸载VMware Tools镜像

image-20230913224718511

# 安装完成后,需在命令行执行以下命令卸载VMware Tools镜像,释放挂载的镜像
[root@localhost vmware-tools-distrib]# umount /dev/cdrom 
umount: /dev/cdrom:未挂载

image-20230913224835301

至此,已完成在VCSA中对linux系统命令行版虚拟机VMware Tools工具的安装。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

指尖@韶华

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值