Git Product home page Git Product logo

vagrant-sshfs's Introduction

vagrant-sshfs's People

Contributors

adrianolek avatar blinkystitt avatar dmatora avatar fabiokr avatar nakajijapan avatar stephane-klein avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

vagrant-sshfs's Issues

support for folder created on provision

I want to mount a folder that is created by the provisionner (puppet) but sshfs is setup before the provisionner.

I then get an error:
==> ssq-ca-liferay: Mounting SSHFS for /opt/liferay-portal to mount
ssq-ca-liferay: Source folder /opt/liferay-portal does not exist, create?
y
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
mkdir -p /opt/app

Stdout from the command:

Stderr from the command:

mkdir: cannot create directory `/opt/app': Permission denied

What I'd need is the sshfs to kickoff after provisionning. As an alternative having a setting to force the creation of the folder if it didn't exist AND have it created by root if needed would also work.

As a work arround, I currently deactivate sshfs on first vagrant up.

mounting host folders into guests?

Is it possible to do it the other way around? i.e. mount a host folder into guest? Putting stuffs into the vm sometime causes troubles because it goes away after you destroyed the vm.

Couldn't mount folders from host to guest

Hi,

I'm trying to mount some folders onto my guest machine. nfsa doesn't work because of encryption and rsync takes way too long to sync.

I used the follwoing settings as per your instructions.
config.sshfs.mount_on_guest = true
config.sshfs.paths = { "../folder/on_host" => "/vagrant" }
config.sshfs.host_addr = '10.0.2.2' // got this by doing ifconfig on vm
I keep getting this error after using password
==> default: Error when mounting /home/user/dev to /vagrant/
vagrant-sshfs failed and couldn't proceed

is there any special vagrant settings that I should have added.
and one more question how do I find the correct value for this option
config.sshfs.host_addr = '10.0.2.2'
I tired ifconfig on machine and host then tried all ips available in both still no luck

Update:

I found the ip address and while on vm I ssh into my host easly but I'm still getting that error when vargrant reload or up
Thanks

I appreciate the help

Add defer_permissions option

While trying to use the plug-in under Mac OS X 10.10.2, I kept getting "Permission denied" errors when creating or modifying files in the mounted directory. I fixed this issue by adding -o defer_permissions to line 18 of lib/vagrant-sshfs/builders/host.rb. I found the solution in this issue for OSXFuse.

This issue could also be fixed with the solution provided in pr #30.

Background

I am mounting a Centos 6.6 guest's Apache web root (in /srv/www) to a local folder. The web root is owned by the apache user and group, and there is an ACL configured to give the vagrant user full rwx permission.

I had to install OSXFuse and it's SSHFS plug-in to get this working because I was getting an error saying that the sshfs binary could not be found. The plug-in's README file mentions a requirement for SSHFS being installed on the guest, but not the host which was confusing at first.

Configurable sshfs mount options (-o)

I think, it'd be very useful to have an option to set custom sshfs mount options (-o).
It would provide another one layer of project-, user- and OS-specific customizations.

Here's some usecases:

  • -o follow_symlinks or -o transform_symlinks — solves "broken symlinks" problem.
    Since mounted folder are broken since they point to paths inside VM
  • -o volname="Project name" — allows to rename volume name in OSX from "OSXFUSE Volume 0 (sshfs)" to something more meningful
  • -o noapplespecial — solves an issue with "._" files

absolute source

Great plugin. Our project is very large and running it the normal vagrant way is unbearable as NFS is slow.

Is it at all possible to have an absolute source? That is, map the guest's /var/www/html to the host's [vagrantFileDir]/html. I'm just going to symlink inside of the VM for now.

I can see it not being a good idea the other way around (mounting outside the location of the Vagrantfile)

prompt_сreate_folders broken

the C in prompt_сreate_folders appears to be some unicode character, causing it to give a syntax error if you try to paste the config key exactly.

Fixing the C then gives a * The following settings shouldn't exist: prompt_create_folders

Connection reset by peer error with Vagrant 1.4.1

I've got a strange problem with sshfs. I understand that probably it is not real issue, but this is the only place that seems to me correct to share my problem.
The final result is that when I try to mount folder over ssh via Vagrant I got this error 'read: Connection reset by peer'. Obviously I am doing something wrong but I don't know how to debug it.

Here is an output from my terminal:

vagrant up alpha
Bringing machine 'alpha' up with 'virtualbox' provider...
[alpha] VirtualBox VM is already running.
[alpha] Mounting SSHFS for `/home/vagrant/inno` to `src-alpha/inno`
read: Connection reset by peer
[alpha] Mounting SSHFS for `/home/vagrant/ss7_interface` to `src-alpha/ss7_interface`
read: Connection reset by peer

On the VM I see this in auth.log:

Mar 31 07:55:52 alpha sshd[2480]: Accepted publickey for vagrant from 10.0.2.2 port 36441 ssh2
Mar 31 07:55:52 alpha sshd[2480]: pam_unix(sshd:session): session opened for user vagrant by (uid=0)
Mar 31 07:55:52 alpha sshd[2531]: Connection closed by 10.0.2.2 [preauth]
Mar 31 07:55:53 alpha sshd[2537]: Connection closed by 10.0.2.2 [preauth]
Mar 31 07:55:53 alpha sshd[2480]: pam_unix(sshd:session): session closed for user vagrant

Here is how my sshfs mount is configured in the Vagrantfile:

alpha.sshfs.paths = { "/home/vagrant/inno" => "src-" + $hostname_a + "/inno",
                          "/home/vagrant/ss7_interface" => "src-" + $hostname_a + "/ss7_interface",
    }

I've tried to remove the string concatenation - no good.

I also try to mount the folder manually with this command

sshfs [email protected]:inno src-alpha/inno/

and it works.

The basebox I use is this: http://cloud-images.ubuntu.com/vagrant/saucy/current/saucy-server-cloudimg-amd64-vagrant-disk1.box

Can I enable some verbose sshfs output, so I can understand what's wrong?

Fail to mount files when vagrant up runs

I added this line to Vagrantfile

config.sshfs.paths = { "/var/www" => "/Users/user/Documents/project/mount" }

and when I did the vagrant up, I get this error:

==> default: VM already provisioned. Run vagrant provision or use --provision to force it
==> default: Mounting SSHFS for /var/www to /Users/user/Documents/project/mount
/Users/user/.vagrant.d/gems/gems/vagrant-sshfs-0.0.4/lib/vagrant-sshfs/actions.rb:14:in ``': No such file or directory - sshfs (Errno::ENOENT)
from /Users/user/.vagrant.d/gems/gems/vagrant-sshfs-0.0.4/lib/vagrant-sshfs/actions.rb:14:inblock in mount!' from /Users/user/.vagrant.d/gems/gems/vagrant-sshfs-0.0.4/lib/vagrant-sshfs/actions.rb:12:in each'
from /Users/user/.vagrant.d/gems/gems/vagrant-sshfs-0.0.4/lib/vagrant-sshfs/actions.rb:12:in`mount!'
from /Users/user/.vagrant.d/gems/gems/vagrant-sshfs-0.0.4/lib/vagrant-sshfs/actions.rb:108:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/warden.rb:34:in`call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/builtin/call.rb:57:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/warden.rb:34:in`call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/builtin/box_check_outdated.rb:65:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/warden.rb:34:in`call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/warden.rb:34:in`call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.5.3/plugins/providers/virtualbox/action/check_virtualbox.rb:17:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/warden.rb:34:in`call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/builtin/call.rb:57:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/warden.rb:34:in`call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/warden.rb:34:in`call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/builtin/call.rb:57:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/warden.rb:34:in`call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.5.3/plugins/providers/virtualbox/action/check_virtualbox.rb:17:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/warden.rb:34:in`call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/builder.rb:116:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/runner.rb:69:in`block in run'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/util/busy.rb:19:in `busy'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/action/runner.rb:69:in`run'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/machine.rb:157:in `action'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.5.3/lib/vagrant/batch_action.rb:72:in`block (2 levels) in run'

Error when `vagrant up` is issued with vagrant already running

Without this plugin, vagrant up is a safe noop when vagrant is already up. This plugin causes an error in that case:

Bringing machine 'default' up with 'virtualbox' provider...
[default] VirtualBox VM is already running.
[default] Mounting SSHFS for `bt` to `/Users/dcopeland/devbox-bt`
[default] Non empty target folder `/Users/dcopeland/devbox-bt`
vagrant-sshfs failed and couldn't proceed

So, for instance, it breaks an alias that executes cd <vagrant dir> && vagrant up && vagrant ssh.

Non empty target folder

==> default: Mounting shared folders...
    default: /vagrant => /home/yaap/web/www/project.dev

....

==> default: Mounting SSHFS for `/vagrant` to `.`
==> default: Non empty target folder `/home/yaap/web/www/project.dev`
vagrant-sshfs failed and couldn't proceed

Is there any way to disable shared folders and leave only sshfs?

config.sshfs.paths = { "/vagrant" => "." }

I just wont to mount my project folder to /vagrant on guest (which is document root for web server). What should I do in my case?

Unknown configuration section 'sshfs'.

Vagrant version is 1.8.1.
Plugin vagrant-sshfs is installed:

vagrant plugin list

vagrant-share (1.1.5, system)
vagrant-sshfs (1.0.0)

Appropriate lines are added:

Vagrant.configure("2") do |config|
  # always use Vagrants insecure key
  config.ssh.insert_key = false

  # vagrant-sshfs - start of configuration
  config.sshfs.username = "some_user"
  config.sshfs.paths = { "xxx" => "yyy" }
  # vagrant-sshfs - end of configuration
....

But when I run: vagrant reload I receive:

There are errors in the configuration of this machine. Please fix
the following errors and try again:

Vagrant:
* Unknown configuration section 'sshfs'.

Is it some kind of bug or did I miss sth?

Support for absolute folders

Can you make it so folders starting with a / count as absolute folders, as opposed to folders relative to the vagrant user's home folder?

Also, can you allow specifying the user to log in with?

Error when mounting

Error when mounting C:/Users/USER/Desktop/delaidea/src to mountpoint vagrant-sshfs failed and couldn't proceed

I have tried to start the plugin manually, but I still get the same error.

Check before unmounting

The plugin's default behaviour is to unmount the target before mounting it, just in case it was mounted already.

However, un-mounting when it's not mounted results in an error on the screen (nothing major, but annoying when part of a clean vagrant output)

umount: /Users/vincenzo/Documents/Repositories/solas: not currently mounted

Checking for the mount rather doing umount/mount has also the benefit of less overhead.

I am just not versed at all in Ruby, else I'd make a PR...
I can even manage to identify the piece of code and write what I think it's the fix, but I am really just not sure how to go about testing it then...

Error when mounting directory

I'm trying to mount the directory from guest, but keep having this error:

developer-rsync: Password for [email protected]: ==> developer-rsync: Error when mounting /opt/webappsto/var/www vagrant-sshfs failed and couldn't proceed

If I ssh to the guest, I can ssh to host and the directory can also be mounted with sshfs.
I can see IdentityFile option is here:

`#{sshfs_bin} -p #{port} #{username}@#{host}:#{check_src!(src)} #{check_target!(target)} -o IdentityFile=#{private_key}`

But how to use it? I want to try connecting with RSA key.

[Feature request] -o nonempty

Is it possible to add an option to the vagrant-sshfs plugin so to support -o nonempty?
It'd be kinda useful. I have a scenario where it's happening often that, after a long standby of the host machine, the sshfs mount drops, and the IDE that was open and pointed to the mountpoint writes its hidden files to the mountpoint (which, unmounted, is just a folder). Result? At the next reload / sshfs, it won't mount:

==> default: Mounting SSHFS for `/guest` to `~/host`
==> default: Non empty target folder `~/host`
vagrant-sshfs failed and couldn't proceed


Creating non-existing folders wording

Hi, could you please clarify the question (if this is in your plugin) when a folder does not physically exist on my host machine?

Right now it asks: Target folder some-folder does not exist, create?

Anytime I answer with yes, I get kicked out because "y" is actually expected but that's not in the message and it always just freaks me out after 40 seconds of waiting for machine bootup just to do it again over a 1 letter answer ;)

Thanks a million!

Overrides NFS folders?

I need the functionality from both, why does this disable it completely? I'd rather disabled NFS manually if I need to.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.