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

Learn more about how CareerBuilder was able to resolve customer issues 5x faster by using Scalyr, the fastest log management tool on the market. 

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"]

Find out more about how Scalyr built a proprietary database that does not use text indexing for their log management tool.

Topics:

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

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}