How to change group id and mountpoint of vagrant default shared folder

1

When I use vagrant with default settings and default Vagrantfile it will mount the current host folder into:

/vagrant

in the guest box. Owner and group of the directory is vagrant.

How can I change the mount point and the group id of the default share? Maybe I'm blind but I didn't found anything about that in the documentation.

hek2mgl

Posted 2013-10-11T14:34:55.923

Reputation: 703

Answers

4

You need to override the default Vagrant configuration. This should work:

config.vm.synced_folder ".", "/mymountpoint", :group => "mygroup"

How to set a different owner/group for a synced folder is documented here. For the default configuration, you have instead to check the source code.

Emyl

Posted 2013-10-11T14:34:55.923

Reputation: 475

I'm using vagrant 1.0.1. (Should have mentioned this in the question) This version uses the shared_folder syntax in Vagrantfile. I tried to override the default share but it didn't work as expected. I figured out that this was because I didn't used the v-root id for the share. Now it's working using the following line: config.vm.share_folder "v-root", "/vagrant", ".", :group => "my-group". But however, thanks for your help! Overriding the share in Vagrantfile does the trick! – hek2mgl – 2013-10-18T13:49:22.057

2

This is what you need to change the mountpoint:

config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.synced_folder ".", "/newmountpoint", group: "newgroup"

For more details see the synced_folders section in the Vagrant docs.

Alex Dean

Posted 2013-10-11T14:34:55.923

Reputation: 121