vagrant-hostsupdater icon indicating copy to clipboard operation
vagrant-hostsupdater copied to clipboard

DHCP / Dynamic IP

Open njt1982 opened this issue 10 years ago • 6 comments

Am I correct in thinking this plugin does not work for networks that use DHCP?

eg:

  config.vm.network "private_network", type: "dhcp"

njt1982 avatar Jan 12 '15 13:01 njt1982

Seems not - have got around this by using the HostManager plugin instead as that allows us to extend the ip resolver:

  if Vagrant.has_plugin?("vagrant-hostmanager")
    config.hostmanager.ip_resolver = proc do |vm, resolving_vm|
      if vm.id
        `VBoxManage guestproperty get #{vm.id} "/VirtualBox/GuestInfo/Net/1/V4/IP"`.split()[1]
      end
    end

    config.hostmanager.enabled = true
    config.hostmanager.manage_host = true
    config.hostmanager.ignore_private_ip = false
    config.hostmanager.include_offline = true
    config.hostmanager.aliases = [ "wibble.dev" ]
  end

This, of course, assumes VirtualBox as the host. See: https://github.com/smdahlen/vagrant-hostmanager/issues/86

njt1982 avatar Jan 12 '15 14:01 njt1982

@njt1982 I am looking at contributions to get dhcp working well with vagrant-hostsupdater

cgsmith avatar Nov 04 '15 02:11 cgsmith

Would be great if this could be supported. For now I also recommend the solution @njt1982 suggests, thanks.

iampuma avatar Jan 17 '16 20:01 iampuma

This has been open since 2015. Does host manager work better still?

J7mbo avatar Mar 23 '17 09:03 J7mbo

This has been open since 2015. Does host manager work better still?

Nope.

dincho avatar Mar 23 '17 13:03 dincho

Still looking for PRs or attempts at this! I haven't had time yet but feel it would be a great addition to the project.

cgsmith avatar Jul 19 '17 17:07 cgsmith