黑猴子的家:宿主机 Window7 和 VMware 12 中 Centos 系统虚拟机文件夹共享

1、文件夹共享的前提

文件夹共享的前提是,必须在 Centos 系统上安装VMTools工具成功

Centos 6.8 安装VMTools工具
https://www.jianshu.com/p/7fef200113b2

Centos 7安装VMTools工具
https://www.jianshu.com/p/24f84c910690

2、文件夹共享操作

9193428-0a0902cbd9c90177.png

共享文件夹路径

[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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值