Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hostfile on host not updated on destroy of a running machine #159

Open
EvanK opened this issue Jul 30, 2015 · 4 comments
Open

Hostfile on host not updated on destroy of a running machine #159

EvanK opened this issue Jul 30, 2015 · 4 comments

Comments

@EvanK
Copy link

EvanK commented Jul 30, 2015

Vagrant: 1.7.2
Hostmanager: 1.6.0
Provider: Virtualbox 4.3.30
Host OS: OSX 10.9.5
Guest OS: Ubuntu 14.04


On vagrant up, the hostfile entries are created on both host and guest, but on vagrant destroy (without halt, suspend, or any other machine action), the entries are not removed from the host.

The relevant lines from my Vagrantfile:

Vagrant.configure("2") do |config|
  config.hostmanager.enabled           = true
  config.hostmanager.include_offline   = true
  config.hostmanager.ignore_private_ip = false
  config.hostmanager.manage_host       = true

  config.vm.box = "ubuntu/trusty64"

  config.vm.define :local do |box|
    box.vm.hostname = "local.site1.com"

    box.vm.network :private_network, ip: "192.168.12.126"
    box.vm.network :forwarded_port, guest: 22, id: 'ssh', host: 2126, auto_correct: true
  end

  config.vm.provision :hostmanager
end
@oddwheel
Copy link

+2 here
Doesn't clean host OS hosts file
OS X 10.9.4
Windows 7 x64

@HadesArchitect
Copy link

I can confirm it.

@radub
Copy link

radub commented Oct 13, 2015

Vagrant: 1.7.4
Hostmanager: 1.6.1
Provider: Virtualbox 5
Host OS: OSX 10.11
Guest OS: Ubuntu 14.04

/etc/hosts file is updated when running either vagrant up or vagrant destroy
This is my Vagrantfile https://github.com/radub/roadster/blob/master/Vagrantfile

@m3nt0r
Copy link

m3nt0r commented Jun 14, 2016

I have the same problem on OSX.

Along with the sudoers mod, i even gave write permissions to myself on /etc/hosts just to be sure.

sudo chmod +a "$USER allow read,write" /etc/hosts

.. because it looks like it is trying to remove itself in both places (guest and host), but it just won't do anything. My guess was permission problems, though it does write on "vagrant up" so i don't think that is the case.

==> default: Forcing shutdown of VM...
==> default: Destroying VM and associated drives...
==> default: Updating /etc/hosts file on active guest machines...
==> default: Updating /etc/hosts file on host machine (password may be required)...

The entry remains.

Vagrant: 1.8.1
Hostmanager: 1.8.1
Provider: VirtualBox 4.3.6
Host OS: OSX 10.11.3
Guest OS: Ubuntu 14.04 trusty32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants