Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Writing to Vagrant Synced Folders

DZone's Guide to

Writing to Vagrant Synced Folders

· DevOps Zone
Free Resource

Download the blueprint that can take a company of any maturity level all the way up to enterprise-scale continuous delivery using a combination of Automic Release Automation, Automic’s 20+ years of business automation experience, and the proven tools and practices the company is already leveraging.

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:

  1. Setting permissions via the Vagrantfile.
  2. 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"]

Download the ‘Practical Blueprint to Continuous Delivery’ to learn how Automic Release Automation can help you begin or continue your company’s digital transformation.

Topics:

Published at DZone with permission of Rob Allen, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}