Commit graph

1205 commits

Author SHA1 Message Date
Chris Roberts
6db640fb14 Adjust vbox hostonly config for ipv6
Check the type when an ipv6 address is being used. If the type does not
have a `6` suffix, append it.
2023-09-11 17:48:02 -07:00
Chris Roberts
f4142705ab
Merge pull request #13241 from lordgurke/fix-vagrant-13226-wrong-filename
Remove duplicate appending of "6" to network type
2023-09-11 17:45:34 -07:00
Chris Roberts
eb5aaed72d
Merge pull request #13259 from chrisroberts/remove-exps
Remove experimental checks
2023-09-11 17:31:58 -07:00
Chris Roberts
513be177d3 Remove experimental checks
Removes experimental checks on existing experimental features.
2023-09-08 14:15:34 -07:00
Chris Roberts
e958c6183a Adds initial HCP config support
Adds initial basic support for HCP based configuration in vagrant-go.
The initalization process has been updated to remove Vagrantfile parsing
from the client, moving it to the runner using init jobs for the basis
and the project (if there is one). Detection is done on the file based
on extension for Ruby based parsing or HCP based parsing.

Current HCP parsing is extremely simple and currently just a base to
build off. Config components will be able to implement an `Init`
function to handle receiving configuration data from a non-native source
file. This will be extended to include a default approach for injecting
defined data in the future.

Some cleanup was done in the state around validations. Some logging
adjustments were applied on the Ruby side for better behavior
consistency.

VirtualBox provider now caches locale detection to prevent multiple
checks every time the driver is initialized.
2023-09-07 17:26:10 -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
Max
8ecfe32021
Remove duplicate appending of "6" to network type
To distinct between IPv4 and IPv6 configuration, a "6" was added to the network configuration type if an IPv6 address should be configured. This is now duplicate, as with pull 13024 the same thing is already done prior, thus leading to a duplicate "6" at the end of the network config type, i.e. "static66".
2023-07-30 17:33:58 +02:00
Allison Larson
ceddf2e6cd
Merge pull request #13153 from allisonlarson/docker_bridge_ip_update
Docker: Attempt using docker command for bridge ip
2023-05-19 09:14:04 -07:00
Allison Larson
12b73a46b2 docker: attempt using docker command for bridge ip
Don't rely on `/sbin/ip` to fetch the docker bridge ip address, instead
first attempt to use the docker command to fetch it. If it fails, fall
back to previous behavior.
2023-05-18 10:54:38 -07:00
Chris Roberts
8e98c5ff1c Update locale preference for the virtualbox driver
Update the locale preference list to prefer UTF-8 variations of `C` when
available.
2023-05-17 11:59:05 -07:00
Chris Roberts
d53d8e61bc Fix LANG value used for VirtualBox driver
The VirtualBox driver sets the LANG env var to prevent localized output
being returned when executing CLI commands. If the `locale` command is
present, do a best effort lookup to determine the properly value to use
for the LANG environment variable.
2023-05-15 11:01:29 -07:00
Allison Larson
ec16a00560 docker: sync folders before preparing nfs settings
Re-order the `SyncedFolders` to occur before `PrepareNFSSettings`, ensuring that
the host & machine ips are set appropriately.
2023-05-12 11:04:05 -07:00
Allison Larson
10e45f1df1 Ignore inactive docker containers when assigning ports
Checks to make sure that a docker container is running before determining
whether or not the port is in use. This prevents the a port on an inactive
container from being treated as if it is use.

Fixes https://github.com/hashicorp/vagrant/issues/13110
2023-05-09 16:44:58 -07:00
Sophia Castellarin
9efc3521d1
Merge pull request #13090 from soapy1/remove-virtualbox-hyperv-check
Removes check for hyperv being enabled when verifying virtualbox is usable on windows.
2023-02-21 17:17:51 -08:00
sophia
38e6e86d80 Removes check for hyperv being enabled when verifying virtualbox
is usable on windows. Virtualbox has supported running with hyperv
since version 6.0.0 https://www.virtualbox.org/wiki/Changelog-6.0.
(Virtualbox 6.0 is currently EOL) So, this check is no longer
required.
2023-02-17 11:38:28 -08:00
sophia
2e7116cfc3 Log ignoring of EnhancedSessionTransportType for debugging 2023-02-14 15:49:47 -08:00
RudiMT
431d91593a Output message in json
Would limit new console output to systems that do not already support EnhancedSessionTransportType. The vast majority of systems supports it and should not print additional messages.
2023-02-14 15:49:46 -08:00
RudiMT
ba562f273b Add check if EnhancedSessionTransportType is supported by the current version of HyperV 2023-02-14 15:49:46 -08:00
RudiMT
e14aa1e430 Formatting as in main 2023-02-14 15:49:46 -08:00
RudiMT
0867fbd9d8 Add check if EnhancedSessionTransportType is supported by the current version of HyperV 2023-02-14 15:49:46 -08:00
sophia
28574348b9 Read only machine port forward info
In the VM config file port forward information is captured in the
Snapshot defition as well as the VM definition. This causes duplicates
in port forward entries if the file is queried for all available
network adapters. Querying the VM config file for the the Network
Adapters only part of the Machine definition resolves this and
yields the most up to date port forward info.
2023-01-12 12:02:00 -08:00
Chris Roberts
516ac4b0ab Set address type when not provided
When an address is provided and the type has not been explicitly
provided, parse the address and automatically set the type.
2022-12-09 13:22:37 -08:00
Chris Roberts
2eb393aaee
Merge pull request #13004 from chrisroberts/vbox-hostnet-dhcp
VirtualBox hostnet addressing
2022-12-08 11:33:05 -08:00
Chris Roberts
5cbf66b93c Update log output to warn 2022-12-08 11:14:46 -08:00
Chris Roberts
2696c3d74d Import the security module for access check
The 7.3.0 release of powershell cleaned up some stray things that
should require the import of the security module to be available.
It causes issues with pre-7.3 versions of powershell that attempt
to load the newer module so we run a check and restrict the module
version based on the powershell version.
2022-11-22 11:05:18 -08:00
Chris Roberts
32aef6c48c Rescue address errors and adjust host address
Rescue any address errors logging them and ignoring the address. Update
how the host address is determined based on the network configuration.
Host address will be either the lowest address assignable via dhcp
configuration or first address available within the configured subnet.
2022-11-21 14:07:29 -08:00
Chris Roberts
8549450cff
Merge pull request #12994 from chrisroberts/vbox-locale
Force LANG when executing commands
2022-11-14 13:27:48 -08:00
Chris Roberts
d8de3016ea
Merge pull request #12992 from chrisroberts/vbox-networks-nfs
VirtualBox read networks support with hostonlynets
2022-11-14 12:14:03 -08:00
Chris Roberts
f7e5a9d199 Force LANG when executing commands
This forces the LANG enviroment variable to be set to `"C"` when
executing VBoxManage commands. Doing this prevents localization of
output which causes failures of the VirtualBox driver when scanning
for information.
2022-11-14 10:45:47 -08:00
Chris Roberts
9e4047533d Customize #read_network_interfaces for hostonlynetworks
Adds an override for the #read_network_interfaces when hostonlynetworks
are in use to properly identify the hostonly network information from
the guest. This also adjusts the IP provided for the network to be
the first in the subnet.
2022-11-14 10:45:33 -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
c0c4b80dcb Pass all options to host only network creation 2022-11-03 17:20:54 -07:00
Chris Roberts
c8a71882d3 Disable hostonly ip validation for vbox 7 on darwin 2022-11-03 17:18:10 -07:00
Chris Roberts
3604bacc19 Update virtualbox driver for hostonlynets support 2022-11-03 17:18:10 -07:00
Chris Roberts
60ec1943ea Fix file formatting 2022-11-03 11:55:50 -07:00
Chris Roberts
e7e1badbdc Add support for VirtualBox 7.0 2022-10-14 15:58:00 -07:00
Paul Hinze
8d46b09a11
Fix Docker machines being lost in go side
By pruning machines that are in "unknown" status after each operation,
the Go code path exposed the fact that the Docker provider was not
updating the machine index during an "up" - leaving the state as
"unknown".

This is basically a bug within the Docker provider, so I think it's okay
to update the plugin code to correct this rather than working around the
issue in Go.

All we need to do is call `machine.state` instead of reaching through to
`machine.provider.state` while waiting for the container to be started.
That causes the extra logic for updating the machine index in
`machine.state` to fire.
2022-07-13 14:04:32 -05:00
Paul Hinze
eacb798a71
Fix action hooks running twice in destroy_on_error scenarios
The "destroy_on_error" functionality for `vagrant up` is implemented in
the `recover()` action chain, and works by firing off a destroy action
from inside that chain.

This is all well and good, but it copies its existing `env` which has
had `action_name` set for the up action. This was causing action_hooks
for up actions to attach to this destroy action stack.

Setting the action_name explicitly in the env before firing the runner
should correct the behavior. I'm not sure if raw_action_name is used
anywhere but I figured it was better to be consistent vs conservative in
what we change.
2022-04-25 12:26:56 -05:00
sophia
1aabc7c4b5
Add mapper for a Class to String 2022-04-25 12:26:12 -05:00
sophia
04a6f762af
Make synced folder mapping work 2022-04-25 12:26:11 -05:00
sophia
e86dc5958a
Clean up debugging cruft 2022-04-25 12:24:09 -05:00
sophia
5ecb1cdc26
Get/set machine id 2022-04-25 12:24:09 -05:00
Chris Roberts
ac92fd8e1d Access provider driver through machine for version check
Updates the VirtualBox version check for network range validation
    to access the driver via the machine instances provider within the
    passed env.
2021-11-03 09:32:41 -07:00
Chris Roberts
2f9a0ac253 Adjust default range 2021-10-29 09:43:47 -07:00
Chris Roberts
b23095eac5 Remove freeze on version to resolve comparison 2021-10-29 08:47:43 -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
Chris Roberts
a02b9b6b2f Use detected device when iterating over available addresses 2021-07-27 08:07:39 -07:00
Chris Roberts
84d3a5fe47 Update compose tests to pass fully through Util::Subprocess 2021-07-12 09:54:56 -07:00
sophia
04977677f1 Pass in docker command opts as a map 2021-07-08 12:15:06 -05:00
Chris Roberts
de8da71c41
Merge pull request #12431 from chrisroberts/ui-tests
Update tests to use real UI instance
2021-06-29 12:47:26 -07:00