Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFE] Evaluate use case of mounting folder from guest to the host #7

Closed
dustymabe opened this issue Mar 15, 2016 · 13 comments
Closed

Comments

@dustymabe
Copy link
Owner

In the previous version of vagrant-sshfs a user could mount a folder from the guest into the host. Let's evaluate the use cases for this to determine if there are valid alternatives or if it is necessary to add the "mount guest folder onto host" functionality again.

Traditionally vagrant has been a throw away environment so mounting files from the guest into the host doesn't seem to be valuable because the files will be destroyed when the box is destroyed.

One such benefit of the "mount guest folder onto host" is that the files actually live inside the guest and thus accessing the files are "local accesses" within the guest, which means performance could be better if disk intensive activities are occurring inside the guest.

Let's discuss this and evaluate alternatives before we decide to, or not too, include support for this.

@tisba
Copy link

tisba commented Mar 16, 2016

In fabiokr/vagrant-sshfs#40 (comment) I already described the issue for us.

We have a setup, where we require decent file system performance for the applications that run in vagrant guest. The only viable solution we found to be working, was to have the host mounting a volume from the guest, so that the guest can work locally on the files.

I'm totally +1 on the issue, that you have to be careful when destroying (e.g. for updating) the box, because you will potentially lose something. I'd love to be able to avoid that as well, but this was not really a viable option because.

@barefootcoder
Copy link

We need this functionality as well, and I was quite surprised to find it removed. Our use case is that we don't actually use /vagrant for our code, because the mounting is so slow that trying to run commands that touch lots of files (like git or find or recursive greps) can take minutes instead of seconds. So instead of using vboxsf to mount code in /vagrant from host-to-guest, we git clone the repo into a local directory on the Vagrant box and use sshfs to mount it guest-to-host. This has really solved a lot of our problems, so I would hate to see it gone permanently.

I was able to use the workaround in fabiokr/vagrant-sshfs#40 (i.e. installing the older version) as a temporary fix:

vagrant plugin install vagrant-sshfs --plugin-version 0.0.8

@dustymabe
Copy link
Owner Author

Hey @barefootcoder. thanks for the feedback. Please do continue to use version 0.0.8 of the plugin for now. I'm going to try to either find a suitable alternative for this use case or add this back as a supported mode to vagrant-sshfs.

@sergiitk
Copy link

sergiitk commented Apr 1, 2016

We at DoSomething.org also rely on this functionality. Here's our wiki page on how we use guest-to-host mounts:
https://github.com/DoSomething/phoenix/wiki/Building-your-local-environment-(SSHFS)

@dustymabe
Copy link
Owner Author

Hi @sergii-tkachenko.. Thanks for your feedback on this. It's good to know how many people are using it this way.

@aesweeting
Copy link

Like @barefootcoder, I also use this approach due to a performance hit while working on a large project with thousands of tests. The guest-to-host mount has been the best option so far. Using the standard host-to-guest mount approach causes a huge increase in test times.

Note that I keep my project configs on a host-to-guest mount (symlinked inside the box to the appropriate projects).
This provides the benefits of performance without the cons of losing config files when the box is destroyed.

Very keen to see this back in the plugin, have downgraded as per @barefootcoder's example until then.

@dustymabe
Copy link
Owner Author

dustymabe commented Apr 21, 2016

@adamelliottsweeting thanks. I do believe that I will add this back to the plugin. Trying to find time to do this. Hopefully won't be too long.

@dustymabe
Copy link
Owner Author

Hello @tisba @barefootcoder @sergii-tkachenko @adamelliottsweeting. The code for this has been merged. Would you please test out the latest pre-release to see if it works for you?

here is how to test:

vagrant plugin uninstall vagrant-sshfs
wget https://dustymabe.fedorapeople.org/gem/vagrant-sshfs-1.1.0.dev.gem
vagrant plugin install ./vagrant-sshfs-1.1.0.dev.gem

@tisba
Copy link

tisba commented Jul 29, 2016

Thats great, thanks @dustymabe!

In the meantime we completely switched away from using sshfs and we are now on NFS again which works kind of okay after some tuning. I'd like to give the dev release a test, but I cannot promise to do that soonish :-/

@dustymabe
Copy link
Owner Author

@tisba hopefully we can win you back over

@ravn
Copy link

ravn commented Jan 4, 2017

We have another situation where we want to be able to easily see local files inside the guest to get the full benefit of the development environment in which vagrant runs. We do not have to edit the files. Previously we have used a shared host folder, but this mean that files run out of sync if the VM is rolled back to a snapshot (which we use a lot).

@dustymabe
Copy link
Owner Author

@ravn - we support this in the latest release. give it a try

@jdevora
Copy link

jdevora commented Jun 16, 2017

I'm using it for have access from the host to the logs generated on the Vagrant guest machine
Very useful during development and debugging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants