在安装之前先说一个很神奇的事,我用root登录进去安装VMware tools发现不能显示VMware tools镜像,然后用普通用户登录进去安装发现出现了VMware tools镜像,但是安装过程中,命令基本都要加sudo,使用管理员权限。
安装步骤:
〇、通过普通用户登录进centos7
一、安装依赖包:
[xulei@localhost ~]$ yum -y install perl gcc gcc-c++ make cmake kernel kernel-headers kernel-devel net-tools
二、在VMware中点击虚拟机,选择安装VMware tools安装(因为已经安装好了,所以显示重新安装)
三、将CD-ROM挂载到指定目录
查看是否存在cdrom文件夹。如果没有就创建一个
[xulei@localhost ~]$ cd /mnt
[xulei@localhost mnt]$ ls
cdrom
挂载目录:
[xulei@localhost ~]$ sudo mount -t auto /dev/cdrom /mnt/cdrom
[sudo] xulei 的密码:
mount: /dev/sr0 写保护,将以只读方式挂载
四、拷贝安装包
首先查看一下自己的VMware tools的名字:
[xulei@localhost cdrom]$ ls
[xulei@localhost cdrom]$ sudo ls /mnt/cdrom
manifest.txt vmware-tools-upgrader-32
run_upgrader.sh vmware-tools-upgrader-64
VMwareTools-10.2.5-8068393.tar.gz
后面解压的时候需要用到上述的VMware tools版本号
拷贝:
[xulei@localhost cdrom]$ cd
[xulei@localhost ~]$ sudo cp /mnt/cdrom/VMwareTools-10.2.5-8068393.tar.gz ~
五、解除挂载
[xulei@localhost ~]$ umount /dev/cdrom
umount: /mnt/cdrom:umount 失败: 不允许的操作
[xulei@localhost ~]$ sudo umount /dev/cdrom
六、解压安装包
[xulei@localhost ~]$ sudo tar -zxvf VMwareTools-10.2.5-8068393.tar.gz ~
七、进入解压后的源码目录
[xulei@localhost ~]$ cd vmware-tools-distrib/
八、运行 `vmware-install.pl` 文件
[xulei@localhost vmware-tools-distrib]$ ./vmware-install.pl
后面就是一直回车就可以了
Please re-run this program as the super user.
Execution aborted.
Found VMware Tools CDROM mounted at /run/media/xulei/VMware Tools. Ejecting
device /dev/sr0 ...
[xulei@localhost vmware-tools-distrib]$ sudo ./vmware-install.pl
The installer has detected an existing installation of open-vm-tools packages
on this system and will not attempt to remove and replace these user-space
applications. It is recommended to use the open-vm-tools packages provided by
the operating system. If you do not want to use the existing installation of
open-vm-tools packages and use VMware Tools, you must uninstall the
open-vm-tools packages and re-run this installer.
The packages that need to be removed are:
open-vm-tools
The installer will next check if there are any missing kernel drivers. Type yes
if you want to do this, otherwise type no [yes] y
INPUT: [y]
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 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.2.5 build-8068393 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
You have chosen to install VMware Tools on top of an open-vm-tools package.
You will now be given the option to replace some commands provided by
open-vm-tools. Please note that if you replace any commands at this time and
later remove VMware Tools, it may be necessary to re-install the open-vm-tools.
The file /usr/bin/vmware-hgfsclient that this program was about to install
already exists. Overwrite? [no]
INPUT: [no] default
The file /usr/bin/vmhgfs-fuse that this program was about to install already
exists. Overwrite? [no]
INPUT: [no] default
Initializing...
Making sure services for VMware Tools are stopped.
Stopping Thinprint services in the virtual machine:
Stopping Virtual Printing daemon: done
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? [yes]
INPUT: [yes] 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)
VMware automatic kernel modules enables automatic building and installation of
VMware kernel modules at boot that are not already present. This feature can
be enabled/disabled by re-running vmware-config-tools.pl.
Would you like to enable VMware automatic kernel modules?
[yes]
INPUT: [yes] default
Thinprint provides driver-free printing. Do you wish to enable this feature?
[yes]
INPUT: [yes] default
Creating a new initrd boot image for the kernel.
The configuration of VMware Tools 10.2.5 build-8068393 for Linux for this
running kernel completed successfully.
Enjoy,
--the VMware team
[xulei@localhost vmware-tools-distrib]$