vmware_desktop: read-only synced_folers

73 views
Skip to first unread message

alex....@beacon.io

unread,
Aug 20, 2018, 12:34:19 AM8/20/18
to Vagrant
Hi, 

I'm trying to setup a read-only shared folder using vagrant(2.12)  vmware_desktop (1.0.4) on MacOS (10.13.6) with Vmware Fusion (10.0.1.3).  The base box I'm using is bento/ubuntu16.04


Dcos and examples led me to believe that the following would do the trick 

  config.vm.synced_folder "../../stuff", "/vagrant_stuff", :mount_options => ["ro"]

This reuslted in the mount remaining RW.

Looking at the debug logs, the option is passeded in correctly, the vmrun command is issued to setup the mount ...

 INFO guest: Execute capability: mount_vmware_shared_folder [#<Vagrant::Machine: default (HashiCorp::VagrantVMwareDesktop::Provider)>, "-stuff", "/vargrant_stuff", {:mount_options=>["ro"], :guestpath=>"/vargrant_stuff", :hostpath=>"/path_to_stuff/stuff", :disabled=>false, :__vagrantfile=>true, :owner=>"vagrant", :group=>"vagrant"}] (ubuntu)


 INFO subprocess: Starting process: ["/Applications/VMware Fusion.app/Contents/Library/vmrun", "setSharedFolderState", "/path_to_vagrantfile/.vagrant/machines/default/vmware_desktop/aaeb092d-dba2-4adf-b67f-2d314f42421d/default.vmx", "-vagrant_stuff", "/path_to_stuff/stuff/", "writable"]

but the bind mount command is not getting the RO option. 

 INFO ssh: Execute: mount --bind '/mnt/vagrant-mounts/1000-1000/-stuff' '/vagrant_stuff' (sudo=true)

Is there a way to either pass in the readonly-ness into the syned_folder subsystem or to pass in flags into the bind mount?  

Miles Fidelman

unread,
Aug 20, 2018, 4:47:37 AM8/20/18
to vagra...@googlegroups.com

Perhaps a stupid observation, but how can you sync a pair of folders that are read only?

--
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/620c0013-9712-432b-a0d4-7e814bcdd438%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
In theory, there is no difference between theory and practice.
In practice, there is.  .... Yogi Berra

alex....@beacon.io

unread,
Aug 20, 2018, 11:11:10 AM8/20/18
to Vagrant

Well..  "synced" is poor choice of wording on Hashicorp's side, not mine :-)

I want to expose part of my host's namespace into my VM and I don't wish for my vm to modify it under any circumstance.
There's plenty of reason why one might want to do this ... plus the tooling under the hood is capable of it as well. 

Alvaro Miranda Aguilera

unread,
Sep 3, 2018, 8:58:40 AM9/3/18
to vagra...@googlegroups.com
Seems a valid question.

Can you open a issue on github ?

Thanks
Alvaro

--
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/620c0013-9712-432b-a0d4-7e814bcdd438%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Alvaro

Reply all
Reply to author
Forward
0 new messages