
我使用 vmware fusion 將 ubuntu 11 伺服器安裝為虛擬機器。我的某些檔案位於已安裝的磁碟機 /mnt/hgfs 上,以便與我的 Mac 共用。
一切正常,直到我更改已安裝磁碟機上的任何檔案。例如,當重新啟動時,然後:
$ ll /mnt/hgfs/public/index.php
它返回:
-rw-r--r-- 1 501 dialout 251 2011-08-01 01:59 /mnt/hgfs/public/index.php
但是當我更改已安裝磁碟機上的檔案然後再次更改時
$ ll /mnt/hgfs/public/index.php
輸出是:
ls: cannot access /mnt/hgfs/public/index.php: Invalid argument
這裡出了什麼問題?
我安裝了驅動器
$ sudo mount -t vmhgfs -v -o ro .host:/my-app /mnt/hgfs
答案1
這就是我修復它的方法: http://viraj-workstuff.blogspot.com/2013/07/vmware-fusion-permissions-on-shared.html
VMWare 應該能夠使用此修復程序一次解決此問題。
- sudo vim /etc/vmware-tools/services.sh
- 搜尋“vmhgfs_mnt=”/mnt/hgfs“”。在此行後面新增:'vmuser=${VMWARE_MNT_USER:-root}'
- 然後搜尋 'vmware_exec_selinux "mount -t vmhgfs .host:/ $vmhgfs_mnt"' 並將其替換為以下部分: uid=
id --user $vmuser
gid=id --group $vmuser
vmware_exec_selinux "mount -t vmhgfs .host:/ $vmhgfs_mnt -o uid=$u, $gid" - sudo vim /etc/init/vmware-tools.conf 在「預先啟動」和「後停止」行之前新增: env VMWARE_MNT_USER=[您想要的來賓使用者]
- 須藤重新啟動