VPN restrictions can necessitate specifying a CIDR with a narrower subnet than /24 in the --virtualbox-hostonly-cidr parameter. The previous code assumed it could create a DHCP server with address ranges that are valid for a /24 CIDR, but not for a /25 CIDR (for example).
VirtualBox validates that the supplied address range is within the subnet specified for the DHCP server. So with the previous code, we would see errors like this:
```
Error setting up host only network on machine start: /usr/local/bin/VBoxManage dhcpserver modify --netname HostInterfaceNetworking-vboxnet0 --ip 100.121.20.6 --netmask 255.255.255.128 --lowerip 100.121.20.100 --upperip 100.121.20.254 --enable failed:
VBoxManage: error: Invalid range upper address
VBoxManage: error: Details: code NS_ERROR_INVALID_ARG (0x80070057), component VirtualBoxWrap, interface IVirtualBox, callee nsISupports
VBoxManage: error: Context: "SetConfiguration ( Bstr(pIp).mutableRaw(), Bstr(pNetmask).mutableRaw(), Bstr(pLowerIp).mutableRaw(), Bstr(pUpperIp).mutableRaw())" at line 384 of file VBoxManageDHCPServer.cpp
VBoxManage: error: Failed to set configuration
```
This commit keeps the previous behavior for CIDRs with a /24 or smaller subnet mask. For CIDRs with a /25 or larger subnet mask, this change will set the DHCP server's address range to a range which fits in the specified subnet.
Signed-off-by: Mike Grass <mgrass@salesforce.com>
Allow use of ':' in the left part of the mapping to use Windows paths.
Assume the right part of the mapping does not contains ':'.
Signed-off-by: Alexandre Garnier <zigarn@gmail.com>
*The current implementation for the Windows VirtualBox driver maps
directly to the 'c:\\Users' directory. This regularly causes exceptions
when a file is written to a volume on a Windows machine where there is a
limitation on the number of characters allowed in a file path.
*By instead using the proposed mapping of '\\?\c:\\Users' the Windows
API will allow the file path to exceed the character limit and should
resolve issues and cryptic errors for many users that are using Docker
Machine to build artifacts with lengthy file paths.
Signed-off-by: Juan San Emeterio <juan.sanemeterio@equifax.com>
NOTE: with this one can specify the UI Type: gui,sdl,separate instead of the default choice (headless)
NOTE: running X11 server is required if UI type is not headless
Signed-off-by: Oleksandr Motsak <http://goo.gl/mcpzY>
+ exclude existing host-only nets from list of host interfaces
+ interface and mocks for system calls to net.*
Signed-off-by: Paul Callahan <paul.callahan@gmail.com>