The (default) generated homestead VM does not have an IPv4 address and how to fix this

And there is nothing that indicates a failure : neither when the VM is booting

( … )

using the "ifconfig" command, we can see that our adapters do not have an IPv4 address ( whereas we were expecting to be used )

The “lspci” command allows us to see what devices are used. We can see the Ethernet controllers there.


Back to VirtualBox, let's review the network adapters and see if anything can be done to fix this...

We can see the automatic port forwarding rules set by Vagrant/Homestead



Does any other type of network adapter can come to our rescue ?

Some documentation below…

VirtualBox NIC Type

Source: https://www.vagrantup.com/docs/virtualbox/networking.html

You can specify a specific NIC type for the created network interface by using the nic_type parameter. This is not prefixed by virtualbox__ for legacy reasons, but is VirtualBox-specific.

This is an advanced option and should only be used if you know what you are using, since it can cause the network device to not work at all.


Vagrant.configure("2") do |config|
  config.vm.network "private_network", ip: "",
    nic_type: "virtio"

Virtual networking hardware

Source: https://www.virtualbox.org/manual/ch06.html

For each card, you can individually select what kind of hardware will be presented to the virtual machine. VirtualBox can virtualize the following six types of networking hardware:

AMD PCNet PCI II (Am79C970A);

AMD PCNet FAST III (Am79C973, the default);

Intel PRO/1000 MT Desktop (82540EM);

Intel PRO/1000 T Server (82543GC);

Intel PRO/1000 MT Server (82545EM);

Paravirtualized network adapter (virtio-net).

The PCNet FAST III is the default because it is supported by nearly all operating systems out of the box, as well as the GNU GRUB boot manager. As an exception, the Intel PRO/1000 family adapters are chosen for some guest operating system types that no longer ship with drivers for the PCNet card, such as Windows Vista.

The Intel PRO/1000 MT Desktop type works with Windows Vista and later versions. The T Server variant of the Intel PRO/1000 card is recognized by Windows XP guests without additional driver installation. The MT Server variant facilitates OVF imports from other platforms.

The "Paravirtualized network adapter (virtio-net)" is special. If you select this, then VirtualBox does not virtualize common networking hardware (that is supported by common guest operating systems out of the box). Instead, VirtualBox then expects a special software interface for virtualized environments to be provided by the guest, thus avoiding the complexity of emulating networking hardware and improving network performance. Starting with version 3.1, VirtualBox provides support for the industry-standard "virtio" networking drivers, which are part of the open-source KVM project.

The "virtio" networking drivers are available for the following guest operating systems:

    Linux kernels version 2.6.25 or later can be configured to provide virtio support; some distributions also back-ported virtio to older kernels.

    For Windows 2000, XP and Vista, virtio drivers can be downloaded and installed from the KVM project web page.[30]

VirtualBox also has limited support for so-called jumbo frames, i.e. networking packets with more than 1500 bytes of data, provided that you use the Intel card virtualization and bridged networking. In other words, jumbo frames are not supported with the AMD networking devices; in those cases, jumbo packets will silently be dropped for both the transmit and the receive direction. Guest operating systems trying to use this feature will observe this as a packet loss, which may lead to unexpected application behavior in the guest. This does not cause problems with guest operating systems in their default configuration, as jumbo frames need to be explicitly enabled.

Network Adapter Settings

Source: http://download.parallels.com/desktop/v4/docs/en/Parallels_Desktop_Users_Guide/22249.htm

  •     Shared Networking. Select this option to enable the Network Address Translation (NAT) feature for the virtual machine. In this case, your virtual machine will share whatever network connection is currently used by your physical computer.

  •     Bridged Ethernet. Select this option to allow the virtual machine to access the local network and Internet through one of the network adapters installed on the physical computer. In this case, the virtual machine is treated as a stand-alone computer on the network and should be configured in the same way as a real one. You can choose the physical adapter where the virtual machine adapter will be bridged in the drop-down list below the Bridged Ethernet option.

  •     Host-Only Networking. Select this option to allow the virtual machine to connect to the physical computer and the virtual machines residing on it and to make it invisible outside the physical computer.


Configuring the adapter type through the Vagrant file did not work as it created a third adapter and was ineffective.

But changing manually the NIC adapters in the VirtualBox VM setting and using • Paravirtualized network adapter (virtio-net) finally gave the best results


A word about false-positive and false-negative test-results, and why having a 'negative test-result' means 'passing the test'

Both “false-positive” and “false-negative” test-results exist.

1/ Positive and Negative tests-results


First, notice that the usual phrasing is “one is taking a test”, or “one is being tested for something”. One is “positive” for anomalies just like one is “positive” for alcohol, narcotics, drugs, disease, pregnancy, driving speed limit or amounts of goods at the customs: ie. typically some output values are above or below average. In everyday life, tests usually measure the concentration of a given chemical compound, or goods, or speeds; it’s the same for software: except that instead of chemical compounds or goods, we have file system objects, and we also have durations, speeds, loads, etc.

So, when software is taking a test, software is tested “for” regressions. Just like a chemical-test might reveal the presence of a molecule in your blood, a regression-test might reveal some incoherent or wrong behavior coming from the system-under-test. Therefore a “positive” test-result is a test-result that causes the test to appears, in first instance, and without further investigation, as “failed”.

By symmetry, a “negative” test-result is a result that did not detect any anomalies; the test is then usually considered as “passed”.

2/ False test-results

A “false-positive” test is a test that first appeared as “failed” but was later proven to be insignificant (eg. just like you would be first tested positive for something after saliva, or urine test, and later dismissed upon running more precise, blood tests).

Finally, “false-negative” tests are much more rare in practice: those are tests that did not catch an anomaly but should have. One can tell a test is a false-negative whenever one finds a problem that was not reported in the test covering the use-case.

In a nutshell:

Positive test-result = Anomaly detected = Failed test
Negative test-result = No anomaly detected = Passed test
False-positive test-result = Anomaly detected but no problem found after further investigation.
False-negative test-result = No anomaly detected and yet there was a bug.