diff --git a/CHANGELOG.md b/CHANGELOG.md index 08ee62863..9c0e6bc4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -58,6 +58,8 @@ BUG FIXES: - guests/debian: Force bring up eth0. Fixes hangs on setting hostname. [GH-2026] - hosts/fedora: properly detect later CentOS versions. [GH-2008] + - providers/virtualbox: VirtualBox 4.2 now supports up to 36 + network adapters. [GH-1886] - provisioners/ansible: Execute ansible with a cwd equal to the path where the Vagrantfile is. [GH-2051] - provisioners/ansible: No longer report failure on every run. [GH-2007] diff --git a/plugins/providers/virtualbox/action/clear_network_interfaces.rb b/plugins/providers/virtualbox/action/clear_network_interfaces.rb index 0098692f3..369c80f46 100644 --- a/plugins/providers/virtualbox/action/clear_network_interfaces.rb +++ b/plugins/providers/virtualbox/action/clear_network_interfaces.rb @@ -12,7 +12,7 @@ module VagrantPlugins # excluding the NAT adapter on port 1 which Vagrant always # expects to exist. adapters = [] - 2.upto(8).each do |i| + 2.upto(env[:machine].provider.driver.max_network_adapters).each do |i| adapters << { :adapter => i, :type => :none diff --git a/plugins/providers/virtualbox/driver/base.rb b/plugins/providers/virtualbox/driver/base.rb index 5e9f9afb2..468834597 100644 --- a/plugins/providers/virtualbox/driver/base.rb +++ b/plugins/providers/virtualbox/driver/base.rb @@ -153,6 +153,11 @@ module VagrantPlugins def import(ovf) end + # Returns the maximum number of network adapters. + def max_network_adapters + 8 + end + # Returns a list of forwarded ports for a VM. # # @param [String] uuid UUID of the VM to read from, or `nil` if this diff --git a/plugins/providers/virtualbox/driver/version_4_2.rb b/plugins/providers/virtualbox/driver/version_4_2.rb index abe8d1c0d..a537c4a60 100644 --- a/plugins/providers/virtualbox/driver/version_4_2.rb +++ b/plugins/providers/virtualbox/driver/version_4_2.rb @@ -202,6 +202,10 @@ module VagrantPlugins nil end + def max_network_adapters + 36 + end + def read_forwarded_ports(uuid=nil, active_only=false) uuid ||= @uuid