Vagrant: Parent folders of synced_folder are owned by root

Created on 23 Sep 2013  路  5Comments  路  Source: hashicorp/vagrant

"The second parameter must be an absolute path of where to share the folder within the guest machine. This folder will be created (recursively, if it must) if it doesn't exist."

When I setup a synced folder like so:

linux.vm.synced_folder src_path, "/home/vagrant/go/src"

The src folder is owned by vagrant:vagrant but the go folder is owned by root:root. This prevents the pkg and bin folders from being created later.

mkdir /home/vagrant/go/pkg: permission denied

Adding owner: "vagrant", group: "vagrant" did not remedy the situation.

Vagrant 1.3.3, VirtualBox 4.2.18 r88780, OS X 10.8.5, precise64, inline shell provisioning

Most helpful comment

For the record: I also think that this is unexpected. I got bitten today, too.

All 5 comments

For now, my solution is to make the synced_folder directly in the $HOME folder. This is my complete (working) Vagrantfile: https://gist.github.com/nathany/6662802

This is working as intended. If you need to change the permissions, use an inline shell provisioner. The permissions you specify on shared folders will only apply to the deepest child. Otherwise, typical umask takes place.

Care to explain why or offer any advice? Thanks.

@nathany I ran into the same problem. My solution was to run chown -R vagrant:vagrant /home/vagrant/go with an inline script.

(I realize I'm replying to a comment almost a year old, but I too expected that setting the owner and group would also apply to the parent folders created)

For the record: I also think that this is unexpected. I got bitten today, too.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Cbeck527 picture Cbeck527  路  3Comments

StefanScherer picture StefanScherer  路  3Comments

rrzaripov picture rrzaripov  路  3Comments

lebogan picture lebogan  路  3Comments

DreadPirateShawn picture DreadPirateShawn  路  3Comments