原因:vmware tools没有完整安装!
在centos7安装vmware tools过程中可能会报出异常,提示gcc和kernel找不到有效的路径valid path,可能是新的linux系统没有安装gcc和kernel,或者版本不匹配!
解决办法:
1.重新安装缺失的组件
yum install gcc
yum install kernel-devel
2.更新刚安装的组件:
yum update gcc -y
yum update kernel -y
3.重启:
init 6 或reboot
4.重新安装VMware Tools
首先自然是打开你需要安装vmware tools(以下简称VMtools)的虚拟机,在虚拟机没有打开的时候会报错,
再说虚拟机都没开你往哪安是不。打开之后我们点击虚拟机选项,找到安装VMtools(如下图所示),
如果你已经安装过了,提示会不同,那时候就会提示让你重新安装VMtools。点击安装即可。
新建cdrom挂载目录
mkdir /mnt/cdrom
挂载光驱
mount -t auto /dev/cdrom /mnt/cdrom这命令就是把CentOS CDROM挂载在/mnt/cdrom目录中,就可以访问里面的内容了;
使用光驱中的文件,进行安装
[root@CentOS6 /]# cd /mnt/cdrom
[root@CentOS6 /]# ls -a
[root@CentOS6 /]# cp VMwareTools-8.6.1-19175.tar.gz /tmp
[root@CentOS6 /]# cd /tmp
[root@CentOS6 /]# tar zxpf VMwareTools-8.6.1-19175.tar.gz
[root@CentOS6 /]# cd vmware-tools-distrib
[root@CentOS6 vmware-tools-distrib]# ./vmware-install.pl
Creating a new installer database using the tar3 format.
Installing the content of the package.
# 安装过程的画面,全部使用默认值,一直按 Enter 就对了
一直到出现:
To use the vmxnet driver, restart networking using the following commands:
/etc/init.d/network stop
rmmod pcnet32
rmmod vmxnet
depmod -a
modprobe vmxnet
/etc/init.d/network start
Enjoy,
--the VMware team
出现以上,则基本安装完!
5 shutdown -r now 重启
6 重新启动计算机再次登入之后,我们就会发觉到,当我们要离开 Guest OS 的时候,不再需要按「Ctrl + Alt」了,
现在我们来分享 Host OS 的数据夹给 Guest OS 使用,〔VM〕→〔Settings〕
注:左下角原本都会显示「You do not have VMware Tools installed」,现在我们装了 VMware Tools,就不再显示;
安装VMWare tools,以及解决安装后/mnt中有hgfs但没共享文件的方法
一、首先是安装VMWare tools
安装过程可参考:http://www.cnblogs.com/jiu0821/p/7559949.html
二、解决安装VMWare tools后/mnt中有hgfs但没共享文件
前提:在虚拟机软件中设置了共享目录
此时在linux中进入 /mnt/hgfs 文件夹,但发现共享的文件没有显示
使用以下办法解决(root权限):
1. vmware-hgfsclient 命令查看当前有哪些共享的目录,这里我只使用了shared文件夹
2. 使用 mount -t vmhgfs .host:/shared /mnt/hgfs 命令挂载该共享文件夹(注意:带.号的哦),其中.host:/Documents是共享名,只需把Documents换成
使用vmware-hgfsclient 命令得到的目录,/mnt/hgfs是挂载点
3. 到此为止是可以使用该共享文件夹了,但每次都得重复mount一次,所以需要设置为随机启动后自动挂载
编辑 /etc/fstab,添加下面一行
.host:/shared /mnt/hgfs vmhgfs defaults 0 0 (按需写)
补充:
如果显示
Error: cannot mount filesystem: No such device
ubuntu则先执行 sudo apt-get install open-vm-dkms
然后再执行3
centos7则先执行 yum install open-vm-tools
然后再执行vmhgfs-fuse .host:/ /mnt/hgfs,不过我还是做不到让它启动后自动挂载,每次启动需要重新执行这个命令
挂载Windows主机的共享文件夹
https://blog.csdn.net/miaodichiyou/article/details/75082425