3

I have a MacOS X Mavericks host running Vagrant using VirtualBox as a provider. I have experienced several times that with different VMs (particularly Ubuntu Linux VMs) after the first time the VM is brought up host-only networking will not work.

Most recently I was running a Vagrant avenuefactory/wordpress VM. It was configured to have two adaptors #1 NAT and #2 Host-only 192.168.10.10/24. The VM brings up WordPress when started. Very nice except the Mac cannot see it until after I restart the whole machine. Both sides see the 192.168.10.0/24 network. Neither side can ping the other. ifconfig on both sides shows the shared network interface vboxnet0. From either side pings result in timeouts.

On the host I have tried the following:

  • Restarting each VM and VirtualBox.
  • ifconfig <interface> down followed by ifconfig <interface> up for all IP interfaces.
  • scutil -r 192.168.10.10 says the host is reachable. This is true but not useful.
  • route add 192.168.10.10 192.168.10.1 -iface vboxnet0 adds a route successfully
  • killall -HUP configd (manually sending a Hangup interrupt to the configd process to reset the network (and just about everything else) does nothing.
  • logging out and back in the user does nothing.
  • restarting the whole machine works every time, and then it's like nothing has changed but now it suddenly works. But the next time I start up a new VM, or when I quit VirtualBox and restart all the VMs, or just randomly, this situation can recur.

On the host:

# ifconfig vboxnet0 
vboxnet0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
    ether 0a:00:27:00:00:00 
    inet 192.168.10.1 netmask 0xffffff00 broadcast 192.168.10.255
# scutil -r 192.168.10.10
Reachable
# ping 192.168.10.10  
PING 192.168.10.10 (192.168.10.10): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
...
# route add 192.168.10.10 192.168.10.1
add host 192.168.10.10: gateway 192.168.10.1
# ping 192.168.10.10  
PING 192.168.10.10 (192.168.10.10): 56 data bytes
Request timeout for icmp_seq 0
...
# ifconfig vboxnet0 down
# ifconfig vboxnet0 up
# ping 192.168.10.10  
PING 192.168.10.10 (192.168.10.10): 56 data bytes
Request timeout for icmp_seq 0
...
# VBoxManage dhcpserver remove --ifname vboxnet0
# VBoxManage dhcpserver add --ifname vboxnet0 --ip 192.168.10.10 --netmask 255.255.255.0 --lowerip 192.168.10.2 --upperip 192.168.10.254 --enable
PING 192.168.10.10 (192.168.10.10): 56 data bytes
Request timeout for icmp_seq 0
...
# arp -s 192.168.10.10 08:00:27:e2:2f:1c

...and the chorus continues. So then on the ubuntu guest:

# arp -s 192.168.56.1 0a:00:27:00:00:00

...and still nothing.

I followed advice found at https://forums.virtualbox.org/viewtopic.php?f=8&t=63998# but still have the problem. I cannot believe that I have to completely restart my Mac every time this problem happens (at random). Can anybody think of some less draconian than a restart to solve this?

  • I had the same problem, but for some reason, if I enable the dhcp settings for vboxnet0, then all host adapters are working. I have configured all 4 host adapters, but only when I enable dhcp on vboxnet0, i see the host adapters and VMs on the guest are pingable. Thanks Dinesh – user191067 Sep 21 '16 at 10:38
3

This appears to work:

# VBoxManage hostonlyif remove vboxnet0

This removes the host-only network. Then restarting VirtualBox brought the interface back and it works. For now. Honestly, I don't know if I've actually found the solution or if it's just dumb luck and it will stop working in a few minutes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.