win10 虛擬機VMware 14中CentOS7文件共享

一,環境

主機:win10 家庭版linux

軟件:VMware 14vim

系統:CentOS 7工具

 二,設置共享文件

右鍵虛擬機->選擇設置url

 如圖:建立共享文件spa

三,安裝VMware Tools

而後進入centOS系統.net

新建一個目錄 /mnt/cdrom, 用於掛載虛擬光驅3d

mkdir /mnt/cdrom

將虛擬光驅設備 /dev/cdrom掛載到目錄 /mnt/cdromcode

mount /dev/cdrom /mnt/cdrom

進入到/tmp目錄下將掛載在虛擬光驅中的目錄的 /mnt/cdrom 中的 VMwareTools-10.2.5-8068393.tar.gz  把文件解壓到/tmphtm

#解壓文件 tar zxpf /mnt/cdrom/VMwareTools-10.2.5-8068393.tar.gz #進入vmware-tools-distrib 目錄下 cd /cdrom/vmware-tools-distrib #運行vmware-install.pl文件 ./vmware-install.pl

注意:blog

  The path "" is not valid path to the gcc binary.
  Would you like to change it? [yes] no
  輸入 no

安裝後/mnt中有hgfs但沒共享文件的方法

cd /mnt/hgfs/

vmware-hgfsclient 命令查看當前共享的目錄(注意share該目錄你們可能不同,後面的命令中屢次用到

[root@localhost hgfs]# vmware-hgfsclient share

使用 mount  -t vmhgfs .host:/share /mnt/hgfs  命令掛載該共享文件夾(注意:帶.號的哦),其中.host:/Documents是共享名,只需把Documents換成
使用vmware-hgfsclient 命令獲得的目錄,/mnt/hgfs是掛載點

mount  -t vmhgfs .host:/share /mnt/hgfs

沒報錯則成功,若是報錯如:

[root@localhost hgfs]# mount -t vmhgfs .host:/share /mnt/hgfs Error: cannot mount filesystem: No such device

vmhgfs-fuse,須要安裝工具包

[root@localhost hgfs]# yum install open-vm-tools-devel -y [root@localhost hgfs]# vmhgfs-fuse .host:/share /mnt/hgfs

設置自動掛載

每次進入系統都得mount若是你以爲麻煩的話,你就vim /etc/fstab,而後再最後添加 

.host:/share    /mnt/hgfs       vmhgfs     defaults  0  0

筆者虛機重啓以後(welcome to emergency mode!)就不行了最後修改成

參考:https://www.linuxidc.com/Linux/2017-08/146347.htm

.host:/share     /mnt/hgfs       fuse.vmhgfs-fuse allow_other,defaults   0  0

到此成功截圖爲證

相關文章
相關標籤/搜索