67 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
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
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
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
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
sophia
5d3c37126f Get default dhcp ip from a matching host ip 2021-02-24 15:53:27 -06:00
Chris Roberts
d589aa9f81 Update default_nic_type implementation within VirtualBox provider
In some cases the E1000 NIC type is the only acceptable value. Since
defaulting causes breakages to existing boxes, leave the default value
as `nil` but check the VirtualBox version in use and print warning to
user if VirtualBox version is vulnerable and E1000 NIC types are
configured for use within defined network adapters.
2018-11-26 15:58:45 -08:00
Chris Roberts
d8bbc5ce09 Add support for specifying the default NIC type used for guest adapters
Provides support for defining the NIC type used for any guest adapter
which does not define an adapter type. This is defaulted to "virtio".
2018-11-07 15:53:46 -08:00
Chris Roberts
5add5c24fe Show formatted error message with address and netmask 2018-11-02 15:03:22 -07:00
Mikhail Zholobov
d9d081199c
action/network: Validate IP settings, show human-readable error 2018-11-02 22:29:19 +01:00
Mikhail Zholobov
a02aaa3195
action/network: Refactor the calculation of host-only adapter IP and DHCP settings 2018-11-02 22:28:49 +01:00
Brian Cain
4db3d49157
Improve network collision error message
This commit provides a bit more information when a non-hostonly network
collides with a host network.
2018-04-12 14:16:13 -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
51232f9a03 When matching hostonly adapter name, force common types
Force a string type for comparison to prevent false positives when
the name is unset (resulting in a nil value).
2018-03-09 14:15:31 -08:00
eyJhb
12a6832151 Fixed hostonly matching not respecting :name argument 2017-12-25 20:49:35 +01:00
Zachary Flower
4a4183398b Add a clean error message for invalid IP addresses 2017-12-14 14:57:21 -07:00
Timur Alperovich
a56e118b16 Use <prefix>::1 as the IPv6 adapter IP.
Set the IPv6 adapter IP to be <prefix>::1. Otherwise, guest to host
communication over IPv6 is not routed correctly. This means that
consumers should not specify <prefix>::1 IP addresses to VirtualBox,
which should be a reasonable restriction.

Fixes #6658
2015-12-09 17:22:02 -08:00
Mitchell Hashimoto
dbf419abad providers/virtualbox: ignore unknown status interfaces [GH-6061] 2015-11-23 10:15:32 -08:00
Mitchell Hashimoto
925d7c5bf6 Revert "Make DHCP IP configurable"
This reverts commit 004fe0e7bb0c17c4f0e0bc801440a6456d7b979d.
2015-11-18 17:11:58 -08:00
Seth Vargo
48df85008c Rebase and cleanup conditional 2015-11-18 16:31:44 -08:00
Tristan Rivoallan
2c6ef938c7 Fix failing network test 2015-11-18 16:29:46 -08:00
Tristan Rivoallan
004fe0e7bb Make DHCP IP configurable
This makes it possible to have DHCP attribute IPs to guests under
various subnets
2015-11-18 16:29:46 -08:00
Mitchell Hashimoto
2299715b41 providers/virtualbox: code review comments 2015-10-01 17:01:27 -04:00
Mitchell Hashimoto
ec0b0fb7f9 providers/virtualbox: IPv6 host only networks 2015-09-30 17:23:25 -07:00
Mitchell Hashimoto
536ea0729b providers/virtualbox: name for private network chooses right interface
[GH-5389]
2015-07-08 18:35:44 -06:00
Seth Vargo
08f240668b Minor cleanup 2015-05-30 12:02:10 -07:00
Joakim Bergman
2b3411965a virtualbox: handle a list of bridged nics
This change allows you to specify multiple network interfaces to bridge
to, picking the first found.

```ruby
config.vm.network "public_network",
  bridge: ["en4: Thunderbolt Ethernet",
           "en6: Broadcom NetXtreme Gigabit Ethernet Controller",
           "en0: Wi-Fi (AirPort)"]
```
2015-05-07 18:23:11 +02:00
Hugues Lismonde
887f94260e Support Regexp usage for bridge configuration 2015-02-11 11:07:03 +01:00
Paul Hinze
25ff636ee2 providers/virtualbox: cleanup default vbox dhcp server
fixes #3083

Detect the presence of the default DHCP server that comes in a fresh
VirtualBox install and clean it up to prevent it from colliding with
Vagrant-managed network config.

In order to accomplish this, we:

 - add a `remove_dhcp_server` call to the virtualbox driver
 - fix dhcp options parsing to allow `:dhcp_{ip,lower,upper}`
   configuration options to make it through (so a user can override the
   removal behavior with some explicit configuration)
 - add the full `:network_name` to the details returned from
   `:read_dhcp_servers`, so we can have a durable value to pass to
   `:remove_dhcp_server`

Note that we do have to eat one more `VBoxManage list dhcpservers` for
each network interface to support this, but this seemed like a nominal
cost
2014-11-30 22:03:52 -06:00
Paul Hinze
24b6f21d1d providers/virtualbox: extract reading dhcpservers from hostonlyifs
This is just a refactor, no behavior change.

Instead of stitching together dhcpserver info in the structure returned
from `read_host_only_interfaces`, sprout a new driver method called
`read_dhcp_servers` to return that information separately.

This means that driver clients (well there's really only _one_ client in
`ProviderVirtualBox::Action::Network`) have to do a bit more work to get
interface and DHCP server information.

But this gives us (a) a cleaner and more consistent driver interface and
(b) groundwork for a fix for #3083, which will require interacting with
DHCP servers outside of the context of host-only interfaces.
2014-11-30 22:03:52 -06:00
Chris Jones
b19abebdf0 Grammar fix to the network interface bridge question 2014-10-31 15:16:02 -04:00
Mitchell Hashimoto
4ffaaf119e providers/virtualbox: more hints when choosing interface [GH-4463] 2014-10-23 10:24:07 -07:00
Steve McConville
de7ed34120 Changed hardcoded number of interfaces, fixes #4206. 2014-07-17 09:52:57 +01:00
Kalman Hazins
bb052366f7 Change symbols inside hashes to 1.9 JSON-like syntax 2014-05-22 12:35:12 -04:00
Mitchell Hashimoto
a8d51a2452 providers/virtualbox: remove old print 2014-05-01 21:19:14 -07:00
Mitchell Hashimoto
9c420b8738 providers/virtualbox: set proper mac address on priv net [GH-3588] 2014-04-30 17:09:29 -07:00
Mitchell Hashimoto
5b449c8000 providers/virtualbox: many detail level output 2014-01-17 21:03:00 -08:00
Mitchell Hashimoto
2f7163386d providers/virtualbox: don't error when intnet set to "true" [GH-2751] 2014-01-03 08:31:14 -08:00
Mitchell Hashimoto
2d957cdaab providers/virtualbox: internal networks [GH-2020] 2013-11-25 11:13:46 -08:00
phinze
4225b0eb7b provider/virtualbox: fix bad constant reference in dhcp error
refs #2454
2013-11-20 11:15:25 -06:00
Mitchell Hashimoto
154b32e561 Merge pull request #1745 from jheise/master
providers/virtualbox: static ip addresses on public networks
2013-09-02 15:10:33 -07:00
Mitchell Hashimoto
54ac2e8448 Merge pull request #1713 from akalyaev/respect-nec-type-option-for-private-networks-1704
core: respect :nic_type option for private network. Fixes #1704
2013-08-28 22:44:20 -07:00
Mitchell Hashimoto
0dfc6455ae Update CHANGELOG 2013-07-13 09:22:53 +09:00
Antek Baranski
28e7ae1d05 Enable setting the IP address on DHCP based private network 2013-07-12 17:18:38 -07:00