Thursday, July 26, 2018

VirtuaBox host only network stops working

Once in awhile, virtualbox host only network will stop working. The host will not be able to ping the guest system. Even if the removal and recreate the host only network won't help. What it really helped me was to completely shutdown my macbook machine. do a cold restart, then network started working.

The route table of the host will look like this if the routing is working.

Use this command to show the current routing related to the VB host-only network
netstat -nr | grep 192.168

192.168.56         link#17            UC              3        0 vboxnet
192.168.56.1       a:0:27:0:0:0       UHLWIi          1        6     lo0
192.168.56.3       8:0:27:15:45:66    UHLWI           0        5 vboxnet   1171
192.168.56.255     ff:ff:ff:ff:ff:ff  UHLWbI          0        3 vboxnet

When it was not working, the netstat -nr shows no entries like the above.

Regardless the host network is working or not, from the host, you won't be able to ping the gateway of the host network, for example, ping 192.168.56.1 will fail.

If not wantting cold restart the machine, do the following.

sudo route delete 192.168.56.0/24

Then delete host only network and recreate host only network, then restart VM, it will work.

For some reasons, the mac host may not show any route to network 192.168.56.0/24. when that happens, use the following procedure to get it back.

1. Delete all host-only networks from virtualbox
2. Completely shut down the mac host, then reboot the host
3. Recreate the host-only network.

At this point, mac host should show at least the following (using netstat -nr command):

192.168.56         link#17            UC              2        0 vboxnet

After you start a VM which uses host-only network, you should see the following:

192.168.56         link#17            UC              2        0 vboxnet
192.168.56.255     ff:ff:ff:ff:ff:ff  UHLWbI          0        1 vboxnet

If you actually ping the guest VM with IP 192.168.56.32, and the ping is successful, then you should see the following:

192.168.56         link#17            UC              2        0 vboxnet
192.168.56.32      8:0:27:8f:d9:5e    UHLWIi          1        3 vboxnet   1195
192.168.56.255     ff:ff:ff:ff:ff:ff  UHLWbI          0        1 vboxnet

No comments:

Post a Comment