Merge pull request #3069 from dgageot/3068-dns-proxy-mode

VirtualBox: use dns proxy mode
This commit is contained in:
Nathan LeClaire
2016-02-17 13:35:55 -08:00
3 changed files with 11 additions and 7 deletions

View File

@@ -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' 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

View File

@@ -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

View File

@@ -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 on --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},