From a1d23b4e9763cdad6738bdce98728f23265b81f6 Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Thu, 22 Feb 2018 15:15:41 -0800 Subject: [PATCH 1/3] Allow system binary lookup to be disabled on windows for ssh Fixes #9433 --- lib/vagrant/util/ssh.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/vagrant/util/ssh.rb b/lib/vagrant/util/ssh.rb index 31ce31da5..8db4022a8 100644 --- a/lib/vagrant/util/ssh.rb +++ b/lib/vagrant/util/ssh.rb @@ -68,7 +68,10 @@ module Vagrant # include ssh, notably git, mingw and cygwin, but make sure ssh is in the path! # First try using the original path provided - ssh_path = Which.which("ssh", original_path: true) + if ENV["VAGRANT_PREFER_SYSTEM_BIN"] != "0" + ssh_path = Which.which("ssh", original_path: true) + end + # If we didn't find an ssh executable, see if we shipped one if !ssh_path ssh_path = Which.which("ssh") From 08e381c6b225e6115b9df47b26c9f82bebfaf436 Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Thu, 22 Feb 2018 15:22:32 -0800 Subject: [PATCH 2/3] Update prefer system bin env var docs --- website/source/docs/other/environmental-variables.html.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/website/source/docs/other/environmental-variables.html.md b/website/source/docs/other/environmental-variables.html.md index 844864078..ea14facec 100644 --- a/website/source/docs/other/environmental-variables.html.md +++ b/website/source/docs/other/environmental-variables.html.md @@ -185,9 +185,14 @@ required. ## `VAGRANT_PREFER_SYSTEM_BIN` +This currently only applies to Windows systems. + If this is set, Vagrant will prefer using utility executables (like `ssh` and `rsync`) from the local system instead of those vendored within the Vagrant installation. -This currently only applies to Windows systems. + +Vagrant will default to using a system provided `ssh` on windows by default. This +environment variable can also be used to disable that behavior to force Vagrant to +use the embedded `ssh` executable by setting it to `0`. ## `VAGRANT_SKIP_SUBPROCESS_JAILBREAK` From 93baadab750ddec82cbb1219d1bfbddd51c7b4c4 Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Wed, 4 Apr 2018 15:51:52 -0700 Subject: [PATCH 3/3] Remove some extra words in documentation --- website/source/docs/other/environmental-variables.html.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/source/docs/other/environmental-variables.html.md b/website/source/docs/other/environmental-variables.html.md index ea14facec..9226402e5 100644 --- a/website/source/docs/other/environmental-variables.html.md +++ b/website/source/docs/other/environmental-variables.html.md @@ -190,7 +190,7 @@ This currently only applies to Windows systems. If this is set, Vagrant will prefer using utility executables (like `ssh` and `rsync`) from the local system instead of those vendored within the Vagrant installation. -Vagrant will default to using a system provided `ssh` on windows by default. This +Vagrant will default to using a system provided `ssh` on Windows. This environment variable can also be used to disable that behavior to force Vagrant to use the embedded `ssh` executable by setting it to `0`.