Closed girtsf closed 2 years ago
I guess it depends on how you look at it. For a reverse mount you are sharing a folder from the guest back into the host. It seems odd to me to share a folder that doesn't yet exist (i.e. has no content) back to the host. Then again Vagrant boxes are typically ephemeral, so maybe you could make an argument for creating it if it doesn't exist. I don't know.
My use case: I check out git repos inside guest, and do builds from the guest. I want to make the files available for editing from the host. Doing it the other way makes the builds really slow, but slight latency when editing one file at a time doesn't really matter. My current workaround is to add disabled: true
, do the initial vagrant up
(which will create and checkout the git repos), then re-enable the synced folder. Alternatively, I could build my own box that has the shared folder already created, but that seems like an overkill.
I'll probably try to address this in the next release.
Thank you, appreciated!
Vagrant documentation (https://www.vagrantup.com/docs/synced-folders/basic_usage.html) says "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 does not exist." This to me implies that
sshfs
would take the same approach.I'm using
vagrant-sshfs
in reverse mode:config.vm.synced_folder "devel", "/home/vagrant/devel", type: "sshfs", reverse: true, create: true
When I do
vagrant up
, it blows up on the mount:Should
vagrant-sshfs
create directories in guest to match up with what built-in synced folders do?