我有一个由公司其他人创建的 vagrant 设置。其他同事说它在他们(类似配置的)苹果笔记本电脑上工作正常。当我运行 vagrant up 时,我得到了以下信息:
=> default: Configuring and enabling network interfaces...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
==> default: Exporting NFS shared folders...
==> default: Preparing to edit /etc/exports. Administrator privileges
will be required...
==> default: 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 10.10.10.1:/Users/fe4c/aislegacy /vagrant
Stdout from the command:
Stderr from the command:
mount.nfs: requested NFS version or transport protocol is not supported
以下是我认为的来自我的 VagrantFile 的相关片段:
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
settings = YAML::load(File.read(configFile))
config.ssh.forward_agent = true
VagrantHelper.setBox(settings['provider'], config)
config.vm.hostname = settings["hostname"]
config.hostsupdater.aliases = settings["hostname-aliases"]
config.vm.network :private_network, ip: settings["ip"]
config.vm.network "forwarded_port", guest: 80, host: 8086
config.vm.network "forwarded_port", guest: 443, host: 8443
config.vm.synced_folder ".", "/vagrant", :type => "nfs", :nfs_udp => false,
:nfs => { :mount_options => ["dmode=777","fmode=777"], :nfs_version => "3" }, id: settings["mount-name"]
我尝试过更改 nfs_version(尝试过版本 1-6),但没能解决问题。如果是 NFS 版本的问题,我该如何确定要使用哪个版本?如果是传输协议的问题,我该如何确定要使用哪个值。