右键虚拟机设置,找到CD/DVD,选择使用ISO映像文件,在VMware安装目录下找到linux.iso。

|
1
|
> mount -t auto /dev/cdrom /mnt/cdrom |
如果/mnt下没有cdrom文件夹,则创建
|
1
2
|
> cd /mnt> mkdir cdrom |
|
1
2
|
> cd /mnt/cdrom> cp VMwareTools-10.0.10-4301679.tar.gz /data |
|
1
2
3
|
> tar -zxvf VMwareTools-10.0.10-4301679.tar.gz> cd vmware-tools-distrib> ./vmware-install.pl |
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
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
|
1
2
|
> 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?
则需要安装
|
1
|
> yum install kernel-devel |
然后在上面的步骤里输入内核头文件的目录
|
1
|
/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
|
1
2
|
> 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无法找到。
安装vmtools 时提示The path “” is not a valid path to the 3.10.0-229.el7.x86_64 kernel headers. Would you like to change it?[yes]
原因:没有找到kernel的头文件。
解决法案:/usr/src 目录下有要求的kernel源文件,没有的话使用命令 yum -y install kernel-devel
然后在Enter the path to the kernel header files for the 3.10.0-229.el7.x86_64 kernel?这一步输入内核头文件的目录,我的是/usr/src/kernels/3.10.0-229.el7.x86_64/include。
此时如果你的vmtools版本比较旧的话,还是会提示not a valid path。这是因为3.x版本的内核version.h的路径变了,导致vmtools无法找到。
用命令 sudo ln -s <内核头文件目录>/generated/uapi/linux/version.h <内核头文件目录>/include/linux/version.h
我的是 sudo ln -s /usr/src/kernels/3.10.0-229.el7.x86_64/include/generated/uapi/linux/version.h /usr/src/kernels/3.10.0-229.el7.x86_64/include/linux/version.h
然后再次运行vmtools安装程序此问题不在出现。
|
1
2
3
|
Enjoy,--the VMware teamFound VMware Tools CDROM mounted at /mnt/cdrom. Ejecting device /dev/sr0 ... |
|
1
2
|
> umount /mnt/cdrom> reboot |