![如何阻止 VMware/Vagrant 嘗試建立 NFS 共用?](https://rvso.com/image/1615520/%E5%A6%82%E4%BD%95%E9%98%BB%E6%AD%A2%20VMware%2FVagrant%20%E5%98%97%E8%A9%A6%E5%BB%BA%E7%AB%8B%20NFS%20%E5%85%B1%E7%94%A8%EF%BC%9F.png)
我正在嘗試使用 VMware 而不是 VirtualBox 來運行我的虛擬機器。主機:Windows10,訪客:CentOS7。我正在使用 PuPHPet 建立所需的 vagrant 文件,但無論我選擇預設、NFS、SMB 或 RSync 哪個文件系統,vagrant up 總是嘗試掛載 NFS 共用資料夾並失敗。我相信 Windows 不支援 NFS,所以它失敗並不讓我感到驚訝,但我找不到停用它的方法。在我的 Vagrant 文件中我加入了:
Vagrant.configure('2') do |config|
eval File.read("#{dir}/puphpet/vagrant/Vagrantfile-#{data['target']}")
config.vm.synced_folder ".", "/vagrant"
config.vm.synced_folder "B:\\Web\\www.example.com\\public_html", "/home/example/public_html", type: "rsync"
end
這會掛載並同步資料夾,我認為這將不需要掛載 NFS 共享,但之後我仍然得到:
==> example: Rsyncing folder: /cygdrive/b/Web/www.example.com/public_html/ => /home/example/public_html
==> example: Exporting NFS shared folders...
==> example: Preparing to edit nfs mounting file.
==> example: Mounting NFS shared folders...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
mount -o vers=3,udp,vers=3,udp,nolock 192.168.246.1:/B/Web/www.example.com /vagrant
Stdout from the command:
Stderr from the command:
mount.nfs: Connection refused
我不確定為什麼 IP 192.168.246.1 被引用,因為它不在我搜尋過的任何設定檔中。