Ubuntu主机上的Vagrant nfs同步文件夹问题

Ubuntu主机上的Vagrant nfs同步文件夹问题,ubuntu,vagrant,virtualbox,nfs,vagrantfile,Ubuntu,Vagrant,Virtualbox,Nfs,Vagrantfile,我试图在启用nfs的Ubuntu主机上运行vagrant,但在我尝试运行vagrant时出错。以下是我的说明: 主机:Ubuntu 14.04 LTS 嘉宾:Ubuntu 14.04 LTS 虚拟盒版本:5.0.4 流浪版本:1.7.4 这是我的流浪汉档案: Vagrant.configure(2) do |config| config.vm.box = "ubuntu/trusty64" config.vm.hostname = "vagrant-play" config.vm

我试图在启用nfs的Ubuntu主机上运行vagrant,但在我尝试运行vagrant时出错。以下是我的说明:

  • 主机:Ubuntu 14.04 LTS
  • 嘉宾:Ubuntu 14.04 LTS
  • 虚拟盒版本:5.0.4
  • 流浪版本:1.7.4
这是我的流浪汉档案:

Vagrant.configure(2) do |config|
  config.vm.box = "ubuntu/trusty64"
  config.vm.hostname = "vagrant-play"
  config.vm.provider "virtualbox" do |v|
    v.name = "eng-soft-project"
    # max 75% CPU cap
    v.customize ["modifyvm", :id, "--cpuexecutioncap", "75"]
    # give vm max 3GB ram
    v.memory = 2048
  end

  config.vm.provision :shell, :privileged => false, :path => "vagrant-machine-setup.sh"
  config.vm.provision :shell, :privileged => false, :path => "vagrant-machine-run.sh",run: "always"

  forward_port = ->(guest, host = guest) do
      config.vm.network :forwarded_port,
        guest: guest,
        host: host, 
        auto_correct: true
  end

  forward_port[9000]           # activator run
  forward_port[8888]           # activator ui     
  forward_port[9999]           # unknow     

  config.vm.network :private_network, ip: "192.168.50.50"
  config.vm.synced_folder "source-code/", "/home/vagrant/source-code", type: "nfs", create: true, mount_options: ["dmode=755,fmode=755"]
  config.vm.synced_folder "teste/", "/home/vagrant/teste", type: "nfs", create: true, mount_options: ["dmode=755,fmode=755"]
end
这就是错误:

nfsd running
exportfs: <home-path>/project/teste does not support NFS export
exportfs: <home-path>/project/source-code does not support NFS export
==> 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 'dmode=755,fmode=755' 192.168.50.1:'<home-path>/project/source-code' /home/vagrant/source-code

Stdout from the command:



Stderr from the command:

stdin: is not a tty
mount.nfs: an incorrect mount option was specified
nfsd正在运行
exportfs:/project/teste不支持NFS导出
exportfs:/project/源代码不支持NFS导出
==>默认值:装载NFS共享文件夹。。。
以下SSH命令以非零退出状态响应。
Vagrant认为这意味着命令失败!
mount-o'dmode=755,fmode=755'192.168.50.1:'/project/source-code'/home/vagrant/source-code'
命令中的Stdout:
命令中的Stderr:
斯丁:这不是一个tty
mount.nfs:指定的装载选项不正确
我尝试了很多可能的解决方案,比如更新我的vbbox版本,安装vagrant vbguest插件,在guest内部的vboxguestaditions之间建立链接


所有这些都不能解决我的问题,如果有人知道解决方案,请告诉我。

安装
nfs内核服务器

sudo apt-get install nfs-kernel-server
然后做准备或流浪上路

您可以尝试添加插件
vagrant-nfs\u guest

vagrant plugin install  vagrant-nfs_guest
还要检查您系统的防火墙,它可能会阻止NFS和rpcbind端口的可能重复