2014-11-02 56 views
10

我设法设置我的Symfony2项目在一个Ubuntu的流浪汉框。但通过它的网络服务器加载网站需要大约20秒的时间。经过一番研究,我想出了使用nfs作为sync文件夹。从Vagrantfile我这里还有我的设置:无法安装流浪汉同步文件夹与nfs

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

开始去流浪的框后,我收到以下错误

==> 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 

的VM似乎工作,但同步文件夹显然空。我错了什么?

我的设置:

  • 流浪1.6.5 & VirtualBox的4.3.18
  • 主持人:OS X 10.10
  • 游客:Ubuntu的12.04
+1

您是否在主机上安装了nfs服务器? nfs客户端上是否安装了nfs客户端?当ssh进入guest虚拟机时,能否手动执行错误消息中给出的mount命令? – Sgoettschkes 2014-11-03 07:12:16

+0

感谢您的回答。一切安装正确,但我在Vagrant文​​件中有错误的语法。请参阅下面的答案。 – schaenk 2014-11-03 10:10:00

回答

19

找到该问题的解决方案在这里https://github.com/mitchellh/vagrant/issues/2546

vagrant 1.3版到1.6版的正确语法是:

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

太棒了!作为主机,这在Mac OS X上适用于我。另外'mount.nfs:Protocol not supported'是错误。 – dewwwald 2016-05-11 18:51:10