Nfs – Vagrant synced_folder syntax for nfs options (trying to disable nfs_export)

nfsvagrant

I'm trying to disable the nfs_export option in my Vagrantfile, so that Vagrant will not touch my /etc/exports.

The Vagrant documentation says:

NFS synced folders have a set of options that can be specified that are unique to NFS. These are listed below. These options can be specified in the final part of the config.vm.synced_folder definition, along with the type option.

nfs_export (boolean) – If this is false, then Vagrant won't modify your /etc/exports automatically and assumes you've done so already.

https://docs.vagrantup.com/v2/synced-folders/nfs.html

I have no experience with Ruby syntax, but I guessed the following would achieve what I want:

 config.vm.synced_folder "/data", "/vagrant", type: "nfs", nfs_export: false

This does not work, however. Vagrant still keeps editing my exports file. What is the correct syntax?

I'm running the latest Vagrant 1.6.3 on OSX.

(The main reason I want to disable it, is that for some reason nfsd on my OSX machine does not come up again reliably after a sudo nsfd restart, which is run by Vagrant after updating the exports file)

Best Answer

It only seems to edit the file to insert placemarkers. I'd submit a ticket on Github and say that you'd like the behaviour changed, see what response you get.

EDIT: Was feeling generous - https://github.com/mitchellh/vagrant/issues/4148 :)