Commit Graph

19 Commits

Author SHA1 Message Date
David O'Rourke 60fd777806 prepare_nfs_settings: Use scoped hash override when reading static IPs. 2016-06-03 15:19:23 +01: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
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 d2874064f4 Use .key? instead of .has_key? 2015-01-05 18:29:01 -05:00
Mikhail Zholobov 5197945e56 providers/virtualbox: Remove unused method "using_nfs?"
Related to [GH-4344]
2014-10-23 11:04:21 +04:00
Mitchell Hashimoto 7988f0fb7c Fix broken unit tests 2014-10-22 09:44:48 -07:00
Mitchell Hashimoto 7ccec33460 providers/virtualbox: define a sync_folders action to setup NFS
[GH-4344]
2014-10-22 09:26:38 -07:00
Mitchell Hashimoto 951dc934cc providers/virtualbox: cleaner ignore DHCP 2014-09-04 14:20:03 -07:00
Simo Leone 71119590e8 Fix NFS when DHCP settings use a custom IP range
Only use the static IP if it is indeed a static IP. Otherwise assume
it's DHCP and get the IP that way.
2014-09-02 13:17:30 -07:00
Paul Hinze fc66ec1660 providers/virtualbox: allow and prefer static guest IPs for NFS
Since vbox guest properties are proving to be less reliable than we had
hoped, bring back the static config parsing mechanism for finding a
guest IP to hand to NFS. If we find a static IP (or set of IPs) we'll
use that instead of trying to probe guest properties.

This retains NFS support for DHCP interfaces while regaining the
reliability that we previously had when static IPs were required.
2013-12-28 17:01:08 -06:00
Mitchell Hashimoto c1141dded3 providers/virtualbox: don't clear /etc/exports on BSDs for NFS [GH-2645] 2013-12-13 22:03:14 -08:00
Paul Hinze c25172d0f7 providers/virtualbox: support DHCP interfaces for NFS
Previously, we required a host-only interface with a static IP for NFS
to work in VirtualBox, because we needed access to the guest's IP in
order to properly configure mount commands.

After boot, VirtualBox exposes the IP addresses of a guest's network
adapters via the "guestproperty" interface.

This adds support for reading VirtualBox guest properties to the
VirtualBox driver and utilizes that support to prepare NFS settings,
which removes the necessity for a static IP for NFS to work.

In this commit we also start building out scaffolding for unit testing
vbox actions and drivers.

Test plan:
 - Prepare a Vagrantfile with the following:
   * private network with type: :dhcp
   * synced folder with nfs: true
 - Boot a VM from this Vagrantfile using the virtualbox provider
 - Machine should boot successfully with working synced folder
2013-12-03 10:21:28 -05:00
Mitchell Hashimoto 0b9861db7d providers/virtualbox: fix broken NFS check 2013-11-22 17:29:35 -08:00
Mitchell Hashimoto 3028940adb NFS allows access from all networks on VM [GH-1204] 2013-07-18 00:01:49 -04:00
Mitchell Hashimoto c94f61d274 Only prepare NFS settings for VirtualBox if NFS is enabled 2013-03-18 13:21:06 -07:00
Eivind Uggedal c45d3ee728 Fix wrong reference to Errors::NFSNoHostonlyNetwork introduced in 022c1da [GH-1437]. 2013-03-18 14:30:26 +01:00
Mitchell Hashimoto 022c1daec0 Raise error if no hostonly network on VBox with NFS [GH-1437] 2013-03-17 22:33:02 -07:00
Mitchell Hashimoto 36b805367d Fix all core code to use the new networking syntax 2013-03-01 16:48:10 -08:00
Mitchell Hashimoto 6afb4326fa Move NFS to a built-in middleware 2013-02-08 15:34:04 -08:00