Search code examples
vagrantsynchronizationubuntu-14.04nfs

How to use nfs for vagrant sync specific folders?


  • HOST machine: OS X Mavericks
  • GUEST machine: Ubuntu 14.04
  • VM software: VirtualBox 4.3.14

Inside my Vagrantfile, I have the following and it is working fine:

  config.vm.synced_folder "~/Documents/WebApps", "/var/virtual/WebApps", id: "vagrant-root", 
    owner: "www-data",
    group: "www-data",
    mount_options: ["dmode=755,fmode=755"]

I read about NFS and how it improves performance.

Do I simply just add a type: nfs at the end to activate the use of nfs?


Solution

  • The following worked for me.

    The most important thing is NOT to have group, owner, and mount_options

      config.vm.synced_folder "~/Documents/WebApps", "/var/virtual/WebApps", id: "vagrant-root", 
        type: "nfs"
    

    When I attempted to use those attributes, I get failure warnings.

    This answer helped a tad.