Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

Commit

Permalink
FIX #3068 DNS Proxy mode
Browse files Browse the repository at this point in the history
Signed-off-by: David Gageot <david@gageot.net>
  • Loading branch information
dgageot committed Feb 17, 2016
1 parent 1eaf5a4 commit 30849d6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/drivers/virtualbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 8 additions & 4 deletions drivers/virtualbox/virtualbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ const (
defaultHostOnlyNictype = "82540EM"
defaultHostOnlyPromiscMode = "deny"
defaultDiskSize = 20000
defaultDnsProxy = true
defaultDnsResolver = false
)

var (
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion drivers/virtualbox/virtualbox_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down

0 comments on commit 30849d6

Please sign in to comment.