Commit Graph

380 Commits

Author SHA1 Message Date
Indrek Ardel b57b0e0d48 Add VirtualBox 5.1 driver 2016-07-13 15:34:25 +03:00
Seth Vargo cb1749b375
8 network adapters, always 2016-06-11 20:00:16 +02:00
Seth Vargo 45e71eca15 Revert "Set max_network_adapters to 36 for Virtualbox" 2016-06-11 01:04:58 +02:00
Seth Vargo 63bbbc0335 Merge pull request #7372 from nicolasvan/virtualbox-race-condition-on-vmexists
Make virtualbox vm_exists? more resilient to VirtualBox transient failures
2016-06-06 19:19:22 -04:00
David O'Rourke 60fd777806 prepare_nfs_settings: Use scoped hash override when reading static IPs. 2016-06-03 15:19:23 +01:00
nico.vanelslande 163e1997a6 Make virtualbox vm_exists? more resilient to VirtualBox transient failures.
We know that the vm does not exist if we get VBOX_E_OBJECT_NOT_FOUND.
For any other error, this may well be VirtualBox getting confused and it is probably
worth retrying...
2016-05-31 13:23:56 +01:00
Seth Vargo e2fadbcf08
Add a log message when the VM master is missing 2016-05-29 01:19:56 -04:00
Seth Vargo 1e7c8e8d6c
Use LF instead of CRLF 2016-05-29 01:18:24 -04:00
Seth Vargo d3d88f5d91 Merge pull request #7126 from jjulien/iss_6742
Fixed linked clone failure when master VM is missing
2016-05-29 01:14:04 -04:00
Seth Vargo b11f8cbd1b Merge pull request #7293 from ericpulvino/master
Set max_network_adapters to 36 for Virtualbox
2016-05-29 00:55:44 -04:00
Seth Vargo 3d2390fc94
Give a unique, prefixed name to all tempfiles
This commit basically grepped the code base for all uses of Dir.mktmpdir
and Tempfile.new/open and ensures the value is unique within the
code base and also prefixed with `vagrant-`.

Previously, most invocations of these commands simply used "vagrant",
thus making them indistinguishable when trying to identify leaks.
2016-05-28 23:22:34 -04:00
Ray Ruvinskiy e42f346b1d
Make `start` action run provisioners if VM is running
Previously, there was no one gesture that would start a VM if it was not
running and run the appropriate provisioners regardless of its original
state. `vagrant up` did nothing if the VM was running, while
`vagrant provision` did nothing if the VM was not running.

Change the semantics of `vagrant up`, via the start actions of the providers,
to go through the provisioning logic even if the VM is already running.
The semantics of `run: "once"` vs `run: "always"` are respected.

Tested with the VirtualBox provider but not the others.

Resolves #4421
2016-05-27 19:00:33 -04:00
Seth Vargo 68329817ad Merge pull request #7290 from phyber/fix/master/prepare_nfs_settings_machine_ip_fix
prepare_nfs_settings: Try harder to get all machine IPs.
2016-05-27 18:38:03 -04:00
Seth Vargo efdb148f61
Move pre-flight package validation to middleware
This commit separates the scratch and output directory creation from the
main package middleware into its own PackageSetupFolders middleware.
Additionally, the validation that ensures an output file does not exist
is moved into a validation function that can be shared across multiple
methods.

This refactor permits a pre-flight check to ensure box packaging would
be successful before actually stopping the VM.

Fixes GH-7351
2016-05-27 17:07:04 -04:00
David O'Rourke 985f1d4dda prepare_nfs_settings: Fix add_ips_to_env!, spec test passes again. 2016-05-10 11:16:21 +01:00
Eric Pulvino 45e52e3bf1 Updated ./plugins/providers/virtualbox/driver/base.rb file, set max_network_adapters to 36 for Virtualbox so all 36 adapters are cleared prior to programming interfaces. This fix is per issue 7286 --> https://github.com/mitchellh/vagrant/issues/7286 2016-05-08 00:11:22 -04:00
David O'Rourke ed708645b2 prepare_nfs_settings: Try harder to get all machine IPs.
Vagrant was not behaving correctly in configurations where there was
a static IP on a VirtualBox `intnet` interface and a DHCP `:hostonly`
interface configured.

Since `machine_ip` attempted to get static addresses `||` dynamic
addresses, it would simply use the static machine address and
continue.

This commit corrects this behaviour by collecting all static and
dynamic addresses into the `machine_ip` array instead of just one or
the other.

The result of this is a correctly generated `/etc/exports` on the
host machine, allowing NFS mounts to work correctly in this type of
environment.
2016-05-05 14:41:03 +01:00
Seth Vargo d565c2f07e Check both stderr and stdout
Different vbox versions print this to different streams, so check both
just to be sure
2016-03-17 10:52:10 -04:00
John Julien e0ecda961c Fixed linked clone failure when master VM is missing
If the master VM is removed, but the master_id file exists, Vagrant
would still attempt to clone using the master_id rather then
importing re-importing first.

Fixes #6742
2016-03-09 19:33:47 -06:00
Evgeniy N 890820eaf6 Add snapshot commands
Fixed error remains in other versions:
  return [] if e.extra_data[:stdout].include?("does not have")
should be
  return [] if e.extra_data[:stderr].include?("does not have")

Many methods are the same in different version_X, and should be moved to Base class.
2016-02-18 11:47:07 +06: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
Seth Vargo aca1e041f6 Rename network to interface 2015-12-08 11:05:39 -05:00
Seth Vargo 9ba8cfcd50 Separate logic into other functions for readability 2015-12-08 10:52:54 -05:00
Timur Alperovich bcf61d001b Only consider the VM interfaces in the IPv6 fixup.
Vagrant should only consider the host-only interfaces used by the
virtual machine in the IPv6 fixup code. There may be other interfaces
present on the system with IPv6 addresses that for various reasons
would fail the routing check (for example, an interface with no
machines attached).

The patch changes the behavior to not scan all of the host-only
interfaces and adds a unit test for the behavior (that the correct IP
is validated).

Lastly, there is a small fix here that may not be an issue for most
people where the IPv6 prefix was asummed to be a multiple of 16 for
the purposes of constructing the UDP probe datagram. This assumption
has been removed.

Fixes #6586
2015-12-08 10:44:07 -05:00
Seth Vargo f20c08f57f Return nil if the VM is not running when looking at forwarded ports 2015-11-24 16:33:09 -05:00
Seth Vargo 844cca9013 Skip nil IP addresses in ipv6 fix
Fixes GH-6558
2015-11-23 17:20:20 -05:00
Seth Vargo 7b89ecc230 Add public_address cap for VirtualBox
Fixes GH-5978
2015-11-23 16:23:22 -05:00
Mitchell Hashimoto dbf419abad providers/virtualbox: ignore unknown status interfaces [GH-6061] 2015-11-23 10:15:32 -08:00
Mitchell Hashimoto 3c2fab9d0d providers/virtualbox: more robust lookup for VBoxManage on Win 2015-11-20 15:56:14 -08:00
Mitchell Hashimoto 270c0726df Merge pull request #6552 from mitchellh/f-cache-vbox
providers/virtualbox: cache VirtualBox version [GH-6468]
2015-11-19 11:20:09 -08:00
Mitchell Hashimoto a75b14b769 providers/virtualbox: wrap version set in mutex 2015-11-19 11:19:56 -08:00
Seth Vargo 825bd6d5ef Run provisioner cleanup tasks before destroying the VM 2015-11-19 11:14:31 -08:00
Mitchell Hashimoto fb511a43d9 providers/virtualbox: store version on instance as well 2015-11-19 11:02:00 -08:00
Mitchell Hashimoto d56c8fda18 providers/virtualbox: cache VirtualBox version [GH-6468] 2015-11-19 11:00:02 -08:00
Mitchell Hashimoto 6f3ed13f75 providers/virtualbox: run provisioners on suspend resume 2015-11-18 17:16:23 -08:00
Mitchell Hashimoto 925d7c5bf6 Revert "Make DHCP IP configurable"
This reverts commit 004fe0e7bb.
2015-11-18 17:11:58 -08:00
Seth Vargo 96a815e84e Merge pull request #6538 from mitchellh/sethvargo/pr-6325
Make DHCP IP configurable
2015-11-18 16:41:30 -08:00
Seth Vargo e9f4bca380 Revert "#5186: Warning: Authentication failure. Retrying... after packaging box" 2015-11-18 16:35:35 -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
Seth Vargo 42d0c3637c Merge pull request #6406 from markus-perl/5186
#5186: Warning: Authentication failure. Retrying... after packaging box
2015-11-18 16:23:44 -08:00
Mitchell Hashimoto d425193e42 Merge pull request #6493 from Ingramz/master
Re-enable UNC paths for shared folders on Windows hosts
2015-11-18 15:20:21 -08:00
Mitchell Hashimoto baea923e9c commands/up: automatically install providers 2015-11-05 13:58:15 -08:00
Indrek Ardel 4a7aa83e58 Use UNC paths for shared folders on Windows host 2015-11-05 18:56:24 +02:00
Indrek Ardel ea66e22d2e Use UNC paths for shared folders on Windows host 2015-11-05 18:55:34 +02:00
Markus Perl 61466c8e65 #5186: Warning: Authentication failure. Retrying... after packaging box 2015-10-17 23:00:39 +02:00
Mitchell Hashimoto efa01abb12 providers/virtualbox: if no box, don't import the master 2015-10-16 10:30:04 -07:00
Mitchell Hashimoto 36cfc77167 providers/virtualbox: make prepare clone a core thing 2015-10-08 16:02:37 -04:00
Mitchell Hashimoto 5ea24e39d0 providers/virtualbox: unify import/clone 2015-10-08 13:07:05 -04:00