Skip to content

Instantly share code, notes, and snippets.

@mgtitimoli
Last active June 17, 2016 03:24
Show Gist options
  • Save mgtitimoli/bbd7656a1a0bcd18534e2878dc6ab562 to your computer and use it in GitHub Desktop.
Save mgtitimoli/bbd7656a1a0bcd18534e2878dc6ab562 to your computer and use it in GitHub Desktop.
Vagrant NFS Debian
  • Run the following commands
$ sudo apt-get install nfs-kernel-server
$ modprobe nfs; modprobe nfsd
  • Make sure that /etc/sudoers is reading configuration files located in /etc/sudoers.d
#includedir /etc/sudoers.d
  • Add a file vagrant within /etc/sudoers.d with the following
Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/tee -a /etc/exports
Cmnd_Alias VAGRANT_EXPORTS_COPY = /bin/cp /tmp/exports /etc/exports
Cmnd_Alias VAGRANT_NFSD_CHECK = /etc/init.d/nfs-kernel-server status
Cmnd_Alias VAGRANT_NFSD_START = /etc/init.d/nfs-kernel-server start
Cmnd_Alias VAGRANT_NFSD_APPLY = /usr/sbin/exportfs -ar
Cmnd_Alias VAGRANT_EXPORTS_REMOVE = /bin/sed -r -e * d -ibak /tmp/exports
%sudo ALL=(root) NOPASSWD: VAGRANT_EXPORTS_ADD, VAGRANT_NFSD_CHECK, VAGRANT_NFSD_START, VAGRANT_NFSD_APPLY, VAGRANT_EXPORTS_REMOVE, VAGRANT_EXPORTS_COPY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment