Vagrant 1.0.7 and a hostonly setup of centos-5.8-x86_64

22 views
Skip to first unread message

Mike Ottinger

unread,
Jun 15, 2013, 1:51:32 AM6/15/13
to vagra...@googlegroups.com
Hi folks,

  I'm attempting to build out a multi-vm setup of centos 5.8 VMs using hostonly networking to allow for the two to communicate with each other. What happens though is upon a fresh provisioning of the VM, no DNS server is available (the /etc/resolv.conf is empty) thus causing the provisioning to fail since it can't access any remote repositories. What fixes it is a vagrant reload which causes the /etc/resolv.conf to get populated thus allowing for resolving of IPs. But it's annoying that this doesn't work straight-away.

  I've looked at setting :auto_config => false which appears to introduce another set of problems. I've also tried to be clever and invoke an inline shell command to either place nameserver values in the /etc/resolv.conf or also restart the network service, none of which seems to work.

  Has anyone encountered something similar to this and if so any steps to remedy?

Thanks!

c...@lionsden.org

unread,
Jun 18, 2013, 9:40:15 AM6/18/13
to vagra...@googlegroups.com
Vagrant will always set NAT networking for eth0. To do hostonly networking you would therefor have to set private networking in the Vagrantfile as per http://docs.vagrantup.com/v2/multi-machine/index.html
Of course you may also have to set the iptables firewall rules accordingly.

As for /etc/resolv.conf ... if you allow NAT networking on eth0 of the VM and use DHCP then /etc/resolv.conf will be populated when the VM boots and enters runlevel 3. 
Reply all
Reply to author
Forward
0 new messages