Giter Club home page Giter Club logo

vagrant-sshfs's Introduction

vagrant-sshfs

Considerations

The benefits of this approach:

  • Works on any host platform and hypervisor type

    • Windows, Linux, Mac OS X

    • Virtualbox, Libvirt, Hyper-V, VMWare

  • Seamlessly works on remote Vagrant solutions

    • Works with vagrant aws/openstack/etc.. plugins

The drawbacks with this approach:

  • Performance is worse than an implementation like NFS

  • There must be sftp-server software on the Vagrant host

sftp-server is usually provided by SSH server software so it already exists on Linux/Mac. On windows you only need to install openssh via cygwin and you will get sftp-server.

Also, we recommend running vagrant from the cygwin provided terminal. There have been issues with other shells leading to problems with mounts.

History

The inspiration for this plugin came from Fabio Kreusch and his code for the original vagrant-sshfs Vagrant plugin. The goal of this plugin (as opposed to the old implementation) is to implement SSHFS as a synced folder plugin just like the other synced folder plugins (NFS/RSYNC/SMB/VirtualBox).

This plugin was developed mainly by copying the code from the NFS synced folder plugin from the Vagrant core code and molding it to fit SSHFS.

Modes of Operation

Sharing Vagrant Host Directory to Vagrant Guest - 94% of users

This plugin uses SSHFS slave mounts (see link) to mount a directory from the Vagrant Host into the Vagrant Guest. It uses the sftp-server software that exists on the host and sshfs running in slave mode within the guest to create a connection using the existing authentication over SSH that vagrant sets up for you.

Sharing Arbitrary Host Directory to Vagrant Guest - 1% of users

This plugin allows you to share a folder from an arbitrary host to the Vagrant Guest. This would allow you to do a folder mount to some other host that may have files that you need. To do this the plugin will run an SSHFS command from the Guest and connect to the arbitrary host that must have an SSH daemon running. You must provide the ssh_host option in the Vagrantfile to get this to work. You can use ssh key forwarding or username/password for authentication for this.

See Options and Appendix A for more information.

Sharing Vagrant Guest Directory to Vagrant Host - 5% of users

NOTE: This option is dangerous as data will be destroyed upon vagrant destroy

This plugin allows you to share a folder from a Vagrant guest into the host. If you have workloads where there are a lot of disk intensive operations (such as compilation) it may be ideal to have the files live in the guest where the disk intensive operations would occur. For discussion see Issue #7.

See Options for more information on how to enable this type of mount.

Getting Started

In order to use this synced folder implementation perform the following steps:

Install Plugin

In order to install the plugin simply run the following command:

# vagrant plugin install vagrant-sshfs

Add SSHFS Synced Folder in Vagrantfile

Edit your Vagrantfile to specify a folder to mount from the host into the guest:

config.vm.synced_folder "/path/on/host", "/path/on/guest", type: "sshfs"

Now you can simply vagrant up and your folder should be mounted in the guest. For more options that you can add see the Options section.

Executing the vagrant sshfs Command

The Vagrant SSHFS plugin also supports execution of the vagrant sshfs command from the command line. Executing this command with the --mount option will iterate through the Vagrant file and attempt to mount (via SSHFS) any folders that aren’t already mounted in the Vagrant guest. Executing with the --unmount option will unmount any mounted folders.

vagrant sshfs [--mount|--unmount] [vm-name]

Options

The SSHFS synced folder plugin supports a few options that can be provided in the Vagrantfile. The following sections describe the options in more detail.

Generic Options

The SSHFS synced folder plugin supports a few options that can be provided in the Vagrantfile. They are described below:

  • disabled

    • If set to 'true', ignore this folder and don’t mount it.

  • ssh_opts_append

    • Add some options for the ssh connection that will be established.

    • See the ssh man page for more details on possible options.

  • sshfs_opts_append

    • Add some options for the sshfs fuse mount that will made

    • See the sshfs man page for more details on possible options.

An example snippet from a Vagrantfile:

config.vm.synced_folder "/path/on/host", "/path/on/guest",
    ssh_opts_append: "-o Compression=yes -o CompressionLevel=5",
    sshfs_opts_append: "-o auto_cache -o cache_timeout=115200",
    disabled: false, type: "sshfs"

Options Specific to Arbitrary Host Mounting

The following options are only to be used when sharing an arbitrary host directory with the guest. They will be ignored otherwise:

  • ssh_host

    • The host to connect to via SSH. If not provided this will be detected as the Vagrant host that is running the Vagrant guest.

  • ssh_port

    • The port to use when connecting. Defaults to port 22.

  • ssh_username

    • The username to use when connecting. If not provided it is detected as the current user who is interacting with Vagrant.

  • ssh_password

    • The password to use when connecting. If not provided and the user is not using SSH keys, then the user will be prompted for the password. Please use SSH keys and don’t use this option!

  • prompt_for_password

    • The user can force Vagrant to interactively prompt the user for a password by setting this to 'true'. Alternatively the user can deny Vagrant from ever prompting for the password by setting this to 'false'.

An example snippet from a Vagrantfile:

config.vm.synced_folder "/path/on/host", "/path/on/guest",
    ssh_host: "somehost.com", ssh_username: "fedora",
    ssh_opts_append: "-o Compression=yes -o CompressionLevel=5",
    sshfs_opts_append: "-o auto_cache -o cache_timeout=115200",
    disabled: false, type: "sshfs"

Options Specific to Reverse Mounting (Guest→Host Mount)

If your host has the sshfs software installed then the following options enable mounting a folder from a Vagrant Guest into the Vagrant Host:

  • reverse

    • This can be set to 'true' to enable reverse mounting a guest folder into the Vagrant host.

An example snippet from a Vagrantfile where we want to mount /data on the guest into /guest/data on the host:

config.vm.synced_folder "/guest/data", "/data", type: 'sshfs', reverse: true

FAQ

Here are some answers to some frequently asked questions:

Why do new files take time to appear inside the guest?

Sometimes it can take time for files to appear on the other end of the sshfs mount. An example would be I create a file on my host system and then it doesn’t show up inside the guest mount for 10 to 20 seconds. This is because of caching that SSHFS does to improve performance. Performance vs accuracy is always going to be a trade-off. If you’d like to disable caching completely you can disable caching completely by appending the cache=no SSHFS option to the synced folder definition in the Vagrantfile like so:

config.vm.synced_folder "/path/on/host", "/path/on/guest",
    type: "sshfs", sshfs_opts_append: "-o cache=no"

All caching options that are available to sshfs can be added/modified in this same manner.

Appendix A: Using Keys and Forwarding SSH Agent

When sharing an arbitrary host directory you may want a completely non-interactive experience. You can either hard code your password in the Vagrantfile or you can use SSH keys. A few guides for setting up ssh keys and key forwarding are on Github:

The idea is that if key1 is a key that is authorized to log in to the Vagrant host ,meaning there is an entry for key1 in the ~/.ssh/authorized_keys file, then you should be able to do the following to have a non-interactive experience with SSH keys and agent forwarding:

Modify the Vagrantfile to forward your SSH agent:

config.ssh.forward_agent = 'true'

Now set up your agent and add your key to the agent:

# eval $(ssh-agent)
# ssh-add /path/to/key1

And finally bring up your Vagrant guest:

# vagrant up

Appendix B: Development

For local development of this plugin here is an example of how to build, test and install this plugin on your local machine:

# Install development dependencies
$ gem install bundler && bundle install

# Build the gem (gets generated in the 'pkg' directory
$ bundle exec rake build

# Run Vagrant in the context of the plugin
$ bundle exec vagrant <command>

# Install built gem into global Vagrant installation (run outside of git checkout!)
$ vagrant plugin install <path to gem in pkg directory>

vagrant-sshfs's People

Contributors

ajxb avatar booxter avatar dcermak avatar dimstar77 avatar dustymabe avatar evenreven avatar henning-flmnn avatar hferentschik avatar ian2020 avatar kadel avatar russellhaering avatar shawnps avatar thatdocslady avatar the-eater avatar timschumi 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  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  avatar

vagrant-sshfs's Issues

Reverse mounting doesn't work in Mac OS X?

Hey, I'm a "1%" user who wants to mount a directory from the guest OS onto my host machine so I can use a text editor on the host OS to edit the files that exist on the machine.

I'm running El Capitan (10.11.6) with Vagrant 1.8.5, and VirtualBox 5.0.20.

The specific error I get is this:

==> default: Mounting NFS shared folders...
The capability 'sshfs_reverse_is_folder_mounted' could not be found. This is an internal error
that users should never see. Please report a bug.

The line in my Vagrant file is this:

diff --git a/Vagrantfile b/Vagrantfile
index b533225..7ca217b 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -30,4 +30,6 @@ Vagrant.configure('2') do |config|
     vbox.customize(['modifyvm', :id, '--natdnshostresolver1', 'on'])
     vbox.customize(['modifyvm', :id, '--natdnsproxy1', 'on'])
   end
+
+  config.vm.synced_folder "/Users/mark.campbell/Desktop/vagrant/", "/home/vagrant/src", type: "sshfs", sshfs_opts_append: "-o cache=no", reverse: true
 end

I poked around in the code and I noticed that the host_capability line is this

      host_capability("linux", "sshfs_reverse_is_folder_mounted") do
        require_relative "cap/host/linux/sshfs_reverse_mount"
        VagrantPlugins::HostLinux::Cap::MountSSHFS
      end

I don't know much, but I don't think that the "linux" value will let my host machine which is mac os x use this feature.

Is this a matter of updating the documentation as such or can we add this a feature just for mac os x? Or should this feature actually be working under mac os x?

Empty sshfs-folders after vagrant resume

Currently, when I do vagrant suspend and vagrant resume the sshfs-mountpoints are reportedly mounted, but the files from those mounts are not available. The only way I can work with vagrant-sshfs right now is to vagrant halt and vagrant up a machine.

Example snippet from my Vagrant-file

control.vm.provision :shell, path: "provision.sh"
control.vm.synced_folder ".", "/vagrant", 
                        type: "sshfs",
                        sshfs_opts_append: "-o allow_other"

Support vagrant-lxc

Hej,

first of all th for this awesome plugin, I was so lucky to finally remove NFS from my box !
It works great with vagrant-libvirt, but fails with vagrant-lxc:

--- vagrant/fgrehm » vagrant up --provider=lxc     

Ignoring ruby-libvirt-0.7.0 because its extensions are not built.  Try: gem pristine ruby-libvirt --version 0.7.0
Bringing machine 'default' up with 'lxc' provider...
==> default: Importing base box 'fgrehm/precise64-lxc'...
==> default: Checking if box 'fgrehm/precise64-lxc' is up to date...
==> default: Starting container...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 10.0.3.196:22
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: 
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default: 
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Installing SSHFS client...
==> default: Mounting SSHFS shared folder...
==> default: Mounting folder via SSHFS: /home/varac/vagrant/fgrehm => /vagrant
==> default: Checking Mount..
==> default: Checking Mount..
==> default: Checking Mount..
==> default: Checking Mount..
==> default: Checking Mount..
==> default: Checking Mount..
==> default: Checking Mount..
Mounting SSHFS shared folder via slave SSHFS mount failed. Please
look at the below STDERR output from the processes that were run.

SSH command:

Warning: Permanently added '10.0.3.196' (ECDSA) to the list of known hosts.
fuse: device not found, try 'modprobe fuse' first

SFTP command:

A proper fix would be appreciated!

Failure to unmount

I'm on a mac using the 'reverse' option (I'm mounting a folder on the guest into the host). Here's the problem. If I open a file from my mounted folder, when I do 'halt' on the VM we don't properly unmount.

For example, I open a text file from the mount point into VI (running on my host). I then do vagrant halt. The VM shuts down and the mount seems to disappear, but there running VI process is holding open a file. When I go to vagrant up the mount fails with

vm:

  • The host path of the shared folder is missing:

Looks like the old working plugin had some code that killed those running processes:

https://github.com/fabiokr/vagrant-sshfs/blob/master/lib/vagrant-sshfs/builders/host.rb#L10

If I fail to close all the processes I end up have to reboot in order to properly unmount.

traceback when using wrong path

if I use directory on host which doesn't exists, checking Mount section crash with traceback:
vagrant-sshfs (1.1.0)
Tested on windoes 10 in cygwin.

==> default: Mounting folder via SSHFS: /not/a/directory => /mnt/nothing
==> default: Checking Mount..
Warning: Permanently added '[127.0.0.1]:2222' (ECDSA) to the list of known hosts.
:/not/a/directory: No such file or directory
==> default: Checking Mount..
==> default: Checking Mount..
==> default: Checking Mount..
==> default: Checking Mount..
==> default: Checking Mount..
==> default: Checking Mount..
==> default: Checking Mount..
==> default: Checking Mount..
==> default: Checking Mount..
==> default: Checking Mount..
C:/Users/cdk/.vagrant.d/gems/gems/vagrant-sshfs-1.1.0/lib/vagrant-sshfs/cap/linux/sshfs_mount.rb:147:in `kill': Invalid argument (Errno::EINVAL)
    from C:/Users/cdk/.vagrant.d/gems/gems/vagrant-sshfs-1.1.0/lib/vagrant-sshfs/cap/linux/sshfs_mount.rb:147:in `sshfs_slave_mount'
    from C:/Users/cdk/.vagrant.d/gems/gems/vagrant-sshfs-1.1.0/lib/vagrant-sshfs/cap/linux/sshfs_mount.rb:68:in `sshfs_mount_folder'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/capability_host.rb:111:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/capability_host.rb:111:in `capability'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/guest.rb:43:in `capability'
    from C:/Users/cdk/.vagrant.d/gems/gems/vagrant-sshfs-1.1.0/lib/vagrant-sshfs/synced_folder.rb:78:in `block in enable'
    from C:/Users/cdk/.vagrant.d/gems/gems/vagrant-sshfs-1.1.0/lib/vagrant-sshfs/synced_folder.rb:51:in `each'
    from C:/Users/cdk/.vagrant.d/gems/gems/vagrant-sshfs-1.1.0/lib/vagrant-sshfs/synced_folder.rb:51:in `enable'
    from C:/Users/cdk/.vagrant.d/gems/gems/vagrant-sshfs-1.1.0/lib/vagrant-sshfs/command.rb:40:in `block in execute'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/plugin/v2/command.rb:226:in `block in with_target_vms'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/plugin/v2/command.rb:220:in `each'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/plugin/v2/command.rb:220:in `with_target_vms'
    from C:/Users/cdk/.vagrant.d/gems/gems/vagrant-sshfs-1.1.0/lib/vagrant-sshfs/command.rb:26:in `execute'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/cli.rb:42:in `execute'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/environment.rb:301:in `cli'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/bin/vagrant:174:in `<main>'

set up after reboots

If I reboot my box out of band of vagrant (e.g. rpm-ostree upgrade -r), sshfs doesn't get set up again. I think we should look at installing a systemd unit file.

working with scoop openssh

Hi !
I tried use the sshfs using cygwin and workgreat, i tried use scoop but it wont mount, any idea ?

Regards,
Todi !

Add ssh connection test - then ask user for password

Right now if we see the user is forwarding their ssh-agent we don't ask them for a password. We should actually do an ssh connection check and then ask them for the password if it doesn't work rather than just failing.

sshfs slave mode doesn't work with cmd.exe/powershell

NOTE: I had to hack around with the paths on vagrant-sshfs-1.1.0 to get this to work to begin with

The sftp-server process that gets kicked off on the host when running vagrant-sshfs seems to immediately get axed once the vagrant up or vagrant sshfs command exit. This is a snippet of what it looks like:

==> default: Folder Successfully Mounted!
remote host has disconnected

We either need to more clearly require cygwin, or find a way to work around this.

On a side note using the old mode where we connect to an SSH daemon that is running on the windows host does work.

password written to the terminal when an error occurs

We need to figure out how to pass a password without having to echo and pipe it in as stdin so that the error message a user gets when a failure occurs doesn't have their password in it. Sometimes users don't realize it and then they copy and paste the output to others.

The output looks like this:

==> default: Mounting folder via SSHFS: C:/Users/IEUser/tmp => /mount/windows
Mounting SSHFS shared folders failed. This is most often caused by either
an SSH Daemon not running on the host or invalid credentials being provided.
Please make sure an SSH daemon is running on the host and proper credentials
were provided to be able to authenticate via SSH.

The command and output are:

echo 'Passw0rd!' | sshfs -p 22 -o StrictHostKeyChecking=no -o allow_other -o noauto_cache -o password_stdin [email protected]:'C:/Users/IEUser/tmp' /mount/windows

Stdout from the command:
Stderr from the command:

read: Connection reset by peer

mount point is read only

Hi,

I've been trying to upgrade my configuration from the old (but working) plugin to this one. There's a host of problems but the most serious one is when I mount the guest folder onto my desktop (I'm on a Mac) everything is read only. There's some difference in the options I guess between your new plugin and the old one that worked but I can't figure it out from looking over the source. Here's the code section:

if Vagrant.has_plugin?("vagrant-sshfs") && ENV['SSHFS_MOUNT_POINT_HOST'] && ENV['SSHFS_MOUNT_POINT_GUEST']
config.vm.synced_folder ENV['SSHFS_MOUNT_POINT_HOST'], ENV['SSHFS_MOUNT_POINT_GUEST'],
ssh_username: "dev",
disabled: false, type: "sshfs",
reverse: true
end

I can mount but it s read only and none of the normal options to address this (-o allow_other,default_permissions) seems to help.

Been struggling with this fora few days (I have dozens of vagrant files with the old plugin that are now all busted). Really on the verge of just forking the old one.

Other problems include the fact that the build in rsync folder sync doesn't get disabled and I seem to get cases where the process that created this gets held open and I have to reboot. But lets figure out this read only thing, it must be something small. The only thing I can see difference between your version and the old working one is you added

-F /dev/null

https://github.com/dustymabe/vagrant-sshfs/blob/master/lib/vagrant-sshfs/cap/host/darwin/sshfs_reverse_mount.rb#L76

not sure if that is enough to mount read only though.

Any chance of you releasing the old working plugin under this namespace and putting your new one under a different namespace? Really this is likely busting code all over the place.

Error stream is never closed

In devstudio we do "vagrant up" for cdk2.1-rc3/cdk/components/rhel/rhel-ose Vagrant file with vagrant-sshfs plugin installed.
Then we read output and error streams. Output stream is terminated eventually but error stream is always open. We do read "Warning: Permanently added '[127.0.0.1]:2222' (ECDSA) to the list of known hosts." from the error stream which looks like came from sshfs plugin.
devstudio is stuck because the error stream is never closed.

support skipping guest provisioning

This project doesn't currently know about rpm-ostree, and the problem is that it runs before any project-specific provisioning occurs, which makes it hard to do.

Further, some users may not want to unconditionally enable EPEL for example. So maybe something like:

    admin1.vm.synced_folder ".", "/var/home/vagrant/sync", type: 'sshfs', provision: false

'Unable to fetch some archives' error while 'Installing SSHFS client'

EDIT: Ubuntu guest only


Hello,

Since yesterday I‘ve been getting this error when setting up new Ubuntu and Debian VMs with the vagrant-sshfs plugin:

...
==> default: Installing SSHFS client...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

apt-get install -y sshfs

Stdout from the command:

Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
  fuse libglib2.0-0 libglib2.0-data libxml2 sgml-base shared-mime-info
  xml-core
Suggested packages:
  sgml-base-doc debhelper
The following NEW packages will be installed:
  fuse libglib2.0-0 libglib2.0-data libxml2 sgml-base shared-mime-info sshfs
  xml-core
0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
Need to get 2,262 kB of archives.
After this operation, 11.2 MB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main libglib2.0-0 amd64 2.40.2-0ubuntu1 [1,058 kB]
Err http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main libxml2 amd64 2.9.1+dfsg1-3ubuntu4.6
  404  Not Found [IP: 91.189.91.26 80]
Err http://security.ubuntu.com/ubuntu/ trusty-security/main libxml2 amd64 2.9.1+dfsg1-3ubuntu4.6
  404  Not Found [IP: 91.189.88.152 80]
Get:2 http://us.archive.ubuntu.com/ubuntu/ trusty/main sgml-base all 1.26+nmu4ubuntu1 [12.5 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main fuse amd64 2.9.2-4ubuntu4.14.04.1 [25.1 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main libglib2.0-data all 2.40.2-0ubuntu1 [116 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu/ trusty/main shared-mime-info amd64 1.2-0ubuntu3 [415 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu/ trusty/main xml-core all 0.13+nmu2 [23.3 kB]
Get:7 http://us.archive.ubuntu.com/ubuntu/ trusty/main sshfs amd64 2.5-1ubuntu1 [41.7 kB]
Fetched 1,691 kB in 2s (620 kB/s)


Stderr from the command:

stdin: is not a tty
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/libx/libxml2/libxml2_2.9.1+dfsg1-3ubuntu4.6_amd64.deb  404  Not Found [IP: 91.189.88.152 80]

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

As the error suggested, I‘ve ssh-ed into the guest machine and ran sudo apt-get update --fix-missing. Then exit, vagrant reload and everything went fine:

...
==> default: Installing SSHFS client...
==> default: Mounting SSHFS shared folder...
==> default: Mounting folder via SSHFS: [host-folder-path] => [guest-folder-path]
==> default: Checking Mount..
==> default: Checking Mount..
==> default: Folder Successfully Mounted!
...

I‘m not sure if just running sudo apt-get update --fix-missing when this error happens would be an ideal solution, but I saw that something similar has already been done for Arch.

I glad to send a PR, but I probably need to first discuss what‘s the best approach, since I don‘t have much experience developing vagrant plugins.

Cheers!

Unable to mount if there is space in the folder in between to the path of Vagrantfile

Hi,

We recently ran into this issue where I tried to use vagrant-sshfs for mounting where my vagrantfile was located in a place which contain space in one of folder.

Steps to reproduce

Logs

cdk test $ pwd
/home/budhram/redhat/cdk test

cdk test $ vuv
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'cdkv2'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: cdktest_default_1475670982222_36385
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: 
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default: 
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Registering box with vagrant-registration...
    default: Would you like to register the system now (default: yes)? [y|n]n
==> default: Checking for guest additions in VM...
    default: No guest additions were detected on the base box for this VM! Guest
    default: additions are required for forwarded ports, shared folders, host only
    default: networking, and more. If SSH fails on this machine, please install
    default: the guest additions and repackage the box to continue.
    default: 
    default: This is not an error message; everything may continue to work properly,
    default: in which case you may ignore this message.
==> default: Configuring and enabling network interfaces...
==> default: Landrush IP not installed in guest yet (or it's an outdated version). Installing now.
==> default: Copying TLS certificates to /home/budhram/redhat/cdk test/.vagrant/machines/default/virtualbox/docker
==> default: Mounting SSHFS shared folder...
==> default: Mounting folder via SSHFS: /home/budhram => /home/budhram
==> default: Checking Mount..
==> default: Checking Mount..
==> default: Checking Mount..
==> default: Checking Mount..
==> default: Checking Mount..
==> default: Checking Mount..
==> default: Checking Mount..
Mounting SSHFS shared folder via slave SSHFS mount failed. Please
look at the below STDERR output from the processes that were run.

SSH command:

ssh: Could not resolve hostname test/.vagrant/machines/default/virtualbox/private_key: No address associated with hostname


SFTP command:

sshfs install fails on AWS EC2 Ubuntu 16.04 server cloud image

Hey, this works fine for Ubuntu 14.04, but when I just tried bringing up a VM
that uses sshfs on a 16.04 AMI, I get this error and 'vagrant up' stops:

==> default: Installing SSHFS client...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

apt-get install -y sshfs

Stdout from the command:

Reading package lists...
Building dependency tree...
Reading state information...


Stderr from the command:

mesg: ttyname failed: Inappropriate ioctl for device
E: Unable to locate package sshfs

This might not be your fault though! There is another mysterious error I see as well... a check for python returns false, even though python IS THERE. I'll come back here with what I discover, but for now just wanted to note this in case anyone else has observed the same thing.

Debian: 'Mounting SSHFS shared folder via slave SSHFS mount failed.' error.

Hi,

When trying to vagrant up Debian VMs (tested with debian/jessie64, debian/wheezy64 and minimal/wheezy64), while Checking Mount.. is running the following error is thrown:

Mounting SSHFS shared folder via slave SSHFS mount failed. Please
look at the below STDERR output from the processes that were run.

SSH command:

Warning: Permanently added '[127.0.0.1]:2222' (ECDSA) to the list of known hosts.
Received disconnect from 127.0.0.1 port 2222:2: Too many authentication failures for vagrant
Connection to 127.0.0.1 closed by remote host.


SFTP command:

Tested only on a macOS 10.12.3 with VirtualBox host.

Cheers!

Error when using ssh forwarding on windows with cygwin

When using ssh forwarding on windows (i.e. a password is not provided by the user) I end up with an error:

Mounting SSHFS shared folders failed. This is most often caused by either
an SSH Daemon not running on the host or invalid credentials being provided.
Please make sure an SSH daemon is running on the host and proper credentials
were provided to be able to authenticate via SSH.

The command and output are:

sshfs -p 22 -o StrictHostKeyChecking=no -o allow_other -o noauto_cache [email protected]:'./' /vagrant_data

Stdout from the command:

Stderr from the command:

stdin: is not a tty
read: Connection reset by peer

The interesting part is the stdin: is not a tty. When using a password this is not an issue most likely because the password is piped in to the sshfs command (solving the problem of the tty).

Mount under root owned folder fails in 1.3.0

After upgrading to 1.3.0, I get stuck at "Checking Mount.." when starting a halted machine. Full output:

$ rpm -q vagrant ruby vagrant-sshfs
vagrant-1.8.1-5.fc24.noarch
ruby-2.3.1-56.fc24.x86_64
vagrant-sshfs-1.3.0-1.fc24.noarch
$ vagrant up
Bringing machine 'vmcheck' up with 'libvirt' provider...
==> vmcheck: Starting domain.
==> vmcheck: Waiting for domain to get an IP address...
==> vmcheck: Waiting for SSH to become available...
/usr/share/gems/gems/net-ssh-2.9.1/lib/net/ssh/transport/session.rb:67:in `initialize': Object#timeout is deprecated, use Timeout.timeout instead.
/usr/share/gems/gems/net-ssh-2.9.1/lib/net/ssh/transport/session.rb:67:in `initialize': Object#timeout is deprecated, use Timeout.timeout instead.
/usr/share/gems/gems/net-ssh-2.9.1/lib/net/ssh/transport/session.rb:67:in `initialize': Object#timeout is deprecated, use Timeout.timeout instead.
/usr/share/gems/gems/net-ssh-2.9.1/lib/net/ssh/transport/session.rb:67:in `initialize': Object#timeout is deprecated, use Timeout.timeout instead.
/usr/share/gems/gems/net-ssh-2.9.1/lib/net/ssh/transport/session.rb:67:in `initialize': Object#timeout is deprecated, use Timeout.timeout instead.
/usr/share/gems/gems/net-ssh-2.9.1/lib/net/ssh/transport/session.rb:67:in `initialize': Object#timeout is deprecated, use Timeout.timeout instead.
/usr/share/gems/gems/net-ssh-2.9.1/lib/net/ssh/transport/session.rb:67:in `initialize': Object#timeout is deprecated, use Timeout.timeout instead.
/usr/share/gems/gems/net-ssh-2.9.1/lib/net/ssh/transport/session.rb:67:in `initialize': Object#timeout is deprecated, use Timeout.timeout instead.
/usr/share/gems/gems/net-ssh-2.9.1/lib/net/ssh/transport/session.rb:67:in `initialize': Object#timeout is deprecated, use Timeout.timeout instead.
/usr/share/gems/gems/net-ssh-2.9.1/lib/net/ssh/transport/session.rb:67:in `initialize': Object#timeout is deprecated, use Timeout.timeout instead.
/usr/share/gems/gems/net-ssh-2.9.1/lib/net/ssh/transport/session.rb:67:in `initialize': Object#timeout is deprecated, use Timeout.timeout instead.
/usr/share/gems/gems/net-ssh-2.9.1/lib/net/ssh/transport/session.rb:67:in `initialize': Object#timeout is deprecated, use Timeout.timeout instead.
/usr/share/gems/gems/net-ssh-2.9.1/lib/net/ssh/transport/session.rb:67:in `initialize': Object#timeout is deprecated, use Timeout.timeout instead.
/usr/share/gems/gems/net-ssh-2.9.1/lib/net/ssh/transport/session.rb:67:in `initialize': Object#timeout is deprecated, use Timeout.timeout instead.
/usr/share/gems/gems/net-ssh-2.9.1/lib/net/ssh/transport/session.rb:67:in `initialize': Object#timeout is deprecated, use Timeout.timeout instead.
/usr/share/gems/gems/net-ssh-2.9.1/lib/net/ssh/transport/session.rb:67:in `initialize': Object#timeout is deprecated, use Timeout.timeout instead.
/usr/share/gems/gems/net-ssh-2.9.1/lib/net/ssh/transport/session.rb:84:in `initialize': Object#timeout is deprecated, use Timeout.timeout instead.
==> vmcheck: Creating shared folders metadata...
==> vmcheck: Mounting SSHFS shared folder...
==> vmcheck: Mounting folder via SSHFS: /code/github.com/projectatomic/rpm-ostree/vagrant-dev => /var/roothome/sync
==> vmcheck: Checking Mount..
==> vmcheck: Checking Mount..
==> vmcheck: Checking Mount..
==> vmcheck: Checking Mount..
==> vmcheck: Checking Mount..
==> vmcheck: Checking Mount..
==> vmcheck: Checking Mount..
Mounting SSHFS shared folder via slave SSHFS mount failed. Please
look at the below STDERR output from the processes that were run.

SSH command:

Warning: Permanently added '192.168.121.201' (ECDSA) to the list of known hosts.


SFTP command:

This is the Vagrantfile that I'm using: https://github.com/projectatomic/rpm-ostree/blob/master/Vagrantfile (though note the fuse-sshfs workaround mentioned in: https://github.com/projectatomic/rpm-ostree/tree/master/vagrant).

Reverting back to 1.2.1 works.

SSHFS mount failed with CentOS 7 Vagrant box

Steps to reproduce

  • mkdir centos;cd centos
  • vagrant init centos/7
  • edit the Vagrantfile to add config.vm.synced_folder "./", "/home/vagrant", type: "sshfs"
  • vagrant up
[lmohanty@LalatenduM-laptop centos]$ vagrant up
Bringing machine 'default' up with 'libvirt' provider...
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
==> default: Configuring and enabling network interfaces...
==> default: Rsyncing folder: /home/lmohanty/vagrantboxes/centos/ => /home/vagrant/sync
==> default: Installing SSHFS client...
==> default: Mounting SSHFS shared folders...
==> default: Mounting folder via SSHFS: /home/lmohanty/vagrantboxes/centos => /home/vagrant
==> default: Checking Mount..
Warning: Permanently added '192.168.121.191' (ECDSA) to the list of known hosts.
vagrant@192.168.121.191's password: ==> default: Checking Mount..
==> default: Checking Mount..
==> default: Checking Mount..
==> default: Checking Mount..
==> default: Checking Mount..
==> default: Checking Mount..
==> default: Checking Mount..
==> default: Checking Mount..
==> default: Checking Mount..
==> default: Checking Mount..

Mounting SSHFS shared via slave SSHFS mount failed. Please look at your 
terminal scrollback to look for any error messages from the processes that 
were run.
  • vagrant ssh asking password to login in to the box
[lmohanty@LalatenduM-laptop centos]$ vagrant ssh
[email protected]'s password: 

I tried to use the ssh-key from vagrant ssh. It did not work and asked for password.

[lmohanty@LalatenduM-laptop centos]$ vagrant ssh-config 
Host default
  HostName 192.168.121.191
  User vagrant
  Port 22
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile "/home/lmohanty/vagrantboxes/centos/.vagrant/machines/default/libvirt/private_key"
  IdentitiesOnly yes
  LogLevel FATAL

[lmohanty@LalatenduM-laptop centos]$ ssh -i /home/lmohanty/vagrantboxes/centos/.vagrant/machines/default/libvirt/private_key [email protected]
Warning: Permanently added '192.168.121.191' (ECDSA) to the list of known hosts.
[email protected]'s password: 
Last login: Mon May 23 02:27:36 2016 from 192.168.121.1

Cross checked and found that fuse-sshfs is getting installed properly in the guest box.

[vagrant@localhost ~]$ sudo rpm -qa | grep fuse
fuse-libs-2.9.2-6.el7.x86_64
fuse-sshfs-2.5-1.el7.x86_64
fuse-2.9.2-6.el7.x86_64

Log STDERR to useful location

In 7c8285c / #28 we started redirecting the STDERR stream to a temporary file. Let's go back and appropriately send the STDERR output to a predictable file location and also possibly print out the contents of these files once an error with the mount is detected.

new files appear in box with about 15 s delay

If I create file on host, I can see it in box after about 15 second (ls file), but if I want to read that file, I can immediately (cat file).
For other direction, I can see no delay.

Not working on windows platform with other shell than cygwin

Under windows (7 in my case), I faced 2 issues in making vagrant-sshfs v1.1.0 work with a dos shell with openssh port for win32/64 (https://github.com/PowerShell/Win32-OpenSSH)

1 - PATH environment variable wrongly appended in "lib/vagrant-sshfs/synced_folder.rb#find_executable" :
The test case for windows platform implies to be under cygwin.
In case of dos shell we fall into the else case and gets the PATH environment variable appended with unix paths separator ':' wich fail the plugin into finding ssh/sftp-server executables.

Windows platform and cygwin conditions needs to be separated.

Proposed patch :

diff U3B v1.1.0/lib/vagrant-sshfs/synced_folder.rb .vagrant.d/gems/gems/vagrant-sshfs-1.1.0/lib/vagrant-sshfs/synced_folder.rb
--- v1.1.0/lib/vagrant-sshfs/synced_folder.rb   Thu May 12 13:41:42 2016
+++ .vagrant.d/gems/gems/vagrant-sshfs-1.1.0/lib/vagrant-sshfs/synced_folder.rb Thu May 12 13:43:16 2016
@@ -146,10 +146,12 @@

         # Try to include paths where sftp-server may live so
         # That we have a good chance of finding it
-        if Vagrant::Util::Platform.windows? and
-             Vagrant::Util::Platform.cygwin?
-          cygwin_root = Vagrant::Util::Platform.cygwin_windows_path('/')
-          ENV['PATH'] += ';' + cygwin_root + '\usr\sbin'
+        if Vagrant::Util::Platform.windows?
+          # Only for cygwin like shell, not needed for dos shell
+          if Vagrant::Util::Platform.cygwin?
+            cygwin_root = Vagrant::Util::Platform.cygwin_windows_path('/')
+            ENV['PATH'] += ';' + cygwin_root + '\usr\sbin'
+          end
         else
           ENV['PATH'] += ':/usr/libexec/openssh' # Linux (Red Hat Family)
           ENV['PATH'] += ':/usr/lib/openssh'     # Linux (Debian Family)

2 - Wrong SSH options passed on command line in "lib/vagrant-sshfs/cap/linux/sshfs_mount.rb#sshfs_slave_mount" :
ssh_opts get appended with "-o UserKnownHostsFile" and "-F " set to "/dev/null" in order to respectively disable SSH host key checking and not pick up options from user's config.
In the case of dos shell "/dev/null" needs to be replaced by "NUL".

Windows platform and not cygwin conditions needs to be introduced there.

Proposed patch :

diff U3B v1.1.0/lib/vagrant-sshfs/cap/linux/sshfs_mount.rb .vagrant.d/gems/gems/vagrant-sshfs-1.1.0/lib/vagrant-sshfs/cap/linux/sshfs_mount.rb
--- v1.1.0/lib/vagrant-sshfs/cap/linux/sshfs_mount.rb   Thu May 12 13:45:05 2016
+++ .vagrant.d/gems/gems/vagrant-sshfs-1.1.0/lib/vagrant-sshfs/cap/linux/sshfs_mount.rb Thu May 12 13:46:12 2016
@@ -99,8 +99,20 @@
           ssh_opts+= ' -o User=' + machine.ssh_info[:username]
           ssh_opts+= ' -o Port=' + machine.ssh_info[:port].to_s
           ssh_opts+= ' -o IdentityFile=' + machine.ssh_info[:private_key_path][0]
-          ssh_opts+= ' -o UserKnownHostsFile=/dev/null '
-          ssh_opts+= ' -F /dev/null ' # Don't pick up options from user's config
+          ssh_opts+= ' -o UserKnownHostsFile='
+          # On windows when not under cygwin shell (ie msdos shell), '/dev/null' needs to be 'NUL'
+          if Vagrant::Util::Platform.windows? and not Vagrant::Util::Platform.cygwin?
+            ssh_opts+= 'NUL '
+          else
+            ssh_opts+= '/dev/null '
+          end
+          ssh_opts+= ' -F ' # Don't pick up options from user's config
+          # On windows when not under cygwin shell (ie msdos shell), '/dev/null' needs to be 'NUL'
+          if Vagrant::Util::Platform.windows? and not Vagrant::Util::Platform.cygwin?
+            ssh_opts+= 'NUL '
+          else
+            ssh_opts+= '/dev/null '
+          end
           ssh_cmd = ssh_path + ssh_opts + ' ' + ssh_opts_append + ' ' + machine.ssh_info[:host]
           ssh_cmd+= ' "' + sshfs_cmd + '"'

With those patches, I've been able to mount synced folder with openssh 32 bit port for windows, under windows 7.
Sorry I can't make a PR at the moment.

traceback when mount fails on windows

Working with vagrant-sshfs 1.1.0 and vagrant 1.7.4 on windows. How to reproduce:

Have vagrant box already up (otherwise you will get an error from other part of vagrant):

vagrant up

Now add following line to your Vagrantfile

config.vm.synced_folder "/does/not/exist", "/foobar/", type: "sshfs"

Then vagrant sshfs:

$ vagrant.exe sshfs
==> default: Mounting SSHFS shared folders...
==> default: Mounting folder via SSHFS: /does/not/exist => /foobar
==> default: Checking Mount..
Warning: Permanently added '[127.0.0.1]:2200' (ECDSA) to the list of known hosts.
:/does/not/exist: No such file or directory
==> default: Checking Mount..
==> default: Checking Mount..
==> default: Checking Mount..
C:/Users/dustymabe/.vagrant.d/gems/gems/vagrant-sshfs-1.1.0/lib/vagrant-sshfs/cap/linux/sshfs_mount.rb:148:in `kill': No such process (Errno::ESRCH)
        from C:/Users/dustymabe/.vagrant.d/gems/gems/vagrant-sshfs-1.1.0/lib/vagrant-sshfs/cap/linux/sshfs_mount.rb:148:in `sshfs_slave_mount'
        from C:/Users/dustymabe/.vagrant.d/gems/gems/vagrant-sshfs-1.1.0/lib/vagrant-sshfs/cap/linux/sshfs_mount.rb:68:in `sshfs_mount_folder'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/capability_host.rb:111:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/capability_host.rb:111:in `capability'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/guest.rb:43:in `capability'
        from C:/Users/dustymabe/.vagrant.d/gems/gems/vagrant-sshfs-1.1.0/lib/vagrant-sshfs/synced_folder.rb:89:in `block in enable'
        from C:/Users/dustymabe/.vagrant.d/gems/gems/vagrant-sshfs-1.1.0/lib/vagrant-sshfs/synced_folder.rb:51:in `each'
        from C:/Users/dustymabe/.vagrant.d/gems/gems/vagrant-sshfs-1.1.0/lib/vagrant-sshfs/synced_folder.rb:51:in `enable'
        from C:/Users/dustymabe/.vagrant.d/gems/gems/vagrant-sshfs-1.1.0/lib/vagrant-sshfs/command.rb:40:in `block in execute'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/plugin/v2/command.rb:226:in `block in with_target_vms'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/plugin/v2/command.rb:220:in `each'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/plugin/v2/command.rb:220:in `with_target_vms'
        from C:/Users/dustymabe/.vagrant.d/gems/gems/vagrant-sshfs-1.1.0/lib/vagrant-sshfs/command.rb:26:in `execute'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/cli.rb:42:in `execute'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/environment.rb:301:in `cli'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.4/bin/vagrant:174:in `<main>'

Clarify documentation

Hey, first let me just say this plugin seems like a miracle solution to problems we've had configuring shared folders for a Vagrant VM running on AWS. (nfs proved impossible to get working cleanly, and rsync provided only 1-way synchronization) However, I'm not sure I understand correctly certain parts of the README, based on how they are presented, so maybe they could be enhanced.

  • zero, where it says "The idea is that if key1 is a key that is authorized to log in to the Vagrant host ,meaning there is an entry for key1 in the ~/.ssh/authorized_keys file, then you should be able to do the following to have a non-interactive experience with SSH keys and agent forwarding:" I know it's intuitive to someone familiar with ssh key generation and usage, but when referring to "the ~/.ssh/authorized_keys file" it's already gone over some of our heads.
    This file is not on my host. Is it in the guest? Did I have to do something to create this file in the guest? (Which I haven't yet because these things are supposed to happen before the guest exists, right? Before we do 'vagrant up') - these are the kind of dumb, panicky questions that go through the mind. Also, define "key1" - is this a public key, a private key, how was it created? Where is it - on the guest or host or in ~/.ssh. It's that tricky part of clarifying whether something is a conceptual entity, like a variable name, or a concrete example, like a pathname (on a guest or host).

  • First, there are example command lines to set up and add your key to the agent, which begin with '#'. Does this mean they need to be run as root, or is '#' just a shorthand for a generic default shell prompt?

  • Second, when talking about key1, what is it's relationship (if any) to private keys used to log into an AWS VM? I am accustomed to logging into a VM, once it has been started, with:

    ssh -i /path/to/myAwsKey.pem [email protected]

Can I use this same key as /path/to/key1? I guess not. It seems I need to use a public key. The key for AWS is a private key, and as it turns out, I have not generated a public key. Ah, the benefits of reading the linked background information on Key Generation and Key Forwarding :)

  • There is nothing wrong with how things are explained, but just to let you know, I wasn't sure whether ssh_username referred to the username on the host, or in the guest, and got it wrong the first time. Only after working backwards from the Vagrantfile configuration example (which is not a command line option? see below) did it come clear that it needs to be the host username ("The current user who is interacting with Vagrant")
  • Lastly, under Options, there are several "options that can be provided on the command line". But the only example of how to use them is not in the form of a command line, but rather a stanza from a Vagrantfile. It would be nice to either see example command lines showing some of the options in use, or else maybe change the wording that introduces the options to mention that they can be used also in a Vagrantfile.

I'll read more the links on ssh Key Generation and Key Forwarding which may help me finally understand when the README is referring to things-on-the-host vs. things-in-the-guest. I know only enough to get myself into trouble, as is obvious by what's written here.

But thanks for this potentially life-saving plugin, can't wait to get it working!

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

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.

'vagrant up' fails with '`windows_uninherit_handle': The parameter is incorrect. - SetHandleInformation (SystemCallError)'

A user is reporting this issue:

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
==> default: Machine booted and ready!
==> default: Registering box with vagrant-registration...
==> default: Checking for guest additions in VM...
    default: No guest additions were detected on the base box for this VM! Guest
    default: additions are required for forwarded ports, shared folders, host only
    default: networking, and more. If SSH fails on this machine, please install
    default: the guest additions and repackage the box to continue.
    default:
    default: This is not an error message; everything may continue to work properly,
    default: in which case you may ignore this message.
==> default: Configuring and enabling network interfaces...
==> default: Configuring proxy for Docker...
==> default: Configuring proxy environment variables...
==> default: Configuring proxy for Yum...
==> default: Copying TLS certificates to C:/cdk/cdk/components/rhel/rhel-ose/.vagrant/machines/default/virtualbox/docker
==> default: Mounting SSHFS shared folder...
==> default: Mounting folder via SSHFS: C:/Users/ianp => /c/Users/ianp
C:/Users/ianp/.vagrant.d/gems/gems/vagrant-sshfs-1.2.0/lib/vagrant-sshfs/cap/guest/linux/sshfs_forward_mount.rb:152:in `windows_uninherit_handle': The parameter is incorrect. - SetHandleInformation (SystemCallError)
        from C:/Users/ianp/.vagrant.d/gems/gems/vagrant-sshfs-1.2.0/lib/vagrant-sshfs/cap/guest/linux/sshfs_forward_mount.rb:122:in `block in windows_uninherit_handles'
        from C:/Users/ianp/.vagrant.d/gems/gems/vagrant-sshfs-1.2.0/lib/vagrant-sshfs/cap/guest/linux/sshfs_forward_mount.rb:118:in `each_object'
        from C:/Users/ianp/.vagrant.d/gems/gems/vagrant-sshfs-1.2.0/lib/vagrant-sshfs/cap/guest/linux/sshfs_forward_mount.rb:118:in `windows_uninherit_handles'
        from C:/Users/ianp/.vagrant.d/gems/gems/vagrant-sshfs-1.2.0/lib/vagrant-sshfs/cap/guest/linux/sshfs_forward_mount.rb:226:in `sshfs_slave_mount'
        from C:/Users/ianp/.vagrant.d/gems/gems/vagrant-sshfs-1.2.0/lib/vagrant-sshfs/cap/guest/linux/sshfs_forward_mount.rb:75:in `sshfs_forward_mount_folder'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/capability_host.rb:111:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/capability_host.rb:111:in `capability'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/guest.rb:43:in `capability'
        from C:/Users/ianp/.vagrant.d/gems/gems/vagrant-sshfs-1.2.0/lib/vagrant-sshfs/synced_folder/sshfs_forward_mount.rb:52:in `do_forward_mount'
        from C:/Users/ianp/.vagrant.d/gems/gems/vagrant-sshfs-1.2.0/lib/vagrant-sshfs/synced_folder.rb:47:in `block in enable'
        from C:/Users/ianp/.vagrant.d/gems/gems/vagrant-sshfs-1.2.0/lib/vagrant-sshfs/synced_folder.rb:42:in `each'
        from C:/Users/ianp/.vagrant.d/gems/gems/vagrant-sshfs-1.2.0/lib/vagrant-sshfs/synced_folder.rb:42:in `enable'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builtin/synced_folders.rb:93:in `block in call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builtin/synced_folders.rb:90:in `each'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builtin/synced_folders.rb:90:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builtin/synced_folder_cleanup.rb:28:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/plugins/synced_folders/nfs/action_cleanup.rb:19:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/plugins/providers/virtualbox/action/prepare_nfs_valid_ids.rb:12:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builtin/handle_forwarded_port_collisions.rb:49:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/plugins/providers/virtualbox/action/prepare_forwarded_port_collision_params.rb:30:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builtin/env_set.rb:19:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/Users/ianp/.vagrant.d/gems/gems/vagrant-proxyconf-1.5.2/lib/vagrant-proxyconf/action/only_once.rb:21:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/Users/ianp/.vagrant.d/gems/gems/vagrant-service-manager-1.3.3/lib/vagrant-service-manager/action/log_configured_service.rb:13:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builtin/provision.rb:80:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/plugins/providers/virtualbox/action/clear_forwarded_ports.rb:15:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/plugins/providers/virtualbox/action/set_name.rb:19:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/plugins/providers/virtualbox/action/clean_machine_folder.rb:17:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/plugins/providers/virtualbox/action/check_accessible.rb:18:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builder.rb:116:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/runner.rb:66:in `block in run'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/util/busy.rb:19:in `busy'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/runner.rb:66:in `run'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builtin/call.rb:53:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builder.rb:116:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/runner.rb:66:in `block in run'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/util/busy.rb:19:in `busy'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/runner.rb:66:in `run'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builtin/call.rb:53:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builder.rb:116:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/runner.rb:66:in `block in run'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/util/busy.rb:19:in `busy'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/runner.rb:66:in `run'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builtin/call.rb:53:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builtin/box_check_outdated.rb:36:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/plugins/providers/virtualbox/action/check_virtualbox.rb:17:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builder.rb:116:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/runner.rb:66:in `block in run'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/util/busy.rb:19:in `busy'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/runner.rb:66:in `run'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builtin/call.rb:53:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builder.rb:116:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/runner.rb:66:in `block in run'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/util/busy.rb:19:in `busy'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/runner.rb:66:in `run'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builtin/call.rb:53:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/plugins/providers/virtualbox/action/check_virtualbox.rb:17:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builder.rb:116:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/runner.rb:66:in `block in run'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/util/busy.rb:19:in `busy'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/runner.rb:66:in `run'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/machine.rb:224:in `action_raw'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/machine.rb:199:in `block in action'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:561:in `lock'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/machine.rb:185:in `call'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/machine.rb:185:in `action'
        from C:/cdk/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/batch_action.rb:82:in `block (2 levels) in run'

vagrant-sshfs fails on Archlinux

vagrant-sshfs on Archlinux as host fails:

==> default: Installing SSHFS client...
The 'sftp-server' executable file can't be found on the host machine but
is required for sshfs mounting to work. Please install the software and 
try again.

This is probably due to fact that sftp-server is located in /usr/lib/ssh/sftp-server

Apache access to mounted file

Is it possible to load web site by Apache after mount by your tool?

Because when I have been trying to use previous version (0.8) before you take the control over plugin development I have been receiving:


You don't have permission to access / on this server.
Apache/2.4.12 (Ubuntu) Server at xxx.yyy.com Port 443

Maybe in your it works?

Minor release for vagrant-sshfs

Can we do a minor release 1.1.1 for vagrant-sshfs, It has been a long time we had any release and some patches are already merged which have improvement from 1.1.0 release so I think it's better to do a minor release and include all those improvements.

Readme.md dead link + question.

Hey,
First, the file README.md link is dead, and more specifically in the sentence
"Sftp-server is usually we provided to the SSH server software so it already exists on Linux / Mac. On Windows you only need to install openssh via cygwin and you will get sftp-server."
Link with openssh leads to the "Error: could not open file: x86_64 / openssh / openssh-7.2p1-1".

Therefore, I have a question, I try to install openssh, but try to install Cygwin with openssh, does not work because the "vagrant" suggests that I do not have ssh installed.
But if you install OpenSSH from this page: "http://www.openssh.com/" then I get the error: "'sftp-server' executable file can not be found on the host machine but is required for sshfs mounting to work. ".

What can I do to make this plugin began to work?

Consider setting some selinux policy.

https://www.redhat.com/archives/container-tools/2016-April/msg00034.html

user is getting selinux denial when running docker inside a vagrant machine that has an sshfs shared mount. Steps to recreate:

 $ Add sshfs folder into Vagrantfile
   config.vm.synced_folder "/home/tnozicka/tmp/registry-data",
"/var/lib/registry", type: "sshfs"
 $ vagrant up
 $ vagrant ssh
 $ docker run -it --rm -v /var/lib/registry:/var/lib/registry centos:7
bash -c 'mkdir /var/lib/registry/new-dir'
(fails [and should] since /var/lib/registry does not have the right
SELinux context)

If fuse supported it we could do: sshfs -o context="system_u:object_r:svirt_sandbox_file_t:s0". This was added in: libfuse/libfuse@c52cafc but there is no fuse release yet with this commit in it.

As a workaround we could run this on client VMs to free things up for now:

setsebool -P virt_sandbox_use_fusefs 1

Detection of sftp-server is not always working

synced_folder.rb does something like this to add the sftp-server.exe executable to the PATH:

cygwin_root = Vagrant::Util::Platform.cygwin_windows_path('/')
ENV['PATH'] += ';' + cygwin_root + '\usr\sbin'

This does not always seem to work. I am getting:

The 'sftp-server' executable file can't be found on the host machine but
is required for sshfs mounting to work. Please install the software and
try again.

where sftp-server is in /user/sbin/ of a cygwin install which is rooted at C:\cygwin64.

hangs on windows host while booting centos guest after "Checking mount"

Hello,

I'm, trying to set up an sshfs mounted folder in a Centos 7 guest from a windows 7 host.

I configure it like this

...
  config.vm.synced_folder ".", "/vagrant", disabled: true
  config.vm.synced_folder "../..", "/windata_home", type: "sshfs"
...

(the first entry to disable the nonworking default mount, the second for the sshfs mount)

What I get is:

$ vagrant up
==> default: Attempting graceful shutdown of VM...
==> default: Checking if box 'centos/7' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
    default: No guest additions were detected on the base box for this VM! Guest
    default: additions are required for forwarded ports, shared folders, host only
    default: networking, and more. If SSH fails on this machine, please install
    default: the guest additions and repackage the box to continue.
    default:
    default: This is not an error message; everything may continue to work properly,
    default: in which case you may ignore this message.
==> default: Mounting SSHFS shared folder...
==> default: Mounting folder via SSHFS: C:/Users/myname/some/path => /windata
==> default: Checking Mount..

And from here ths boot hangs.
After waiting for ~10 minutes I entered CTRL-C, the machine was running, but the mountpoint exists and is empty.

Logfile vagrant_sshfs_sftp_server_stderr.txt is empty, vagrant_sshfs_ssh_stderr.txt just contains the warning Warning: Permanently added '[127.0.0.1]:2222' (ECDSA) to the list of known hosts.

sftp-server is installed via cygwin/openssh - before I did that, I ran into another error message, so as this went away after the installation I assume that's not the issue.

I'm not very proficient on windows, merely forced to work with it(and therefore setup a Linux VM to be able to actually do work), so I don't know much in terms of getting information from the Windows host and Virtualbox install to debug the situation.
If you need .

I searched for similar problems anywhere but did not find a solution or a hint on what to do to get the sshfs plugin working on windows, some people seem to have it running, though.

If theres anything I can add to this report to help solving it, please let me know.

Allow for overriding mount options

We should allow a user to append args as well as completely override the argument list given to sshfs. Add options for being able to do this.

Windows does not support the capability 'sshfs_forward_is_folder_mounted'

I tried using this plugin but got following error:

Vagrant attempted to execute the capability 'sshfs_forward_is_folder_mounted' on the detect guest OS 'windows', but the guest doesn't support that capability. This capability is required for your configuration of Vagrant. Please either reconfigure Vagrant to avoid this capability or fix the issue by creating the capability.

Arbitrary host reports missing path on `vagrant up`

I have a config line something like this:

config.vm.synced_folder "/path/on/other/host", "/path/on/guest", type: "sshfs", ssh_host: "other.host"

When I run vagrant up, I get:

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

vm:
* The host path of the shared folder is missing: /path/on/other/host

That path doesn't exist on the local host, only on the remote server that I'm trying to link up.

If I edit the config so this mount is disabled, I can start up; then I re-enable it and run vagrant sshfs --mount, and it's fine. So at least I know the specified paths are ok.

Is there a way to get this to play nice automatically on vagrant up?

(Using vagrant 1.8.7 and vagrant-sshfs 1.3.0)

lib/vagrant-sshfs/cap/linux/sshfs_mount.rb:in `spawn': No such file or directory

@dustymabe , I am trying to do vagrant up on my windows 10 Pro machine and using cmd.exe for this, It throws lib/vagrant-sshfs/cap/linux/sshfs_mount.rb:142:in `spawn': No such file or directory
Link to complete logs (https://gist.github.com/naina-verma/73297d18e8d1fa7cb5b1984d16ceb948)

I have tried this same Vagrantfile with cygwin setup it works like a charm but its not working with powershell and cmd prompt.

When i commented if Vagrant::Util::Platform.windows? till SHELL then it works fine

mount checking doesn't handle symlinks

On Atomic Host (ostree), /home -> /var/home. This causes the scraping of /proc/mounts (which has the path canonicalized via /sbin/mount) to fail to match.

Ultimately, what we really want to do is monitor the health of the sshfs process, and also get a "ready" notification from it. I think it might work to use a systemd unit Type=forking, since FUSE servers normally daemonize after success. See also https://bugzilla.redhat.com/show_bug.cgi?id=916780

Unclear error message when sshfs is not found

When trying to change the direction of mount to get client folder in host as per example

override.vm.synced_folder "~/...", "/home/vagrant/...", type: "sshfs", reverse: true

Getting the following error:

==> default: Mounting SSHFS shared folder...
==> default: mounting folder via SSHFS: guestpath:/home/vagrant/... => hostpath:~/...
==> default: Checking Mount..
==> default: Checking Mount..
==> default: Checking Mount..
==> default: Checking Mount..
==> default: Checking Mount..
==> default: Checking Mount..
==> default: Checking Mount..
Mounting SSHFS shared folder via reverse SSHFS mount failed. Please
look at the below output from from the processes that were run.

SSHFS command output:

sh: -o: command not found

Investigate sshfs slave mode (no need for authentication)

In libfuse/sshfs@b3af91b the slave mode was added to sshfs which basically allows sshfs to run without making an ssh connection and just accepting input from stdin and sending output to stdout. This means that you can run reverse sshfs mounts without having to authenticate back to the machine initiating the connection.

An example of using this is in the email the author sent to the list:

The attached patch implements a new mode of operation (slave mode) that
uses the stdin and stdout streams for comunication with the SFTP server.

That mode allows to mount a local file system through SSH into a remote
host as follows:

 $ dpipe /usr/lib/openssh/sftp-server = \
     ssh bar sshfs foo:/ /mnt/foo -o slave

And I am sure it can be (ab)used in several other ways :-)

Cheers,

- Salva

I have a working POC on this and am actively trying to get it polished and ready for merge.

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.