Permission question ( different permissions for sub folder of shared folder )

53 views
Skip to first unread message

Nathan Crews

unread,
Apr 29, 2016, 5:37:52 PM4/29/16
to Vagrant
I've been using Vagrant for a while but just now found the Mailing list!  so I thought i'd ask a permissions question that has been eating at me ( scanned the list but didn't see this, but apologies if i missed it )

I'm running Vagrant on Windows 10 and Virtualbox to launch a ubuntu VM for development.

I have a folder structure like this 

- Dev/
---- /public/
---- /ops/
---- Vagrantfile

Where "public" is set as the doc root of apache, and "ops" has some shell scripts i use.

I need the file permissions of public to be  755/644 directories/files and the shell scripts need to be executable.  

I'm currently sidesteping this by setting all the files to 744
config.vm.synced_folder ".", "/vagrant", :mount_options => [ "dmode=755","fmode=744" ]

But if possible i'd like to have /vagrant/public ( could be everything in /vagrant except /ops ) to 755/644
and still let all the files in /vagrant/ops be set to executable.


Does anyone have a solution to this or better plan to include executable scripts into their dev environments?

Thanks
Nathan

Alvaro Miranda Aguilera

unread,
Apr 29, 2016, 11:38:59 PM4/29/16
to vagra...@googlegroups.com
Hello,
What happen if you add just more lines?

config.vm.synced_folder ".", "/vagrant", :mount_options => [ "dmode=755","fmode=744" ]
config.vm.synced_folder "public", "/vagrant/public", :mount_options => [ "dmode=755","fmode=644" ]

?

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/0cca29f5-9f2b-46bf-a5c9-754ce3eed029%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nathan Crews

unread,
May 2, 2016, 10:02:47 AM5/2/16
to Vagrant
Ha, beautiful!

That appears to be working perfectly.  I didn't realize you could use synced_folder on a sub-folders of an already synced folder, and it never crossed my mind to try it.

...always the simple things /facepalm.

Thanks
-Nathan

Alvaro Miranda Aguilera

unread,
May 2, 2016, 5:28:41 PM5/2/16
to vagra...@googlegroups.com
Hello,

The shared folder is a mountpoint, that use an special filesystem.

so permissions and ownership will be set from there and inside recurrently.

if you check the output of

df -Ph
mount

you will the that linux is just a nested mount point already

/
/ -> /boot

/
/ -> /vagrant

so, nothing stop you just add more as needed.

:)

Have fun.
Alvaro.

Reply all
Reply to author
Forward
0 new messages