Linux系統安裝VMware Tools和同W7共享檔案遇到的問題
我用的系統為CentOS6.5 minimal版本
minimal版本預設不啟動網路,所以要自己配置。
vi /etc/sysconfig/network-script/ifcfg-eth0
1 NM_CONTROLLED="no" #修改為no不依賴VMware NetworkManager控制
2 ONBOOT="yes" #修改為yes設定開機啟動
NetworkManager是完全版本預設提供的網路管理工具, 因為minimal的情況下並沒有安裝,所以設定為no 設定完成!
vmware-tools的安裝指令碼要用perl,但CentOS6自身不帶perl,所以要自己安裝perl
安裝perl命令
[root@localhost ~]# yum install perl
不安裝會出現
bash:./vmware-install.pl :/usr/bin/perl:bad interpreter:No such file or directory
一路回車 yes
中間有報錯的話百度說要安裝 gcc
執行 apt-get install gcc
總是報
bash: apt-get: command not found
最後發現 CentOS的軟體安裝工具不是apt-get 是yum
裝上gcc
# yum -y install gcc
不過還是順便把gcc++都裝上吧 .
# yum -y install gcc gcc-c++ libstdc++-devel
好了接著獲取vmware-tools包
點選vmware介面載入vmware-tools映象
[root@localhost ~]# cd /
[root@localhost ~]# mkdir /media/mnt //新建目錄
[root@localhost ~]# mount /dev/cdrom /media/mnt/ //掛載目錄
mount: block device /dev/sr0 is write-protected, mounting read-only
[root@localhost ~]# cd media/mnt/ //進入掛在目錄
[root@localhost mnt]# ls
manifest.txt VMwareTools-10.0.0-2977863.tar.gz vmware-tools-upgrader-64
run_upgrader.sh vmware-tools-upgrader-32
[root@localhost mnt]# cp VMwareTools-10.0.0-2977863.tar.gz /root
[root@localhost mnt]#umount /dev/cdrom //關閉裝置
[root@localhost mnt]#cd /root
[root@localhost mnt]#tar zxvf VMwareTools-10.0.0-2977863.tar.gz #解壓檔案
安裝vmware-tools
[root@localhost mnt]#cd vmware-tools-distrib #進入檔案目錄
[root@localhost mnt]#./vmware-install.pl #安裝
在虛擬機器軟體中設定共享目錄
linux中進入 /mnt/hgfs 資料夾,但發現共享的檔案沒有顯示
解決安裝VMWare tools後/mnt中有hgfs但沒共享檔案
vmware-hgfsclient
vmware-hgfsclient 命令檢視當前有哪些共享的目錄,這裡我只使用了shared資料夾
mount -t vmhgfs .host:/shared /mnt/hgfs
使用 mount -t vmhgfs .host:/shared /mnt/hgfs 命令掛載該共享資料夾(注意:帶.號的哦),其中.host:/Documents是共享名,只需把Documents換成
使用vmware-hgfsclient 命令得到的目錄,/mnt/hgfs是掛載點
到此為止是可以使用該共享檔案夾了,但每次都得重複mount一次,所以需要設定為隨機啟動後自動掛載
編輯 /etc/fstab,新增下面一行
.host:/shared /mnt/hgfs vmhgfs defaults 0 0 (按需寫)