Vagrant, NFS, and synced file permissions

At work we rely on Vagrant to work on projects in an environment identical to our production server. We were using the vboxfs synced file implementation, but this is slow. I began experimenting with NFS synced files (available on macOS and Linux hosts), but I quickly realized synced files in the VM guest retained the same uid and gid as the they have on the host machine. This breaks permissions in the guest VM, especially when upload and cache directories live inside the NFS mounted directory. I didn’t want to return to the slowness of vboxfs. Fortunately, Adam Fairholm and I discovered the vagrant-bindfs plugin. This uses bindfs inside the VM guest to set custom uid and gid values on NFS synced files.

See the plugin at https://github.com/gael-ian/vagrant-bindfs.