2015-10-11 99 views
3

我試圖在啓用了nfs的Ubuntu主機上運行vagrant,但是當我嘗試運行vagrant時出現錯誤。這是我的規格:Vagrant nfs與Ubuntu主機同步文件夾問題

  • 主持人:Ubuntu的LTS 14.04
  • 遊客:Ubuntu的LTS 14.04
  • 虛框版本: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 

我嘗試了很多可能的解決方案,如更新我的VB盒版,安裝無業遊民,vbguest插件,使得內部客人VBoxGuestAdditions之間的聯繫。

這對我的問題沒有效果,如果有人知道解決方案,請讓我知道。

+0

的可能的複製[流浪的錯誤:無法安裝在Linux客戶機的文件夾(http://stackoverflow.com/questions/22717428/vagrant-error-failed-to-mount-folders-in-linux -客人) – Maks3w

回答

1

安裝nfs-kernel-server

sudo apt-get install nfs-kernel-server 

然後執行規定或vagrant up

您可以通過添加插件vagrant-nfs_guest

vagrant plugin install vagrant-nfs_guest 

也檢查你的系統的防火牆,可以阻止嘗試NFSrpcbind港口

相關問題