Centos7-Mini安装 VM Tools
1、安装依赖组件
$ yum -y install gcc gcc-c++ make
$ yum -y install kernel-devel
2、更新系统内核
$ yum update kernel -y
# 重启虚拟机更新内核
$ init 6
3、安装VMTools
# 创建挂载目录
$ mkdir /mnt/cdrom
# 挂载目录(必须在root用户下才能执行成功)
$ mount /dev/cdrom /mnt/cdrom
# 将VMTools拷贝到家目录
$ cp /mnt/cdrom/VMwareTools-10.3.23-16594550.tar.gz ~
# 切换到家目录
$ cd ~
# 解压VMTools
$ tar -zxvf VMwareTools-10.3.23-16594550.tar.gz
# 切换到解压后的vm-tools目录
$ cd vmware-tools-distrib
# 安装
# 安装过程中,回车使用默认值
$ ./vmware-install.pl
# 安装结束重启虚拟机
$ reboot
4、VMware配置共享文件夹
# VMware菜单栏:虚拟机 --> 设置 --> 选项 --> 共享文件夹
VM --> setting --> options --> Shared Folders
1.设置为 Always enabled
2.添加共享文件夹
# vmware-hgfsclient --help
# hgfsclient: lists any shared folders
# Linux查看共享文件夹
$ vmware-hgfsclient
5、安装过程问题处理(仅记录安装过程中遇到的问题)
open-vm-tools are available from the OS vendor and VMware recommends using
open-vm-tools. See http://kb.vmware.com/kb/2073803 for more information.
Do you still want to proceed with this legacy installer? [no]
# 缺少 open-vm-tools
$ yum update -y
$ yum install -y open-vm-tools
Searching for a valid kernel header path…
The path “” is not a valid path to the 3.10.0-1160.66.1.el7.x86_64 kernel
headers.
Would you like to change it? [yes]
# 更新内核
$ yum update kernel -y
$ init 6
Searching for GCC…
The path “” is not valid path to the gcc binary.
Would you like to change it? [yes]
# 缺少gcc编译器
$ yum -y install gcc gcc-c++ make
关于虚拟机内共享文件夹不显示问题
# 临时显示配置
$ sudo vmhgfs-fuse .host:/ /mnt/hgfs -o nonempty -o allow_other
# 永久显示配置
$ chmod +x /etc/rc.local
$ vi /etc/rc.local
$ cat << EOF >> /etc/rc.local
sudo vmhgfs-fuse .host:/ /mnt/hgfs -o nonempty -o allow_other
EOF