diff --git a/docs/drivers/virtualbox.md b/docs/drivers/virtualbox.md index cbd0590a6c..667713ca6e 100644 --- a/docs/drivers/virtualbox.md +++ b/docs/drivers/virtualbox.md @@ -39,7 +39,7 @@ Options: - `--virtualbox-hostonly-nictype`: Host Only Network Adapter Type. Possible values are are '82540EM' (Intel PRO/1000), 'Am79C973' (PCnet-FAST III) and 'virtio-net' Paravirtualized network adapter. - `--virtualbox-hostonly-nicpromisc`: Host Only Network Adapter Promiscuous Mode. Possible options are deny , allow-vms, allow-all - `--virtualbox-no-share`: Disable the mount of your home directory -- `--virtualbox-dns-proxy`: Proxy all DNS requests to the host (Boolean value, default to false) +- `--virtualbox-no-dns-proxy`: Disable proxying all DNS requests to the host (Boolean value, default to false) - `--virtualbox-no-vtx-check`: Disable checking for the availability of hardware virtualization before the vm is started The `--virtualbox-boot2docker-url` flag takes a few different forms. By @@ -82,7 +82,7 @@ Environment variables and default values: | `--virtualbox-hostonly-nictype` | `VIRTUALBOX_HOSTONLY_NIC_TYPE` | `82540EM` | | `--virtualbox-hostonly-nicpromisc` | `VIRTUALBOX_HOSTONLY_NIC_PROMISC` | `deny` | | `--virtualbox-no-share` | `VIRTUALBOX_NO_SHARE` | `false` | -| `--virtualbox-dns-proxy` | `VIRTUALBOX_DNS_PROXY` | `false` | +| `--virtualbox-no-dns-proxy` | `VIRTUALBOX_NO_DNS_PROXY` | `false` | | `--virtualbox-no-vtx-check` | `VIRTUALBOX_NO_VTX_CHECK` | `false` | ## Known Issues diff --git a/drivers/virtualbox/virtualbox.go b/drivers/virtualbox/virtualbox.go index 06e19a9194..7f363e57c2 100644 --- a/drivers/virtualbox/virtualbox.go +++ b/drivers/virtualbox/virtualbox.go @@ -29,6 +29,8 @@ const ( defaultHostOnlyNictype = "82540EM" defaultHostOnlyPromiscMode = "deny" defaultDiskSize = 20000 + defaultDnsProxy = true + defaultDnsResolver = false ) var ( @@ -79,6 +81,8 @@ func NewDriver(hostName, storePath string) *Driver { HostOnlyCIDR: defaultHostOnlyCIDR, HostOnlyNicType: defaultHostOnlyNictype, HostOnlyPromiscMode: defaultHostOnlyPromiscMode, + DNSProxy: defaultDnsProxy, + HostDNSResolver: defaultDnsResolver, BaseDriver: &drivers.BaseDriver{ MachineName: hostName, StorePath: storePath, @@ -149,9 +153,9 @@ func (d *Driver) GetCreateFlags() []mcnflag.Flag { EnvVar: "VIRTUALBOX_NO_SHARE", }, mcnflag.BoolFlag{ - Name: "virtualbox-dns-proxy", - Usage: "Proxy all DNS requests to the host", - EnvVar: "VIRTUALBOX_DNS_PROXY", + Name: "virtualbox-no-dns-proxy", + Usage: "Disable proxying all DNS requests to the host", + EnvVar: "VIRTUALBOX_NO_DNS_PROXY", }, mcnflag.BoolFlag{ Name: "virtualbox-no-vtx-check", @@ -205,7 +209,7 @@ func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) error { d.HostOnlyNicType = flags.String("virtualbox-hostonly-nictype") d.HostOnlyPromiscMode = flags.String("virtualbox-hostonly-nicpromisc") d.NoShare = flags.Bool("virtualbox-no-share") - d.DNSProxy = flags.Bool("virtualbox-dns-proxy") + d.DNSProxy = !flags.Bool("virtualbox-no-dns-proxy") d.NoVTXCheck = flags.Bool("virtualbox-no-vtx-check") return nil diff --git a/drivers/virtualbox/virtualbox_test.go b/drivers/virtualbox/virtualbox_test.go index 1af9d28dd5..1fd8051b10 100644 --- a/drivers/virtualbox/virtualbox_test.go +++ b/drivers/virtualbox/virtualbox_test.go @@ -326,7 +326,7 @@ func TestCreateVM(t *testing.T) { {"Generate path/machines/default/id_rsa", "", nil}, {"Create 20000 path/machines/default/id_rsa.pub path/machines/default/disk.vmdk", "", nil}, {"vbm createvm --basefolder path/machines/default --name default --register", "", nil}, - {"vbm modifyvm default --firmware bios --bioslogofadein off --bioslogofadeout off --bioslogodisplaytime 0 --biosbootmenu disabled --ostype Linux26_64 --cpus 1 --memory 1024 --acpi on --ioapic on --rtcuseutc on --natdnshostresolver1 off --natdnsproxy1 off --cpuhotplug off --pae on --hpet on --hwvirtex on --nestedpaging on --largepages on --vtxvpid on --accelerate3d off --boot1 dvd", "", nil}, + {"vbm modifyvm default --firmware bios --bioslogofadein off --bioslogofadeout off --bioslogodisplaytime 0 --biosbootmenu disabled --ostype Linux26_64 --cpus 1 --memory 1024 --acpi on --ioapic on --rtcuseutc on --natdnshostresolver1 off --natdnsproxy1 onaa --cpuhotplug off --pae on --hpet on --hwvirtex on --nestedpaging on --largepages on --vtxvpid on --accelerate3d off --boot1 dvd", "", nil}, {"vbm modifyvm default --nic1 nat --nictype1 82540EM --cableconnected1 on", "", nil}, {"vbm storagectl default --name SATA --add sata --hostiocache on", "", nil}, {"vbm storageattach default --storagectl SATA --port 0 --device 0 --type dvddrive --medium path/machines/default/boot2docker.iso", "", nil},