10

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
Chris Snow
  • 23,813
  • 35
  • 144
  • 309
schaenk
  • 633
  • 1
  • 6
  • 17
  • 1
    Did you install the nfs server on your host? Is the nfs client installed on your guest? Can you execute the mount command given in the error message manually when ssh'd into the guest? – Sgoettschkes Nov 03 '14 at 07:12
  • Thanks for your answer. Everything was installed correctly, but i had a wrong syntax in Vagrant file. See my answer below. – schaenk Nov 03 '14 at 10:10

1 Answers1

22

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"] }
vguru054
  • 23
  • 6
schaenk
  • 633
  • 1
  • 6
  • 17
  • Awesome! This worked for me on Mac OS X as the host. Also `mount.nfs: Protocol not supported` was the error. – dewwwald May 11 '16 at 18:51