Open rrameshbtech opened 2 months ago
Hello @rrameshbtech and others,
I am suffering this issue too. It looks like the the root cause can be in the setup-hosts.sh script:
MY_IP="$(ip route | grep default | grep -Pv '10\.\d+\.\d+\.\d+' | awk '{ print $9 }')"
When setup-hosts.sh
is executed, above returns "", not informing the MY_IP
var. This value is used in the public-ip script which is invoked by the Vagrantfile to complete the creation of the /etc/hosts file in the VMs
If you still want to use the bridge mode a quick, dirty and temporary workaround can be to setup these IPs manually in the /etc/hosts
file, inform the PRIMARY_IP
env var and set its value in the /etc/environment
file.
Funny thing is that couple of weeks ago this bridge mode was working fine for me, it seems that the setup_dns function was being executed "too early" :sweat_smile: when the VM networking (IP, gateway...) is not yet ready :thinking:
Good news are that NAT mode works like a charm :raised_hands:, so maybe this could be an option for you.
Hope it helps,
Luis
ps: nevertheless it would be nice if BRIDGE mode would work for me too (as it is the default one). My stack looks like this:
virtualbox --help
Oracle VM VirtualBox VM Selector v7.0.16_Ubuntu
$ vagrant version
Installed Version: 2.4.1
Latest Version: 2.4.1
$ cat /etc/*release*
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=24.04
DISTRIB_CODENAME=noble
DISTRIB_DESCRIPTION="Ubuntu 24.04.1 LTS"
ip -c route
default via 192.168.1.1 dev wlp2s0 proto dhcp src 192.168.1.33 metric 600
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown
192.168.1.0/24 dev wlp2s0 proto kernel scope link src 192.168.1.33 metric 600
192.168.56.0/24 dev vboxnet0 proto kernel scope link src 192.168.56.1
With this conf my VMs are running with these IPs:
vagrant@controlplane:~$ ip -c a | grep -w inet | grep -v 127
inet 10.0.2.15/24 metric 100 brd 10.0.2.255 scope global dynamic enp0s3
inet 192.168.56.11/24 brd 192.168.56.255 scope global enp0s8
vagrant@node01:~$ ip -c a | grep -w inet | grep -v 127
inet 10.0.2.15/24 metric 100 brd 10.0.2.255 scope global dynamic enp0s3
inet 192.168.56.21/24 brd 192.168.56.255 scope global enp0s8
vagrant@node02:~$ ip -c a | grep -w inet | grep -v 127
inet 10.0.2.15/24 metric 100 brd 10.0.2.255 scope global dynamic enp0s3
inet 192.168.56.22/24 brd 192.168.56.255 scope global enp0s8
Thank you in advance :pray:
I am setting up cluster using
/virtualbox/
folder. But it does not set the /etc/hosts/. The output of vagrant up belowThough I set it manually and set
ssh
. aftervagrant halt
&vagrant up
then all the ssh settings were lost. I am usingBRIDGE
mode. Any help appriciated.