303 Commits

Author SHA1 Message Date
Chris Roberts
96f2039bcd Use ssh key type defined by configuration
If key type is defined as :auto, detect best key type to use. If no
acceptable key type is detected as supported by the server, raise an
error. If unable to determine supported key types from the server,
fallback to original behavior of rsa type key.

If key type is defined as custom value, use that type if the server
supports it, or if the supported types cannot be read. Otherwise, raise
an error informing the user that the key type is not supported.
2024-01-10 11:52:46 -08:00
Chris Roberts
51adb12547 Add architecture support for boxes
Introduce support for handling box architecture. Adds a new
`box_architecture` setting that defaults to `:auto` which will perform
automatic detection of the host system, but can be overridden with a
custom value. Can also be set to `nil` which will result in it fetching
the box flagged with the default architecture within the metadata.

Box collection has been modified to allow existing boxes already
downloaded and unpacked to still function as expected when architecture
information is not available.
2023-09-14 16:15:03 -07:00
hashicorp-copywrite[bot]
36a312ee26
add missing license headers and update copyright file headers to BUS-1.1 2023-08-10 21:53:25 +01:00
sophia
b91a5d5576 Add file mutex util module 2023-01-13 12:00:46 -08:00
sophia
bc03f21758 Add a file mutex when downloading box files.
Box's are global to Vagrant. Multiple Vagrant process can all
access the box directory for both downloading and extracting boxes.
A file mutex will ensure that mulitple Vagrant process will not
trample eachother if they are trying to download the same box.
2023-01-12 15:30:06 -08:00
Chris Roberts
cbddfbd028 Handle missing machine folder value
If the value of the machine folder can not be found in the
system properties, report a user friendly error message and
include relevant information in the logs for debugging.
2022-11-14 10:45:10 -08:00
Chris Roberts
e7e1badbdc Add support for VirtualBox 7.0 2022-10-14 15:58:00 -07:00
Chris Roberts
7d7ad89ac5 Provide helpful error message on invalid version
When a box version (or constraint) is provided with an invalid
format, rescue the error and return a customized error with
information for the user explaining the problem.
2022-09-21 11:21:24 -07:00
sophia
ccc232914d Raise error if required metadata.json box fields are not present 2022-09-14 13:01:31 -04:00
sophia
d708bab84a Add error message for errors originating from a remote 2022-05-13 17:14:50 -05:00
Chris Roberts
6810c7b4bb Add version capability to darwin host plugin 2021-11-02 16:43:26 -07:00
Chris Roberts
ae7639ec23 Validate VirtualBox hostonly network range
VirtualBox introduced a restriction on the valid range for hostonly
    networks. When using a version of VirtualBox which includes this
    restriction a check is performed on the defined IP address to validate
    it is within either the default range (as defined in the VirtualBox
    documentation) or the values defined in the network configuration
    file.
2021-10-28 17:12:15 -07:00
grahamhub
bfa73b06c6 cli: implement --info flag for package #12191 2021-04-15 00:28:41 -05:00
Chris Roberts
2d019cb608 Provide specialized messages on plugin install failure if possible
Inspect the error message received when failing to install a
    plugin. If it's something we can determine the cause, send
    back a cleaner error message to the user on how to resolve.
2021-03-08 15:57:13 -08:00
Chris Roberts
5003bb6e15 Updates to address all Ruby deprecations and warnings
This includes updates for resolving all warnings provided by Ruby
for deprecations and/or removed methods. It also enables support
for Ruby 2.7 in the specification constraint as all 2.7 related
warnings are resolved with this changeset.
2020-08-10 13:05:41 -07:00
Sophia Castellarin
bedd141381
Merge pull request #11721 from jbonhag/f/ssh-nil-exit-status
Raise an error on nil exit status
2020-08-07 10:55:58 -05:00
sophia
a1d429a4e8 Raise more descriptive error if cloud init fails 2020-08-06 15:47:36 -05:00
sophia
0a5a940e58 Raise an error if cloud-init is not found on guest 2020-07-29 12:50:50 -05:00
Jeff Bonhag
ff9f9c40e8
Differentiate between controller "not found" errors
This commit adds a new error message to be raised if a VM has no
supported storage controllers. This lets us differentiate between two
different "controller not found" scenarios:

1. If we are looking for a controller that we're expecting to find (i.e.
one that was recorded in the disk metadata file)
2. If we are poking around for the *best* controller to use in a
configuration task
2020-07-09 15:10:50 -04:00
Jeff Bonhag
c9bdcb6839
Error on unsupported storage controller type 2020-07-09 15:07:49 -04:00
Jeff Bonhag
1e6eb0d636
Raise an error if primary disk can't be found 2020-07-09 15:07:49 -04:00
Jeff Bonhag
3a515cc7d6
Error if the required storage controller not found
This commit adds a new error type that can be raised whenever a storage
controller of the required type is not found. This indicates that a user
needs to either add the storage controller manually or change their disk
configuration.

It also removes the last hardcoded instance of "SATA Controller" as a
default argument.
2020-07-09 15:07:48 -04:00
Sophia Castellarin
02ef62dcff
Merge pull request #11694 from soapy1/host-cap-build-iso
Build iso for Darwin host
2020-07-07 10:29:52 -05:00
Brian Cain
42718437ab
Initial commit of cloud_init setup action
This commit introduces a new builtin action for preparing and
configuring guests cloud_init configs as an iso to be attached later by
the disk actions
2020-06-29 11:00:16 -07:00
Jeff Bonhag
9af48e5764
Raise an error on nil exit status
This commit changes the SSH communicator to raise an error if Vagrant
doesn't receive an exit status from an SSH command, for example if the
command is terminated by the OOM-killer.
2020-06-26 13:25:59 -04:00
sophia
e1d104a8e3 Build iso for Darwin host 2020-06-15 09:55:15 -05:00
Chris Roberts
5195bee9ea Check if plugin install provides specification
During a plugin install, if the plugin is already installed and
activated, no specification will be returned as there was nothing
new installed. In this situation, look for the requested plugin
within the activated specifications. If it is found, then proceed
since the plugin is installed. If it is not found, return an error.
2020-05-06 15:51:37 -07:00
sophia
538ee948ee Choose netplan renderer based on network config and available tools 2020-04-10 17:17:04 -04:00
Jeff Bonhag
6d228becf9
Raise an error if host IP is not found 2020-03-19 17:16:21 -04:00
Chris Roberts
21e5913cef Explicitly activate vagrant specification when not activated 2020-03-10 15:08:56 -07:00
Brian Cain
2176216bf8
Add error for when disks defined are greater than the max limit 2020-02-10 12:58:11 -08:00
Jeff Bonhag
d7a5f74897
Fixes #11128: Error if machine folder inaccessible (#11239)
This commit catches the Errno::EPERM raised by the operating system if
the machine folder is inaccessible and displays it as a more friendly
error message.

This can be an issue on macOS Catalina if virtual machine files are kept
in a special directory (Documents/Downloads/Desktop) that Vagrant's
embedded Ruby is not allowed to access.
2019-12-17 12:41:12 -05:00
Brian Cain
16b5ad74ca
Handle command triggers with run_remote options
This commit adds some handling around when a machine does not exist at
all but a trigger was defined with a run_remote option
2019-02-01 13:34:15 -08:00
Chris Roberts
818d1d97ae Update rsync auto post command error handling to be more generic
Rescue and re-wrap any errors encountered when running the post
rsync capability. Rescue this exception type and notify of error
when encountered by rsync auto. Include test coverage.
2018-12-18 09:50:21 -08:00
hieptranquoc
480e992ea1 @ #10460 | vagrant rsync should restart when rsync find chown command error 2018-12-18 09:49:44 -08:00
Brian Cain
6d4d9b9304
Fixes #10432: Validate that provider file exists prior to upload
Prior to this commit, Vagrant would attempt to path expand a file that
didn't exist if it was left out of the passed in arguments and no
`--url` was used for external box uploading. This commit fixes that by
adding some additional validation for the passed in box file.
2018-11-30 14:13:45 -08:00
Brian Cain
b1b829f69d
Fix missing end in errors class 2018-10-12 09:16:36 -07:00
Brian Cain
83bd592e30
Introduce curl helper and uploader classes
This commit introduces a new uploader class for uploading files and
splits up some commonly used functionality between it and the downloader
class into a curl helper library.
2018-10-12 09:07:10 -07:00
Chris Roberts
48d358adcb Add winrm and upload commands 2018-10-04 13:26:41 -07:00
Chris Roberts
40f4e6f67e Vagrant Environment isolated plugins
Adds support for plugins isolated to a specific `Vagrant::Environment`
which can be managed by the vagrant plugin command using the the
--local flag.
2018-07-17 14:49:41 -07:00
Brian Cain
52c3dcc70e
(#9997) Catch and allow for non-standard exit codes
Prior to this commit, the run trigger option wouldn't catch for failures
outside of the #Subprocess.execute raising exceptions. This commit fixes
that by inspecting the exit code result of the subprocess and using the
new `exit_codes` option to determine how to move forward with the
trigger.
2018-07-09 15:56:26 -07:00
Brian Cain
5ca382727d
Raise error if argument is provided with --all-global flag
This commit raises an error if additional arguments are provided to the
suspend command when the `--all-global` flag is used.
2018-05-11 15:43:14 -07:00
Stefan Scherer
f14e8bcbf2
Allow other providers in WSL 2018-05-02 22:36:17 +02:00
Brian Cain
fd3d78746c
(#9717) Improve messaging around not finding requested provider
This commit adds a bit more helpful messaging for the user when asking
for a provider that might not exist or does not follow the correct
casing. If it can find a match on a provider it knows about, it will
suggest it.
2018-04-26 09:43:58 -07:00
Brian Cain
0054c5aae6
Raise error if incomplete trigger block is defined 2018-04-20 10:51:38 -07:00
Brian Cain
600557ff24
Move strings to translation file 2018-04-20 10:51:38 -07:00
Chris Roberts
f3c5e86f28
Merge pull request #9504 from zachflower/feature/vagrant-aliases
Vagrant aliases
2018-04-06 15:39:18 -07:00
Sergii Bondarenko
62740e2240 #9298: Increase stability of determination of a current WSL instance 2018-02-28 10:08:01 -08:00
Zachary Flower
f46ebf5240 throw an exception when whitespace is found within an alias keyword 2018-02-16 13:28:57 -07: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