VirtualBox no longer removes network interfaces [GH-1324]
This commit is contained in:
parent
aeb0132dcb
commit
b2ee015d00
|
@ -8,6 +8,11 @@ FEATURES:
|
||||||
- VirtualBox VBoxManage customizations can now be specified to run
|
- VirtualBox VBoxManage customizations can now be specified to run
|
||||||
pre-boot (the default and existing functionality, pre-import,
|
pre-boot (the default and existing functionality, pre-import,
|
||||||
or post-boot. [GH-1247]
|
or post-boot. [GH-1247]
|
||||||
|
- VirtualBox no longer destroys unused network interfaces by default.
|
||||||
|
This didn't work across multi-user systems and required admin privileges
|
||||||
|
on Windows, so it has been disabled by default. It can be enabled using
|
||||||
|
the VirtualBox provider-specific `destroy_unused_network_interfaces`
|
||||||
|
configuration by setting it to true. [GH-1324]
|
||||||
|
|
||||||
IMPROVEMENTS:
|
IMPROVEMENTS:
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,22 @@
|
||||||
|
require "log4r"
|
||||||
|
|
||||||
module VagrantPlugins
|
module VagrantPlugins
|
||||||
module ProviderVirtualBox
|
module ProviderVirtualBox
|
||||||
module Action
|
module Action
|
||||||
class DestroyUnusedNetworkInterfaces
|
class DestroyUnusedNetworkInterfaces
|
||||||
def initialize(app, env)
|
def initialize(app, env)
|
||||||
@app = app
|
@app = app
|
||||||
|
@logger = Log4r::Logger.new("vagrant::plugins::virtualbox::destroy_unused_netifs")
|
||||||
end
|
end
|
||||||
|
|
||||||
def call(env)
|
def call(env)
|
||||||
|
if env[:machine].provider_config.destroy_unused_network_interfaces
|
||||||
|
@logger.info("Destroying unused network interfaces...")
|
||||||
env[:machine].provider.driver.delete_unused_host_only_networks
|
env[:machine].provider.driver.delete_unused_host_only_networks
|
||||||
@app.call(env)
|
@app.call(env)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -13,6 +13,14 @@ module VagrantPlugins
|
||||||
# @return [Array]
|
# @return [Array]
|
||||||
attr_reader :customizations
|
attr_reader :customizations
|
||||||
|
|
||||||
|
# If true, unused network interfaces will automatically be deleted.
|
||||||
|
# This defaults to false because the detection does not work across
|
||||||
|
# multiple users, and because on Windows this operation requires
|
||||||
|
# administrative privileges.
|
||||||
|
#
|
||||||
|
# @return [Boolean]
|
||||||
|
attr_accessor :destroy_unused_network_interfaces
|
||||||
|
|
||||||
# If set to `true`, then VirtualBox will be launched with a GUI.
|
# If set to `true`, then VirtualBox will be launched with a GUI.
|
||||||
#
|
#
|
||||||
# @return [Boolean]
|
# @return [Boolean]
|
||||||
|
@ -32,6 +40,7 @@ module VagrantPlugins
|
||||||
def initialize
|
def initialize
|
||||||
@auto_nat_dns_proxy = UNSET_VALUE
|
@auto_nat_dns_proxy = UNSET_VALUE
|
||||||
@customizations = []
|
@customizations = []
|
||||||
|
@destroy_unused_network_interfaces = UNSET_VALUE
|
||||||
@name = UNSET_VALUE
|
@name = UNSET_VALUE
|
||||||
@network_adapters = {}
|
@network_adapters = {}
|
||||||
@gui = UNSET_VALUE
|
@gui = UNSET_VALUE
|
||||||
|
@ -73,6 +82,10 @@ module VagrantPlugins
|
||||||
# Default is to auto the DNS proxy
|
# Default is to auto the DNS proxy
|
||||||
@auto_nat_dns_proxy = true if @auto_nat_dns_proxy == UNSET_VALUE
|
@auto_nat_dns_proxy = true if @auto_nat_dns_proxy == UNSET_VALUE
|
||||||
|
|
||||||
|
if @destroy_unused_network_interfaces == UNSET_VALUE
|
||||||
|
@destroy_unused_network_interfaces = false
|
||||||
|
end
|
||||||
|
|
||||||
# Default is to not show a GUI
|
# Default is to not show a GUI
|
||||||
@gui = false if @gui == UNSET_VALUE
|
@gui = false if @gui == UNSET_VALUE
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue