loading table of contents...

3.3.4.1. Networking

The virtual box configured with the Vagrantfile from this workspace is connected by a VirtualBox host-only adapter with the IP 192.168.252.1 and the subnet 255.255.255.0. The box itself has the IP address 192.168.252.100.

[Note]Note

Windows and VirtualBox have issues with the creation and removal of host-only adapters. Under some circumstances, Windows tends to ignore the IP/Subnet configuration, given to the adapter. When that happens, Windows gives the adapter an APIPA (Automatic Private IP Address) address of the form 169.254.x.x with the subnet 255.255.0.0. This makes any box unreachable from your host machine.

To workaround this issue, you need to create a correct adapter only once and prevent Vagrant from destroying and recreating it all the time which might cause possible errors. To achieve that, create a virtual box definition, and register it with the correct adapter. Vagrant will then skip the removal of that adapter and the recreation of a new one. As a nice side effect, you won't need to click away the UAC pop-ups and do not need administrator rights anymore. The box itself neither requires any additional hard disk space, RAM or OS nor will it ever be started, it just blocks the adapter.