Private networking doesn't work on Ubuntu 17.04 host: box unreachable.

19 views
Skip to first unread message

Hans Fritz

unread,
Jul 8, 2017, 10:30:29 AM7/8/17
to Vagrant
Hi,

I'm using Vagrant , VirtualBox, and a Ubuntu 17.04 host and I can't get private networking to work.
My guest Vagrant box has two interfaces (eth0 10.0.2.15, eth1 192.168.33.20) and I can reach the internet from the box; but I can't reach 192.168.33.20 from the host. I have a vboxnet0 and a vboxnet1 on the host, but both are down and have no IP.

I also can't understand why the box has two interfaces, I'm only asking for private_network with an IP of 192.168.33.20.

How do I make it so that the host can reach 192.168.33.20?

my Vagrantfile:
# -*- mode: ruby -*- # vi: set ft=ruby :
Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/trusty64"
  config.vm.network "private_network", ip: "192.168.33.20"
  config.vm.provider "virtualbox" do |vb|
    vb.memory = "1024"
  end
  config.vm.provision "ansible" do |ansible|
    ansible.playbook = "provisioning/playbook.yml"
  end
end


Hans Fritz

unread,
Jul 8, 2017, 11:16:01 AM7/8/17
to Vagrant
So it would seem this is a VirtualBox issue. Here is how to solve it:

- In VirtualBox, File > Preferences > Network > Host only, edit the vboxnet0 connection
- Don't change anything, just press "OK"
- Check that vboxnet0 now shows up when running ifconfig. if not, delete the vboxnet0 connection in the VBox prefs, readd it, and do step 1 again
Reply all
Reply to author
Forward
0 new messages