Cannot mount vagrant synced folder with nfs

 ̄綄美尐妖づ 提交于 2019-12-21 07:56:58

问题


I managed to setting up my Symfony2 project inside a ubuntu vagrant box. But it takes around 20 seconds to load the website through it's webserver. After some research, i came up with using nfs for the sync folder. Here're my setting from Vagrantfile:

config.vm.network "private_network", ip: "192.168.56.101"
config.vm.synced_folder ".", "/vagrant", :nfs => true, :mount_options => ["dmode=777","fmode=777"]

After starting de vagrant box i get the following error

==> 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=777,fmode=777' 192.168.56.1:'/Users/marcschenk/Projects/teleboy.ch' /vagrant

Stdout from the command:

Stderr from the command:

stdin: is not a tty
mount.nfs: an incorrect mount option was specified

The VM seems to work, but the synced folder's obviously empty. What did i wrong?

My setup:

  • Vagrant 1.6.5 & Virtualbox 4.3.18
  • Host: OS X 10.10
  • Guest: Ubuntu 12.04

回答1:


Found the solution for the problem here https://github.com/mitchellh/vagrant/issues/2546

The correct syntax for vagrant version 1.3 to 1.6 is:

config.vm.synced_folder ".", "/vagrant", :nfs => { :mount_options => ["dmode=777","fmode=777"] }


来源:https://stackoverflow.com/questions/26700249/cannot-mount-vagrant-synced-folder-with-nfs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!