Writing to Vagrant Synced Folders
Join the DZone community and get the full member experience.Join For Free
I had a problem writing to the cache directory in my vagrant project due to file permissions. Fortunately Jeremy Kendall has already solved this problem in his Vagrant Synced Folders Permissions article.
He presents two different solutions:
- Setting permissions via the Vagrantfile.
- Changing the web user in the VM to be the vagrant user.
I went with the first option and added this setting in my Vagrant file:
config.vm.synced_folder "./", "/vagrant", id: "vagrant-root", owner: "vagrant", group: "www-data", mount_options: ["dmode=775,fmode=664"]
Published at DZone with permission of Rob Allen, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.