Skip to content
This repository

Problem with settings ip address and hostname #1504

Closed
abtris opened this Issue March 26, 2013 · 2 comments

2 participants

Ladislav Prskavec Mitchell Hashimoto
Ladislav Prskavec

I have vagrant 1.1.2 and this Vagrantfile

Vagrant.configure("2") do |config|

  config.vm.box = "precise"
  config.vm.box_url = "http://files.vagrantup.com/precise32.box"

  config.vm.provider :virtualbox do |v|
    v.gui = false
  end

  config.vm.synced_folder "data/", "/vagrant/data"

  config.vm.define :master do |master|
    master.vm.hostname = "master.vm"
    master.vm.network :forwarded_port, guest: 8080, host: 8080
    master.vm.network :forwarded_port, guest: 80, host: 3000
    master.vm.network :private_network, ip: "33.33.33.10"
  end

  config.vm.define :slave do |slave|
    slave.vm.hostname = "slave.vm"
    slave.vm.network :private_network, ip: "33.33.33.20"
  end

end

After 1st start:

  • master ok (ip: 33.33.33.10, hosts: 127.0.1.1 master.vm master precise32)
  • slave - bad (ip: 33.33.33.10 (ifconfig), hosts:127.0.1.1 slave.vm slave master.vm master precise32)

I reload, slave and ip address set correctly to 33.3.33.20. Hostname still some.

Any suggestion what's wrong?

Ladislav Prskavec

I upgrade to 1.1.4 and ip address is now correctly set. But problem with /etc/hosts are the some.

Mitchell Hashimoto
Owner

Thanks, great to hear it is working!

Vagrant doesn't manage /etc/hosts. However, if it is necessary for proper host name setting for a guest, I'm happy to merge any pull requests for the guest integration (plugin/guests in core).

Mitchell Hashimoto mitchellh closed this March 28, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.