Discussion:
[vagrant-up] vmware_desktop: read-only synced_folers
a***@beacon.io
2018-08-20 04:34:19 UTC
Permalink
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?
--
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.
Miles Fidelman
2018-08-20 08:47:29 UTC
Permalink
Perhaps a stupid observation, but how can you sync a pair of folders
that are read only?
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:Executecapability: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:Startingprocess:["/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?
--
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
To view this discussion on the web visit
https://groups.google.com/d/msgid/vagrant-up/620c0013-9712-432b-a0d4-7e814bcdd438%40googlegroups.com
<https://groups.google.com/d/msgid/vagrant-up/620c0013-9712-432b-a0d4-7e814bcdd438%40googlegroups.com?utm_medium=email&utm_source=footer>.
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
--
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/cf889b5b-7342-d894-9735-618fcc579fce%40meetinghouse.net.
For more options, visit https://groups.google.com/d/optout.
a***@beacon.io
2018-08-20 15:11:10 UTC
Permalink
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.
Perhaps a stupid observation, but how can you sync a pair of folders that
are read only?
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 ...
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?
--
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
To view this discussion on the web visit
https://groups.google.com/d/msgid/vagrant-up/620c0013-9712-432b-a0d4-7e814bcdd438%40googlegroups.com
<https://groups.google.com/d/msgid/vagrant-up/620c0013-9712-432b-a0d4-7e814bcdd438%40googlegroups.com?utm_medium=email&utm_source=footer>
.
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
--
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/48163d21-dd37-4de3-99ad-b8c772f0b354%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Alvaro Miranda Aguilera
2018-09-03 12:58:24 UTC
Permalink
Seems a valid question.

Can you open a issue on github ?

Thanks
Alvaro
Post by a***@beacon.io
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 ...
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?
--
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
To view this discussion on the web visit
https://groups.google.com/d/msgid/vagrant-up/620c0013-9712-432b-a0d4-7e814bcdd438%40googlegroups.com
<https://groups.google.com/d/msgid/vagrant-up/620c0013-9712-432b-a0d4-7e814bcdd438%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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/CAHqq0ey%2Bo2zWnXfnHr1nORkMdOy_AKLFKX7782cG079u6kbq6g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Loading...