I'm running Vagrant 1.7.2 with VirtualBox 4.3.28 in an ArchLinux host. VirtualBox kernel modules are all loaded as explained here.
The issue is that the network interfaces that Vagrant creates for private networking aren't properly setup. They are always created without an IPv4 address and sometimes they are even down.
$ ip addr
vboxnet0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 0a:00:27:00:00:00 brd ff:ff:ff:ff:ff:ff
The solution is to manually set up the interface and add a proper address.
$ sudo ip link set vboxnet0 up
$ ip addr
vboxnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000
link/ether 0a:00:27:00:00:00 brd ff:ff:ff:ff:ff:ff
inet6 fe80::800:27ff:fe00:0/64 scope link
valid_lft forever preferred_lft forever
$ sudo ip addr add 172.18.0.1/16 dev vboxnet0
$ ip addr
vboxnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000
link/ether 0a:00:27:00:00:00 brd ff:ff:ff:ff:ff:ff
inet 172.18.0.1/16 scope global vboxnet0
valid_lft forever preferred_lft forever
inet6 fe80::800:27ff:fe00:0/64 scope link
valid_lft forever preferred_lft forever
Most likely it's a bug in VirtualBox because creating host-only networks from VirtualBox's preferences panel has the same effect:
$ ip addr
vboxnet1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 0a:00:27:00:00:01 brd ff:ff:ff:ff:ff:ff
$ sudo ip link set vboxnet1 up
$ ip addr
vboxnet1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000
link/ether 0a:00:27:00:00:01 brd ff:ff:ff:ff:ff:ff
inet6 fe80::800:27ff:fe00:1/64 scope link
valid_lft referred_lft forever
But I don't know if that's VirtualBox expected behavior when creating interfaces and they should be set up afterwards from somewhere else or if it's just a bug.
Might be the same issue as #5737, but I'm not entirely sure.
To create the interfaces, Vagrant shells out to VBoxManage to create them. This is very likely a bug with VirtualBox rather than Vagrant. However, if you made a PR to fix this, I'd be more than happy to take a look.
Everything points to it being VirtualBox's issue but some weird behaviors make it unclear. Mostly the fact that even with a broken interface I can vagrant ssh into the machine but I can't just ssh from the console until the interface is fixed.
I hoped that someone from Vagrant's community had some insights about the source of the issue, but if Vagrant just shells out to VBoxManage I guess that there's not much more to do other than reporting the issue to VirtualBox.
If you have any recommendation about reporting this to VirtualBox please let me know.
I think this has to do with virtualbox using ifconfig rather than ip for setting up the network. I was able to solve the problem by installing net-tools.
That did the trick, thank you so much @mjuopperi.
I use the same system like @matiasgagliano and I guess, I had the same problem today after updating my VirtualBox. After checking my interfaces with ip addr, there where broken and I can fixed it with the same solution. I'm not an expert on this area, but maybe vagrant also needs soon and update to fix this behavior.
@reneroboter Same issue today after updating my Archlinux. Had to create a small script to force enabling all host-only interfaces (with ip link set <if> up).
Still an issue for me running under Arch:
$ ifconfig -a | grep "^vboxnet" | wc -l
46
$ ifconfig -a | grep "^vboxnet" | grep UP | wc -l
1
$ ifconfig -a | grep "^vboxnet" | grep -v UP | wc -l
45
I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Most helpful comment
@reneroboter Same issue today after updating my Archlinux. Had to create a small script to force enabling all host-only interfaces (with
ip link set <if> up).