Commit Graph

3696 Commits

Author SHA1 Message Date
Chris Roberts 5d7506afe3
Merge pull request #9676 from chrisroberts/e-win-file-perms
Update generated ssh private key file permissions on create
2018-04-10 14:56:28 -07:00
Chris Roberts 9731720773 Update generated ssh private key file permissions on create
This updates the permissions on the automatically generated private
key file to only be readable by the user. Includes support for file
permission modification on Windows platform.
2018-04-10 14:15:14 -07:00
Chris Roberts e4399a5724 Check Windows installed Vagrant version using --version
Using the --version flag keeps Vagrant from doing a full startup
and prevents the Vagrantfile from being parsed. This makes the
version check faster, and stops things like syntax errors within
a Vagrantfile from causing an unexpected error.

Fixes #9635
2018-04-10 08:05:23 -07:00
Chris Roberts f3c5e86f28
Merge pull request #9504 from zachflower/feature/vagrant-aliases
Vagrant aliases
2018-04-06 15:39:18 -07:00
Chris Roberts 8391abc63a Properly respect environment variable on checkpoint setup
The checkpoint update missed the environment variable check for
disabling the checks so this adds in the check and properly
disables checks when requested.
2018-04-05 10:47:28 -07:00
Chris Roberts a9223cf443 Add missing action autoloads
Fixes #9303
2018-04-04 16:27:06 -07:00
Chris Roberts ef4318eda2
Merge pull request #9653 from chrisroberts/f-powershell-detection
Make powershell version detection timeout configurable
2018-04-04 16:20:23 -07:00
Chris Roberts 8ac0fedbbb Suppress errors from invalid path encoding and carry on with best effort
Fixes #9299
2018-04-04 16:09:46 -07:00
Chris Roberts dd1d91f2c4
Merge pull request #9503 from chrisroberts/f-win-ssh-control
Fix ssh binary selection on windows
2018-04-04 16:05:17 -07:00
Chris Roberts 90fa705a6d Make powershell version detection timeout configurable
Allows custom configuration of the powershell timeout and bumps
the default timeout from 10 seconds to 30 seconds.

Fixes #9629
2018-04-04 16:02:11 -07:00
Chris Roberts dd438100b8
Merge pull request #9645 from chrisroberts/e-checkpoint-exceptions
Prevent exceptions from being raised by checkpoint
2018-04-04 15:58:47 -07:00
Chris Roberts a1d23b4e97 Allow system binary lookup to be disabled on windows for ssh
Fixes #9433
2018-04-04 15:50:52 -07:00
Chris Roberts 0139fe052b Only modify report_on_exception if the method is available 2018-04-02 12:11:37 -07:00
Chris Roberts 1dafc6b82e Prevent exceptions from being raised by checkpoint 2018-04-02 12:00:56 -07:00
Chris Roberts 30e7e81eab Make resolv-replace loading optional not automatic 2018-04-02 11:59:02 -07:00
Josh Soref 1a5ddea9f4 Spelling fixes
* account
* addresses
* administrator
* afterwards
* because
* bridgeable
* capabilities
* capability
* checksum
* configuration
* configuration for
* configure
* criteria
* delimited
* delivered
* derivatives
* description
* detect
* directory
* display
* downloading
* during
* electric
* enabling
* encountered
* equivalent
* executable
* executed
* hashicorp
* hypervisor
* hyphens
* implementation
* incorporate
* inheritance
* initialize
* instance
* instead
* interactions
* invocable
* machine
* maximum
* message
* mounting
* overridden
* overwrite
* paramiko
* preparing
* provides
* provisioning
* recursively
* requested
* resetting
* retryable
* running
* satisfied
* searching
* sometimes
* specified
* successfully
* synced folders
* unauthorized
* underlying
* userprofile
* vagrant
* vagrantfile
* variable
* various
* version
* virtual
* windows
2018-03-14 14:41:04 +00:00
Chris Roberts 8b7e501e50 Handle pathing in lxrun generated WSL instances better. 2018-02-28 10:08:01 -08:00
Chris Roberts 5f0d16a0e9 Include support for lxrun generated install
Adds compatibility support for legacy lxrun generated WSL installation
which is a single install at a known path location. This allows earlier
versions of Windows 10 to continue working as expected while still
supporting the recent updates allowing for multiple instances.
2018-02-28 10:08:01 -08:00
Sergii Bondarenko cc82f96618 #9298: Fix typos in comments to the code 2018-02-28 10:08:01 -08:00
Sergii Bondarenko 47a7f0817c #9298: Try to fallback to "powershell.exe" on WSL if "powershell" is not available 2018-02-28 10:08:01 -08:00
Sergii Bondarenko c5fdd47a56 #9298: Respect usernames with spaces 2018-02-28 10:08:01 -08:00
Sergii Bondarenko a1211caa9c #9298: Add debugging messages and explanations to the code 2018-02-28 10:08:01 -08:00
Sergii Bondarenko 62740e2240 #9298: Increase stability of determination of a current WSL instance 2018-02-28 10:08:01 -08:00
Sergii Bondarenko 72664eafec #9298: Use a single-word distro name 2018-02-28 10:08:01 -08:00
Sergii Bondarenko 476981874b #9298: Compute a correct path to the current WSL instance 2018-02-28 10:08:01 -08:00
Zachary Flower 3dbcdea691 allow the alias file path to be defined via an environment variable 2018-02-25 22:32:13 -07:00
Zachary Flower 42f72e1099 some light changes per PR feedback 2018-02-25 22:21:16 -07:00
Chris Roberts 00400c95d8
Merge pull request #9499 from chrisroberts/f-vc-urls
Update behavior of the authentication middleware
2018-02-23 09:28:04 -08:00
Chris Roberts b5b5f8870a
Merge pull request #9472 from chrisroberts/e-sensitive-length
Ignore empty strings registered as sensitive
2018-02-23 09:26:38 -08:00
Chris Roberts d6f4c75f40
Merge pull request #9344 from chrisroberts/e-dl-redirect-notify
Notify when host changes on redirect
2018-02-23 09:24:40 -08:00
Brian Cain 2475c62b20
Merge pull request #9502 from briancain/override-box-version
Use provider override for box_version if given
2018-02-22 12:58:24 -08:00
Brian Cain bba4978c13
Merge pull request #9470 from briancain/subprocess-frozen-windows-ps
Pass ruby block to capture stdout when determining PS version
2018-02-22 12:56:28 -08:00
Brian Cain d1c3deb234
(#9452) Use provider override for box_version if given
Prior to this commit if an override was given for a box version, it
would be ignored. This commit ensures that the box_version override is
used when specified in a Vagrantfile.
2018-02-22 10:43:52 -08:00
Brian Cain 3844a8e9f9
(#9056) Pass ruby block to capture stdout when determining PS version
Prior to this commit, the function used to determine the version of
Powershell would loop forever inside the Subprocess.execute function
because the process would never exit. This commit fixes that by passing
in a ruby block to capture the version from stdout instead of trying to
capture it from the returned process when it exits.
2018-02-22 10:04:16 -08:00
Chris Roberts ffa6d2810d Remove end of line matcher from progress regexp 2018-02-22 09:46:24 -08:00
Chris Roberts 04e05088ff Check location first. Grab final progress when multiple entries listed. 2018-02-21 19:46:12 -08:00
Chris Roberts 5e7e56f573 Fix redirect display and chosen location 2018-02-21 17:05:13 -08:00
Chris Roberts fa2f17c7ae Notify user when download host changes on redirect 2018-02-21 17:05:13 -08:00
Chris Roberts f2bf18e56b Update behavior of the authentication middleware
Always remap old hosts to target host when encountered. When custom
vagrant server is defined, warn when tokens may be attached and allow
time for user to cancel.

Fixes #9442
2018-02-21 17:03:38 -08:00
Zachary Flower f46ebf5240 throw an exception when whitespace is found within an alias keyword 2018-02-16 13:28:57 -07:00
Zachary Flower 57419fd12c quick fix to register method 2018-02-16 13:28:41 -07:00
Zachary Flower f16751a46d start working through tests 2018-02-16 13:00:39 -07:00
Chris Roberts 330ee2e1eb Ignore empty strings registered as sensitive
Fixes #9462
2018-02-15 17:02:34 -08:00
Brian Cain 8c15e1995b
Merge pull request #9459 from briancain/9428/master/update-systemd-check
Update systemd? check for guest inspection
2018-02-14 08:50:27 -08:00
Zachary Flower 17f13785ce move alias registration into a separate register() method 2018-02-10 18:08:37 -07:00
Zachary Flower bbb3cdaa9a vagrant aliases proof-of-concept 2018-02-10 17:58:18 -07:00
Brian Cain b77171c4fc
(#9428) Update systemd? check for guest inspection
Prior to this commit, the regex matcher used with grep to determine if a
system was using systemd? was failing on systems that did not exactly
match the old regex. This commit updates that communications test to use
a different method of determining if systemd is in use with the ps
command.
2018-02-08 15:50:59 -08:00
Brian Cain e8708232a5
(#9258) Exit if Hyper-V is enabled and VirtualBox provider is used
This commit adds a function on windows for the VirtualBox provider to
check if Hyper-V is enabled. If so, exit and display a warning to the
user that going forward will result in a system crash.
2018-02-08 11:20:41 -08:00
Chris Roberts 0f7f4b32b9
Merge pull request #9400 from chrisroberts/fall-back-to-system-ssh
Allow which to use original path. Prefer native ssh.
2018-01-26 07:21:33 -08:00
Chris Roberts 19d1cae92c Add log warning when native ssh executable is not found 2018-01-25 08:35:08 -08:00
Chris Roberts 570d5abb95 Prefer ssh executable found on original path 2018-01-25 08:23:14 -08:00
Chris Roberts 6f6e936451 Add option to Which utility for using original path on lookup 2018-01-25 08:23:14 -08:00
Brian Cain 343e252574 Favor system ssh binary over embedded ssh binary 2018-01-25 08:23:14 -08:00
Chris Roberts 522d503030 Use Ruby's resolver by default and allow replace to be disabled 2018-01-22 10:40:33 -08:00
Chris Roberts d2cad65053 Remove deprecated checkpoint integration 2018-01-16 15:21:22 -08:00
Chris Roberts a6d95016e6 Remove duplicate method. Add testing helper method to reset. 2018-01-16 15:19:44 -08:00
Chris Roberts 58f66ac8ce Add full checkpoint integration 2018-01-16 14:16:49 -08:00
Chris Roberts b0fc6a06a1
Merge pull request #9294 from chrisroberts/e-smb
SMB synced folders enhancements
2018-01-12 15:02:08 -08:00
Brian Cain 5bf75dcfb3
Merge pull request #9338 from chrisroberts/fix-ubuntu17-networking
Update Debian guest configure networks
2018-01-10 10:11:47 -08:00
Brian Cain 11ddd0136d
(#9044) Show all box providers in command outdated
Prior to this commit, when the `--global` flag was used with the
`vagrant box outdated` command, it would ignore box providers and not
inform the user of all outdated boxes. This commit fixes that by
displaying each box within the users environment, and includes the
provider of the box in the message.
2018-01-08 09:43:28 -08:00
Brian Cain c9e5a22bff (#9062) Deprecate :paranoid in favor of :verify_host_key
As of `net-ssh` version 4.2.0, the key :paranoid has been deprecated in
favor of using :verify_host_key. This commit updates Vagrants ssh config
to use the new key, and deprecates the use of :paranoid.
2018-01-05 10:02:45 -08:00
Chris Roberts 257441ed78 Log location of caller for missing configuration key requests 2018-01-03 09:41:45 -08:00
Chris Roberts 0dbd8538a0 Update return value documentation to actual behavior 2018-01-02 14:03:06 -08:00
Chris Roberts 81cbdae62a Make powershell error generalized 2017-12-21 09:55:19 -08:00
Chris Roberts 00fa50c296 SMB enhancements 2017-12-21 09:55:19 -08:00
Brian Cain f046482cfb [WIP] systemd networkd for debian guests 2017-12-20 16:42:51 -08:00
Brian Cain 0d7ad9f18f
Merge pull request #9275 from zachflower/validate_ip_addresses
Add a clean error message for invalid IP addresses
2017-12-15 11:22:03 -08:00
Chris Roberts 6223afcfa6
Merge pull request #9276 from chrisroberts/e-scrub
Scrub sensitive information prior to message output
2017-12-15 09:55:18 -08:00
Brian Cain 144c402f3b
Merge pull request #9252 from briancain/9055/master/pretty-print-nameerror-exceptions
Print more helpful error message for NameEror exceptions
2017-12-15 09:19:26 -08:00
Chris Roberts 6f663edad0 Scrub sensitive information prior to message output
This provides a simple wrapper around all output to
scrub any strings that have been registered as sensitive
before being output. Also included is a small change
to the initial debug output to only show vagrant specific
environment variables and not the full user environment.
2017-12-14 15:38:31 -08:00
Brian Cain 627babe15e (#9055) Print more helpful error message for NameEror exceptions
This commit adds some additional handling for when Vagrant loads config
files. Instead of showing the basic ruby exception, it prints a more
helpful error message and tries to direct the user to the line number
and file where the exception is occuring.
2017-12-14 15:31:48 -08:00
Zachary Flower 4a4183398b Add a clean error message for invalid IP addresses 2017-12-14 14:57:21 -07:00
Chris Roberts da42bfa8ac Provide optional timestamp on log output
Enable log message output to be prefixed with the date and time.
Include CLI flag to optionally enable `--timestamp` and a
convenience flag to enable debug logging with timestamps at
the same time `--debug-timestamp`.
2017-12-13 17:05:51 -08:00
Zachary Flower abb1149190 Raise an exception when the template cannot be found, and update tests accordingly 2017-11-17 12:20:03 -07:00
Brian Cain 401f1d521e
Merge pull request #9131 from bpietraga/fix-outputh-pathname-folder-creation
Fix --output path with specified folder
2017-11-15 09:55:32 -08:00
Bernard Pietraga b026be7cb3 Fix --output path with specified folder 2017-11-04 12:00:55 +01:00
Chris Roberts 9c2c83d781
Merge pull request #9135 from chrisroberts/e-ca-bundle
Use environment variable for CURL_CA_BUNDLE
2017-11-02 13:58:11 -07:00
Chris Roberts 06e3185eb1 Use `CURL_CA_BUNDLE` environment variable inplace of building path at runtime 2017-11-02 12:49:34 -07:00
Chris Roberts d422053fbc Check for vagrant.exe path before validating versions 2017-10-24 16:53:53 -07:00
Vít Ondruch 408bc4e6be Do not use deprecated API. 2017-10-23 10:57:36 -07:00
Vít Ondruch 7187e6f909 Use Integer instead of Fixnum for Ruby 2.4+ compatibility. 2017-10-23 10:57:36 -07:00
Brian Cain 49a569beba Merge pull request #8517 from vbrh-immalle/master
Update is_port_open.rb
2017-09-29 14:47:20 -07:00
Brian Cain ef040f6f82 Merge pull request #8685 from brianjmurrell/patch-1
Clear POSIXLY_CORRECT when using optparse
2017-09-29 14:12:17 -07:00
Brian Cain 3c9e1c9d84 (#8954) Split out cygwin path and ensure bin exists
This commit splits out the msys2 and cygwin path functions for
expanding a path with the cygpath tool. It also ensures that the tool
itself exists when the Which class is called so that it doesn't attempt
to escape slashes on nil.
2017-09-15 10:33:04 -07:00
Chris Roberts fcd1aee9bb Update linux host NFS capability
Add support for systemd detection and using correct method
for starting/checking host nfs service.
2017-09-06 09:54:06 -07:00
Brian Cain f0f60a1075 (#4666) Remove duplicate export folders before writing /etc/exports
Prior to this commit, if you set up multiple folders to export with NFS
on linux with the exact same hostpath, the template used to write
/etc/exports would end up placing the same path with the same IP in
/etc/exports and cause an error preventing the folders from being
properly mounted. This commit fixes that by first looking at which
folders are being exported and if there are any duplicates. If so,
remove the duplicates and only export 1 hostpath folder. If these
duplicate folders have differing nfs linux options, an exception must be
thrown because we cannot assume which options the user intended to
export with.
2017-09-05 16:05:14 -07:00
Brian Cain 085feb6526 (#8923) Quote path passed into IdentityFile for ssh command
Prior to this commit, a change to how the IdentityFile setting for the
ssh command broke when a path with a space was used. This commit fixes
that by quoting the path used to set the IdentityFile so that it uses
the full path instead of part of the path after the space.
2017-08-28 13:14:45 -07:00
Brian Cain b45ee4f455 (#6656) Format windows paths for ssh_config command
Prior to this commit, if the ssh-config command was invoked within
cygwin or msys2, it would show a regular windows style path for private
keys rather than a path that could be used within msys2 or cygwin. This
commit updates that behavior by converting all of the private key paths
to the proper msys2 or cygwin path if the platform is windows and the
command was invoked from one of those two shells.
2017-08-25 13:17:19 -07:00
Brian Cain ea59cfdb92 Merge pull request #8895 from briancain/8697/master/add-ssh-extra-opts
Introduce extra_args setting for ssh configs
2017-08-21 16:26:52 -07:00
Chris Roberts dfefa0883c Merge pull request #8902 from poma/patch-1
Fix #8901
2017-08-21 14:54:52 -07:00
Roman Semenov fc1e4f7533 Fix #8901 2017-08-18 18:58:45 +03:00
Brian Cain ffec0ff8d9 (#8697) Introduce extra_args setting for ssh configs
Prior to this commit, there was no way to add additional ssh arguments
within a Vagrantfile for a given vagrant machine. This commit introduces
a new option extra_args that allows users to pass in a single argument
or an array of flags that will be added onto the ssh command.
2017-08-17 09:02:20 -07:00
Chris Roberts ad5bc23088 Validate powershell prior to powershell use
Adds powershell validation to ensure powershell is available on
the PATH and checks powershell version to ensure meets the
defined minimum powershell version.
2017-07-31 15:05:41 -07:00
Chris Roberts da2c57d3d3 Make best effort to encode to UTF-8. On failure log error and retain original. 2017-07-24 17:04:25 -07:00
Tomoyuki Sakurai 35f83b6fed use '-o IdentityFile=' instead of '-i'
fixes ssh failure when path to the key contains '%'.
2017-07-14 10:34:57 -07:00
Chris Roberts da1b5765c7 Prevent URI parse errors when checking box name
Fixes #8758
2017-07-07 11:43:16 -07:00
Chris Roberts 4ce0ee1a7d Add debug output when detecting provider for environment. 2017-07-06 12:30:57 -07:00
Chris Roberts a55c169691 Merge pull request #8558 from agriffis/provider-priorities
RFC: VAGRANT_PREFERRED_PROVIDERS
2017-07-06 12:30:18 -07:00
Chris Roberts 954569d1fc Remove PATH based cygwin detection
Detecting cygwin via PATH contents can result in false positives
resulting in errors when using Vagrant on Windows outside of a
cygwin shell. Use environment based detection instead.
2017-07-03 14:40:27 -07:00
Chris Roberts f42279508d Reset plugin constraint on update if explicit version set 2017-06-28 07:24:32 -07:00
Chris Roberts a2ce948f91 Merge pull request #8725 from chrisroberts/fix/windows-shellout
Rebuild command and arguments before exec on Windows
2017-06-27 19:39:21 -07:00
Chris Roberts 911340442a Merge pull request #8692 from chrisroberts/update/gem-dep-constraints
Support strict enforcement of internal dependency constraints
2017-06-27 19:37:22 -07:00
Chris Roberts d1a589c59f Merge pull request #8724 from chrisroberts/fix/windows-cwd-check
Set encoding when reading/writing cwd file
2017-06-27 19:21:16 -07:00
Chris Roberts 73d85bd2f7 Support strict enforcement of internal dependency constraints 2017-06-27 19:20:20 -07:00
Chris Roberts f341945a29 Include debug logging of string conversions 2017-06-27 19:10:18 -07:00
Chris Roberts 85d5f11f62 Adjustments to handle plugin updates using proper constraints
If a user provides the gem version using an explicit version or a
constraint, the update action should honor that constraint and not
simply replace it with an unbound constraint.

This also removes system plugin specifications from being matched
and preferred which prevents updates and can result in unexpected
downgrades when running the update.
2017-06-27 19:05:30 -07:00
Chris Roberts 97715280c2 Deep merge plugin list with system plugins. Discard specifications correctly. 2017-06-27 19:05:30 -07:00
Chris Roberts 2575ed9dc2 Explicitly set encodings to prevent incompatible string comparisons 2017-06-26 20:00:43 -07:00
Chris Roberts f3daf5fad7 Rebuild command and arguments before exec on Windows
Flat command can cause issues with arguments. Creating new
string instances from arguments forces common encoding of
all strings used for exec.

Fixes #8690
2017-06-26 20:00:06 -07:00
Chris Roberts 5f955c3d38 Convert atlas references to vagrant cloud 2017-06-23 10:01:51 -07:00
Brian Cain 774e19b152 Disable loading identical Vagrantfile twice from same dir
Prior to this commit, if a user set the env var VAGRANT_HOME to be the
same directory where the project home is, Vagrant would load that file
twice and merge its config. This caused various provisioner and other
provider blocks to unexpectedly run twice. This commit updates the
config loader to look and see if the `:root` and `:home` procs are
equal, and if so, removes the `:home` object so that it isn't loaded and
duplicated. This commit however does not prevent duplicate loading if an
identical Vagrantfile exists in the home and project dir if those
locations are different.
2017-06-22 09:04:21 -07:00
Brian Cain 1b4d7848bc Fix vagrant_cwd warnings
Prior to this commit, if a user ran a vagrant command within a subdir,
it would warn about the cwd changing which is not actually the case.
This commit adds an additional check to see if vagrant is being invoked
within a subdirectory so that it doesn't warn the user.
2017-06-19 13:05:26 -07:00
Brian Cain b02f110cd8 (#7855) Introduce more ssh options for machines
This commit allows the user to configure two additional options that
were previously not configurable: Compression and DSAAuthentication.
Each config option is set as a boolean, and if left out of the config
will default to its previous behavior which is included and set to
"yes". If the user explicitly sets it to false, it will not be included
as an ssh option.
2017-06-15 16:29:53 -07:00
Brian J. Murrell 583fb3c787 Clear POSIXLY_CORRECT when using optparse
In case a user (perhaps inadvertently, or for particular reasons) has POSIXLY_CORRECT
set in their environment, make sure to clear it before calling optparse.optparse!() since
we don't really want POSIXLY_CORRECT argument parsing.
2017-06-14 12:57:10 -04:00
Brian Cain 378aae8782 Merge pull request #8653 from briancain/7188/master/unify-snapshot-restore-failures
Clean up vagrant snapshot restore/delete error messages
2017-06-07 11:47:38 -07:00
Brian Cain 43ae30cf9b Merge pull request #8651 from briancain/WARN-CWD-CHANGES
Warn about changes to cwd for every machine action
2017-06-07 11:46:57 -07:00
Brian Cain 87b7514603 (#7188) Clean up vagrant snapshot restore/delete error messages
This commit adds some better handling around the snapshot restore and
delete commands for the virtualbox provider. If a user attempts to restore from
a vm that does not exist, instead of exiting 0 it will raise an
exception saying the virtual machine has not been created yet.
Addtionally, if a user attempts to restore from a snapshot id that does
not exist, instead of printing a complicated exception from the
virtualbox cli tool, it prints a more useful error message telling the
user that the snapshot does not exist.
2017-06-07 09:12:20 -07:00
Brian Cain 79c7799fd9 Add basic unit test for CWD change warning 2017-06-06 08:38:03 -07:00
Fernando Seror 48b0e00368 Tests regarding warning whenever CWD changes 2017-06-05 13:25:30 -07:00
Fernando Seror 15871a481b Warn about changes to CWD on every machine action
Whenever the path where the machine was first created changes, Vagrant
will now show just one warning when an action is run on the machine.

The idea is that if a user copies the machine over to a different
directory with the idea of running two different machines, this warning
will now help the user determine how to make that work.
2017-06-05 13:25:30 -07:00
Brian Cain 1ade699936 (#6827) Introduce tty flag for ssh command execution
Prior to this commit, if a user ran the `vagrant ssh -c CMD` command, it
would not allow the user to configure pseudo-terminal allocation. This
commit introduces a -t flag for the `vagrant ssh` command which defaults
to true if not specified.
2017-06-02 17:32:02 -07:00
Brian Cain d0f1f39fa6 Merge pull request #8636 from briancain/7118/master/handle-invalid-box-names
Handle box names that are URLs
2017-05-31 16:16:38 -07:00
Brian Cain f1d08aa629 (#7118) Handle box names that are URLs
Prior to this commit, if a user set a URL for the name of a box, vagrant
would not warn the user about using box_url instead. This would lead to
some difficult user experiences around the various box commands due to
the box name being a full URL. This commit introduces a warning to the
user and lets them know to instead use box_url.
2017-05-31 15:25:05 -07:00
Brian Cain eadb0ac831 Raise exception if provider doesn't have snapshot capability
Prior to this commit, if a user attempted to use the `vagrant snapshot
save` or `vagrant snapshot list` commands on a vm whose provider did not
support snapshots, it would simply print a warning. This commit changes
that behavior by instead raising an error.
2017-05-26 15:22:25 -07:00
Brian Cain 6ddba4f7b3 (#7810) Enforce unique snapshot names
Prior to this commit, the vagrant snapshot plugin would save snapshots
with existing names which lead to duplicate snapshot names being saved.
This commit fixes that by checking to see if the given snapshot name
already exists and if so, fails telling the user the given snapshot name
already exists. If a user passes a --force flag, vagrant will first
delete the existing snapshot, and take a new one with the given name.
2017-05-25 16:28:17 -07:00
Chris Roberts 50dd832e63 Include `Which` within Util autoloads 2017-05-12 15:00:55 -07:00
Chris Roberts 6de7c9b445 Only convert path if windows access is granted 2017-05-12 14:14:11 -07:00
Chris Roberts 3c44ce9742 Support vbox provider within WSL rootfs. Make Windows access easier.
Enables proper setup of VMs started from within WSL rootfs paths. Updates
setup for Windows access when working within the WSL to auto-detect settings
instead of relying on user defined environment variables.
2017-05-12 13:11:53 -07:00
Chris Roberts 10cb43b917 Use helper module to silence warnings 2017-05-08 17:03:38 -07:00
Chris Roberts 328d1aa8af Disable verbose output accessing PATH 2017-05-08 15:22:23 -07:00
Chris Roberts e8e38a4007 Halt Vagrant if within WSL and attempting to operate out of rootfs 2017-05-08 15:21:39 -07:00
Chris Roberts 4df4f77bf6 Match WSL installed Vagrant with Windows installed Vagrant 2017-05-08 10:21:01 -07:00
Chris Roberts 83b0c87f52 Support running Vagrant within the Windows Subsystem for Linux 2017-05-08 10:21:01 -07:00
Aron Griffis 7c538b4504
Honor VAGRANT_PREFERRED_PROVIDERS in Environment#default_provider 2017-05-03 08:19:29 -04:00
Aron Griffis f256fc882f
Rewrite Environment#default_provider to be less confusing 2017-05-03 08:19:03 -04:00
Chris Roberts 78e2bb513c Merge pull request #8531 from chrisroberts/network/guest-rhel
guests/rhel: Update network configuration
2017-05-01 15:56:25 -07:00
John Rizzo 1dfc646fb3 Fixed admin test to verify that you are running in an elevated shell, not that you are in the administrators group since that is not required. 2017-05-01 15:42:06 -07:00
Chris Roberts 414184b76b guests/rhel: Update network configuration
Properly detects NetworkManager on guest as well as devices controlled
by NetworkManager. Provides configuration option to enable/disbale
NetworkManager control on devices.
2017-04-26 13:15:33 -07:00
Chris Roberts 2acded113c Retry SSH connection on Errno::ECONNABORTED
In some cases the SSH connection may be aborted while waiting
for setup. This includes aborted connections in the list of
applicable exceptions to retry on while waiting for the connection
to become available.

Fixes #8520
2017-04-25 13:38:24 -07:00
Hans Van Broeckhoven 81553263ab Update is_port_open.rb
Solves https://github.com/mitchellh/vagrant/issues/3031 (again)
2017-04-24 20:09:32 +02:00
Chris Roberts a8b2f78f59 Do not prefix Windows paths if UNC prefix already exists
While VirtualBox has commented that they do not support UNC remote
paths (but do for long paths) it seems that remote paths can work.
If user provides UNC path, allow it to be used as-is.

Fixes #7011
2017-04-20 16:33:38 -07:00
Chris Roberts 60187f2b17 Merge pull request #8503 from chrisroberts/fix/box-add-spaces
Unescape url to provide actual local path when adding box
2017-04-20 16:10:01 -07:00
Chris Roberts 7d1c77f523 Unescape url to provide actual local path when adding box
Fixes #6825
2017-04-20 15:37:08 -07:00
Chris Roberts 82ca8f8058 Support port checker methods which only accept the host port
When calling the port_checker an arity check is done to determine
if the helper accepts the host_ip and host_port or only the host_port.

Fixes #8423
2017-04-19 10:49:27 -07:00
Chris Roberts 4d0ecc14f7 Merge pull request #7797 from lukebakken/features/lrb/better-windows-admin-detection
Improve user permission detection on Windows
2017-04-17 14:37:43 -07:00
Chris Roberts 6aafe3255a Force wrappers to be generated to prevent invalid version parsing 2017-04-06 16:52:10 -07:00
Chris Roberts df069deac0 Validate plugin sources and report errors if detected. 2017-04-04 17:53:04 -07:00
Chris Roberts bfc2af4cf9 Always provide timeout on thread join to prevent deadlock errors 2017-03-27 12:58:39 -07:00
Chris Roberts 2f4181bad8 Merge pull request #8401 from chrisroberts/bundler/prevent-source-paths
Prevent adding local paths to RubyGems sources list
2017-03-23 09:46:08 -07:00
Chris Roberts 127d627218 Merge pull request #8400 from chrisroberts/plugins/warn-on-load-fail
Warn when failing to require plugin instead of hard failure
2017-03-23 09:44:32 -07:00
Chris Roberts 052ff53642 Merge pull request #8399 from chrisroberts/fix/port-check
Use 127.0.0.1 for host IP when unset and 0.0.0.0 is not available
2017-03-23 09:37:33 -07:00
Chris Roberts 154c3be0d4 Join command with given arguments before running exec
This resolves issues where directly passing arguments individually
to Kernel.exec causes encoding errors due to arguments being forced
command/shell encoding which is not always correct.
2017-03-23 09:19:26 -07:00
Chris Roberts c555e4b72f Remove subprocess command string re-encoding to default external 2017-03-23 09:16:27 -07:00
Chris Roberts 564ed7456d Warn when failing to require plugin instead of hard failure 2017-03-22 16:40:42 -07:00
Chris Roberts 354c1c2b51 Prevent adding local paths to RubyGems sources list 2017-03-22 16:36:42 -07:00
Chris Roberts 5cd95b684f Use 127.0.0.1 for host IP when unset and 0.0.0.0 is not available 2017-03-22 16:31:46 -07:00
Chris Roberts 72d0eb497d Isolate push deprecation to atlas strategy only 2017-03-21 15:08:17 -07:00
Chris Roberts eed7b859ca Fix provision action for provisioners set to never.
This updates the behavior of the provision action to never run a provisioner
that is specified to "never" run unless it has been explicitly requested. Also
adds test coverage to the provision action.
2017-03-13 13:53:31 -07:00
Chris Roberts 334e4f5d9d Convert type for other provider compatibility 2017-03-09 10:28:41 -08:00
Chris Roberts 9d1ec938ef Merge pull request #8341 from chrisroberts/enhancement/prerelease
Support spec prerelease matching
2017-03-07 15:02:17 -08:00
Chris Roberts c03ca851b1 Merge pull request #8327 from chrisroberts/plugins/local-path
Force path as preferred source on local install
2017-03-07 15:00:39 -08:00
Chris Roberts 7610ecfcba Allow prerelease matches on vagrant spec when running instance is prerelease 2017-03-07 10:36:35 -08:00
Chris Roberts abf38106c0 Add shared helper method to detect if running version is prerelease 2017-03-07 10:36:14 -08:00
Chris Roberts 009ca94167 Sort result of BoxCollection#all 2017-03-06 08:19:02 -08:00
Chris Roberts 10cd188688 Merge pull request #7956 from phyber/early_box_version_sort
Fix box sorting in box_collection
2017-03-03 16:32:01 -08:00
Chris Roberts 6d3ab39b27 Merge pull request #7035 from pravinchandar/4608
Fix for #4608: Support for port forwarding in an IP aliased environment
2017-03-03 15:57:04 -08:00
Chris Roberts 96204383c7 Force path as preferred source on local install 2017-03-03 09:12:44 -08:00
Chris Roberts 86af6501ed Remove installer set push from default source push 2017-02-24 08:02:22 -08:00
Chris Roberts e2acb5250a Add command deprecation helper module 2017-02-24 06:22:39 -08:00
Chris Roberts ccdccf06b5 Merge pull request #8194 from chrisroberts/fix/curl-credentials
Scrub credentials from box URLs
2017-02-23 13:51:47 -08:00
Chris Roberts 74438cc495 Merge pull request #8196 from chrisroberts/fix/expand-vagrantfile-path
Allow VAGRANT_DOTFILE_PATH to be expanded as expected.
2017-02-23 13:33:07 -08:00
Chris Roberts fe055d57da Merge pull request #8273 from chrisroberts/bundler/remote-source
Prefer given source if available when installing plugin
2017-02-22 11:48:19 -08:00
Chris Roberts 088829de9b Merge pull request #8270 from chrisroberts/enhancement/process-stop
Add new methods to Subprocess
2017-02-16 13:45:25 -08:00
Chris Roberts 70cacb27fa Prefer given source if available when installing plugin 2017-02-09 17:22:48 -08:00
Chris Roberts 6a4d41d0c9 Merge pull request #8252 from nsidc/fix-install-local-pre
Add gem_version to plugin_info for local installs
2017-02-09 09:48:54 -08:00
Chris Roberts e7e24ee853 Merge pull request #8248 from chrisroberts/fix/env-gems-path
Fix environment gems_path location
2017-02-08 14:18:41 -08:00
Chris Roberts 903428e569 Add Util::Subprocess#stop and Util::Subprocess#running? 2017-02-08 14:15:47 -08:00
Michael Brandt be63ace50f Add gem_version to plugin_info for local installs 2017-02-02 17:58:29 -07:00
Chris Roberts 0a6d985f89 Merge pull request #8191 from chrisroberts/plugins/ext-dir
Set base directory to parent directory within plugin specs
2017-02-01 13:12:27 -08:00
Chris Roberts 959bdada82 Fix environment gems_path location 2017-02-01 12:43:16 -08:00
Chris Roberts 25a2bdd279 Prevent generating environment variables with invalid empty names 2017-01-12 15:12:41 -08:00
Chris Roberts 832c62f2aa Allow VAGRANT_DOTFILE_PATH to be expanded as expected.
This allows custom paths that include special characters like `~`
to be properly expanded instead of resulting in joined root path
with special characters included.
2017-01-12 14:01:25 -08:00
Chris Roberts a055978d74 Scrub credentials from box URLs 2017-01-12 13:24:46 -08:00
Chris Roberts df00edf1a7 Set base directory to parent directory within plugin specs
This adjustment allows for extensions to be properly discovered after
plugin gem specifications have been activated.
2017-01-06 12:55:13 -08:00
Chris Roberts 23c41f4461 Merge pull request #7867 from bbrala/hyperv-package
Package Hyper-V boxes
2016-12-07 13:37:47 -08:00
Chris Roberts 23b4421309 Merge pull request #8094 from chrisroberts/bundler/env
Remove direct bundler usage within Env util
2016-12-07 06:56:01 -08:00
Chris Roberts c20e160295 Remove direct bundler usage within Env util 2016-12-07 06:00:56 -08:00
Chris Roberts c8d564e578 Prevent interaction when removing plugin gems 2016-12-06 07:07:52 -08:00
Chris Roberts 5b1b18d01a Merge pull request #8068 from chrisroberts/bundler/install-solution-act
Detect load failure within solution set and retry if found
2016-12-05 13:28:58 -08:00
Chris Roberts 3dccd82a39 Explicitly require name_tuple
This does not get automatically loaded before usage so ensure
it is properly loaded for plugin usage.
2016-12-05 09:35:02 -08:00
Chris Roberts ce35611c34 Detect load failure within solution set and retry if found
Installation solution sets in 2.2.5 can end up out of order (not seen
in 2.3.1) causing LoadErrors when the specification is in the solution
set during validation. This detects the missing spec within the solution
and if found will move spec to the start of the solution set and retry
solution activation.
2016-12-01 08:15:04 -08:00
Chris Roberts 9717432920 Add logger output when plugin loading is disabled 2016-11-28 16:55:38 -08:00
Chris Roberts f1e623976b Do not include default specifications within dependencies 2016-11-28 16:54:59 -08:00
Chris Roberts d87cf25ed2 Display original exception and backtraces in logger output 2016-11-28 07:48:16 -08:00
Chris Roberts 2cc4b82198 Only read default specifications directory when within bundler context 2016-11-22 08:26:43 -08:00
Chris Roberts a51949933f Always apply builtin constraints within dependency restrictions
Include detection of running context (within Bundler or not) and
load the "buitin" gems based on that context.
2016-11-22 07:53:19 -08:00
Chris Roberts 53b9f1747c Allow plugin_init_error to provide all information. Include final reset on specifications. 2016-11-17 16:40:51 -08:00
Chris Roberts 818f7acb7b Provide better internal consistency of installed plugin gems.
Refactors reusable actions into isolated methods. Supports installation/removal
without activation to prevent unintended conflicts during upgrades and cleanup.
Introduced custom resolver set to handle multiple installed versions of gems
which enables proper cleanup.
2016-11-16 13:26:13 -08:00
Chris Roberts 06e1b2f52c Include installed gem version plugin information. Clean after install and update. 2016-11-16 13:19:43 -08:00
Chris Roberts fb85bb1c7b Include plugin initialization error class 2016-11-16 13:18:35 -08:00
Chris Roberts 33c9d6183a Provide more log information about configured plugins 2016-11-16 13:17:38 -08:00
Chris Roberts e2d96f942f Provide nice error output when plugin initialization fails
Include extra logging during initialization to display error if encountered
and solution set prior to performing activations.
2016-11-15 15:50:39 -08:00
Chris Roberts 44d3aedc5b When bundler is in use, require `:plugins` group 2016-11-14 15:28:22 -08:00
Chris Roberts ac74774fcb Merge pull request #8000 from chrisroberts/plugins/updates
Plugin handling updates
2016-11-14 13:24:52 -08:00
Chris Roberts 0f720a4386 Merge pull request #7985 from chrisroberts/shell-provisioner/checksum
Add md5 and sha1 checksum support to Downloader.
2016-11-14 13:19:22 -08:00
Chris Roberts beffa70941 Downloader checksum output information and digester usage
Add more output information around type of checksum being validated.
Use builtin Digest#file to read target file for generation of hexdigest.
2016-11-14 10:22:25 -08:00
Chris Roberts 174fe65d66 Sort plugins by name when generating install list 2016-11-11 15:11:45 -08:00
Chris Roberts 3edd0b57e9 Add debug logging output to Bundler implementation 2016-11-11 15:08:59 -08:00
Chris Roberts bd3f0c442c Only use Gem sources that are provided 2016-11-11 14:50:20 -08:00
Chris Roberts 1691e3af58 Only install from defined sources unless install is local 2016-11-11 14:44:14 -08:00
Chris Roberts d8455c0a9a Add custom sources if not included 2016-11-11 14:33:26 -08:00
Chris Roberts 6e40d46c50 Fix up local gem plugin installation when not published remotely 2016-11-11 14:25:03 -08:00
Chris Roberts ea13988367 Properly support plugin auto-loading with logging information 2016-11-11 14:24:25 -08:00
Chris Roberts 1ed27faa9f Remove usage of $vagrant_bundler_runtime within enabled check 2016-11-11 14:23:55 -08:00
Chris Roberts da45ca707c Add md5 and sha1 checksum support to Downloader.
Allows checksum validation on downloaded files via Util::Downloader
using MD5 and/or SHA1 checksums. This also integrates checksum validation
support with the shell provisioner for downloaded remote files.
2016-11-09 16:05:39 -08:00
Chris Roberts 36d88ee268 Track installed gem version and display in startup logger information 2016-11-07 20:16:46 -08:00
Chris Roberts 1f5dd35d16 Remove bundler where no longer required 2016-11-07 20:00:38 -08:00
Chris Roberts 3fb5913af1 Update .init! to attempt repair if instructed 2016-11-07 18:48:51 -08:00
Chris Roberts d5c5561302 Allow disable of user plugins if repair command is requested 2016-11-07 18:48:51 -08:00
Chris Roberts 1fb4553d14 [core] Remove bundler usage for plugin management 2016-11-07 18:48:51 -08:00
David O'Rourke a33892e4df Maintain a version dir map in box_collection.
This is required since Gem::Version will mangle pre-release version
numbers.
To get around this, we keep a mapping of
`Gem::Version.to_s => versiondir.`

This allows us to properly sort by version when picking a box while
still returning pristine versiondirs when required.
2016-11-01 15:59:23 +00:00
David O'Rourke 7b89374dce Fix version sorting in box_collection.rb 2016-11-01 14:57:06 +00:00
Chris Roberts d1a778dbfb Include error handling when subprocess commands fail 2016-10-31 07:42:30 -07:00
Chris Roberts d490bb4b7a Include autoloader for StringBlockEditor 2016-10-29 17:53:45 -07:00
Chris Roberts c39b3fbb76 guests/openbsd: Check package installation after installing package
The `pkg_add` command will return `0` when a package requested for
installation is not found. This adds a validation check to ensure
the rsync package is actually installed on the guest.
2016-10-25 12:16:52 -07:00
Luke Bakken 52e98ffdfb Improve detection of admin and hyper-v admin rights via using SIDs and powershell 2016-10-13 14:22:08 -07:00
Chris Roberts 28f2ed56cf Merge pull request #7756 from alexoj/master
Fix Vagrant not prioritizing configured providers correctly
2016-10-07 17:14:54 -07:00
Björn Brala 6ed612e93b Move package_setup_files to general lib to minimize code duplication 2016-10-07 17:31:15 +02:00
Bjorn Brala 5877e8fe22 Sart refactor duplicate classes 2016-10-06 08:55:59 +02:00
Chris Roberts c3eb1e355b Merge pull request #7802 from chrisroberts/safe_exec/windows
[windows] Use subprocess for safe_exec on windows
2016-09-30 14:42:40 -07:00
Chris Roberts 977733790a Include debug notification when using subprocess 2016-09-30 12:16:53 -07:00
Chris Roberts 5872611d59 [windows] Use subprocess for safe_exec on windows 2016-09-15 13:08:58 -07:00
Jake Teton-Landis ceb69e6266 Allow closing a Vagrant::Util::Subprocess's STDIN
Previously, there was no way to close the STDIN stream of a subprocess,
so commands that read from stdin in a subprocess would hang forever,
such as `/bin/sh -s`. If one tried to close the stdin, the
IO.select() call in Subprocess#execute would raise an error for calling
select() on a closed IO.

Here's a concrete example of a command that needs to close STDIN to work
properly:

```ruby
script = SOME_VERY_LONG_STRING
command = %w(ssh foo.example.com /bin/sh -s foo bar)
result = ::Vagrant::Util::Subprocess.execute(*command) do |type, data_or_io|
  if type == :stdin
    data_or_io.write(script)
    data_or_io.write("\n")
    data_or_io.close
    next
  end

  puts "Remote: #{data_or_io}"
end
```
2016-09-04 16:45:38 -07:00
Alejandro Ojeda 50ca748b5c Fix Vagrant not prioritizing configured providers correctly
Fixes #7135: config.vm.provider not setting provider in multi-machine Vagrantfile
2016-08-25 03:34:23 +02:00
Chris Roberts 3abfbec5a6 Merge pull request #7623 from carlosefr/relative-dotfile-path
Support Vagrantfile-relative VAGRANT_DOTFILE_PATHs
2016-08-12 16:17:10 -07:00
Zack Train cb70749bd8 redux of pr 7398 for ssh-agent key fix 2016-08-11 11:48:10 -07:00
Seth Vargo 1702584d1e Merge pull request #6765 from PeterMosmans/windows-path-fix
Fix for #6761 (fixes incomplete #6598)
2016-08-08 11:59:26 -04:00
Carlos Rodrigues 218b697d5e This looks cleaner 2016-07-24 19:01:54 +01:00
Carlos Rodrigues 188a7dab0c Another try, without string substitution 2016-07-24 18:40:09 +01:00
Carlos Rodrigues 9ebc028745 Better checks, hopefully 2016-07-22 14:59:05 +01:00
Carlos Rodrigues 92104fec72 Use match instead of start_with 2016-07-22 14:39:44 +01:00
Carlos Rodrigues bf0486e659 Vagrantfile-relative VAGRANT_DOTFILE_PATH 2016-07-22 14:08:18 +01:00
Seth Vargo 36838d36b7
Fix failing test 2016-07-18 22:38:27 -04:00
Seth Vargo 7ed6bb5bef Merge pull request #7569 from rossi-fi/fix/master/7568
Use RFC- and cURL-friendly file:/// URI. Fixes #7568.
2016-07-18 22:20:03 -04:00
Seth Vargo 581568cf5a Merge pull request #7571 from rossi-fi/fix/master/7570
Strip leading slash left in front of drive letter by uri.path
2016-07-18 22:19:55 -04:00
Seth Vargo 2acaaff801
state_file: fsync and binmode 2016-07-18 21:59:18 -04:00
Seth Vargo ea17ad4530 Merge pull request #7550 from cgwalters/plugin-atomic-rewrite
plugin: Write out state file via create-new-then-rename
2016-07-18 21:58:23 -04:00
Seth Vargo 8f10dbca90 Merge pull request #7587 from alexmv/disabled-conflicts
Skip checking for conflicts on ports that are disabled
2016-07-18 21:55:33 -04:00
Seth Vargo 3b2ffae400
guests/bsd: Print a very descriptive error when mounting vbox folders
BSD-based guests do not support VirtualBox shared folders. This is a
common source of confusion in Vagrant. This new error clearly explains
that this is not a bug in Vagrant and provides instructions on how to 
disable them.
2016-07-18 21:12:58 -04:00
Seth Vargo 7e88266999
guests/linux: Properly escape and retry vbox shared folder mounting 2016-07-18 21:12:57 -04:00