Guest ip not available when using Vagrant using private network

I have the following stray file on my windows host

Vagrant.configure(2) do |config| config.vm.provider :virtualbox do |v| v.customize [ "modifyvm", :id, "--memory", 1024, "--cpus", 1, ] end config.vm.box = "ubuntu/trusty64" config.vm.network "private_network", ip: "192.168.0.101" end 

The virtual machine starts normally, but is not accessible to the host using the "192.168.0.101" ip./etc/network/interface on the guest page

 auto lo iface lo inet loopback source /etc/network/interfaces.d/*.cfg #VAGRANT-BEGIN # The contents below are automatically generated by Vagrant. Do not modify. auto eth1 iface eth1 inet static address 192.168.0.101 netmask 255.255.255.0 #VAGRANT-END 

and / etc / network / interfaces.d / eth0.cfg

 auto eth0 iface eth0 inet dhcp 

In addition, after each launch of this firewall, a new virtual network adapter is created, and inside the Virtualbox virtual interface tool I see information about this new network - the real IP address is different and random, i.e. 169.254.173.8. I had> 20 virtual networks :) Using this guest machine IP pinged on my own too. But after rebooting vagrant a new network will be created with a new IP

How to start a vagrant machine with a static uncaught IP address? I need to create a cluster with several nodes, and each node should know about the IP of each of them

Update: Everything is fine on the Linux host. I can ping all the guests from my host, and the scrolls see each other In Windows, guests cannot ping other guests, that is, 192.168.0.101 can not see 192.168.0.102

+5
source share
1 answer

A private network is what is private to the guest (s) and is created in addition to the default NAT-ed adapter. If you have multiple guests, they can interact with each other on a private network.

As for the interacting nodes, there are a number of plugins that can help you deal with this with both the actual DNS and the simpler use of /etc/hosts . I tried several and settled on vagrant-hosts .

+4
source

All Articles