1、文件夹共享的前提
文件夹共享的前提是,必须在 Centos 系统上安装VMTools工具成功
Centos 6.8 安装VMTools工具
https://www.jianshu.com/p/7fef200113b2
Centos 7安装VMTools工具
https://www.jianshu.com/p/24f84c910690
2、文件夹共享操作
共享文件夹路径
[root@hadoop100 ~]# cd /mnt/hgfs
3、文件夹默认路径的由来
VMware默认的共享路径是在/mnt/hgfs,这是写死在VMware Tools的脚本里的,我们可以从/etc/init.d/vmware-tools查到
vmhgfs_mnt="/mnt/hgfs"
#Mount all hgfs filesystems"
vmware_mount_vmhgfs() {
if [ "`is_vmhgfs_mounted`" = "no" ]; then
if [ "`vmware_vmhgfs_use_fuse`" = "yes" ]; then
mkdir -p $vmhgfs_mnt
vmware_exec_selinux "$vmdb_answer_BINDIR/vmhgfs-fuse \
-o subtype=vmhgfs-fuse,allow_other $vmhgfs_mnt"
else
vmware_exec_selinux "mount -t vmhgfs .host:/ $vmhgfs_mnt"
fi
fi
}
4、打完收工
此时在CentOS 7中就能看到物理机上面共享的文件夹了
[root@hadoop121 ~]# cd /mnt/hgfs/
[root@hadoop121 hgfs]# ll
total 4
drwxrwxrwx. 1 root root 4096 Apr 15 10:10 Window-Centos-Shared
[root@hadoop121 hgfs]# cd Window-Centos-Shared/
[root@hadoop121 Window-Centos-Shared]# ll
total 4
-rwxrwxrwx. 1 root root 3005 Nov 27 14:23 website.log