VMware下centos7安装VMware Tools

时间:2022-10-29 18:23:19
右键虚拟机设置,找到CD/DVD,选择使用ISO映像文件,在VMware安装目录下找到linux.iso。
VMware下centos7安装VMware Tools
 
挂载iso文件
> mount -t auto /dev/cdrom /mnt/cdrom

如果/mnt下没有cdrom文件夹,则创建

> cd /mnt
> mkdir cdrom
把/mnt/cdrom下的VMwareTools-10.0.10-4301679.tar.gz拷贝到/data目录下
> cd /mnt/cdrom
> cp VMwareTools-10.0.10-4301679.tar.gz /data
解压压缩包并执行vmware-install.pl
> tar -zxvf VMwareTools-10.0.10-4301679.tar.gz
> cd vmware-tools-distrib
> ./vmware-install.pl
Do you still want to proceed with this legacy installer? yes

看到如下信息一路回车默认就好了

Installing VMware Tools.

In which directory do you want to install the binary files?
[/usr/bin] What is the directory that contains the init directories (rc0.d/ to rc6.d/)?
[/etc/rc.d] What is the directory that contains the init scripts?
[/etc/rc.d/init.d] In which directory do you want to install the daemon files?
[/usr/sbin] In which directory do you want to install the library files?
[/usr/lib/vmware-tools]

如果一直提示如下信息

What is the location of the "ifconfig" program on your machine?

请安装ifconfig,重新执行vmware-install.pl

> yum search ifconfig
> yum install net-tools.x86_64

如果一直提示如下信息

The path "" is not a valid path to the 3.10.0-327.el7.x86_64 kernel headers.
Would you like to change it?

则需要安装

> yum install kernel-devel

然后在上面的步骤里输入内核头文件的目录

/usr/src/kernels/3.10.0-327.36.3.el7.x86_64/include

如果出现如下信息

The path "/usr/src/kernels/3.10.0-327.36.3.el7.x86_64/include" is not a valid
path to the 3.10.0-327.el7.x86_64 kernel headers

> ln -s /usr/src/kernels/3.10.0-327.36.3.el7.x86_64/include/generated/uapi/linux/version.h
/usr/src/kernels/3.10.0-327.36.3.el7.x86_64/include/linux/version.h

此时如果你的vmtools版本比较旧的话,还是会提示not a valid path。

这是因为3.x版本的内核version.h的路径变了,导致vmtools无法找到。

一路默认回车就好了,最后出现如下信息,说明安装成功,重启虚拟机。

Enjoy,
--the VMware team
Found VMware Tools CDROM mounted at /mnt/cdrom. Ejecting device /dev/sr0 ...
> umount /mnt/cdrom
> shutdown -r now