vagrant-landrush / landrush

A Vagrant plugin that provides a simple DNS server for Vagrant guests
MIT License
668 stars 78 forks source link

Network configuration remains after disabling landrush #306

Open jojoob opened 7 years ago

jojoob commented 7 years ago

If I disable landrush (config.landrush.enabled = false or removing the line completely from Vagrantfile) for a machine that had landrush previously enabled and then load the configuration with vagrant reload it takes about 3 minutes to boot the machine.

This is caused by the configuration created by landrush in /etc/network/interfaces remaining after disabling landrush:

#VAGRANT-BEGIN
# The contents below are automatically generated by Vagrant. Do not modify.
auto eth1
iface eth1 inet dhcp
    post-up route del default dev $IFACE || true
#VAGRANT-END

This causes the machine to searching for the configured network interface that does not longer exists (the additional network interface added to the machine by landrush was removed by disabling landrush):

cloud-init-nonet[3.68]: waiting 10 seconds for network device
cloud-init-nonet[13.69]: waiting 120 seconds for network device
cloud-init-nonet[123.69]: gave up waiting for a network device.
[...]
Waiting for network configuration...
Waiting up to 60 more seconds for network configuration...

Vagrant keeps showing default: Warning: Remote connection disconnect. Retrying... lines until the machine finished booting.

Is there a way to automatically remove the network configuration that landrush added?

Environment

Host: Mac OS X 10.11.6 Vagrant version: 1.8.7 Guest: Ubuntu 14.04 landrush plugin version: 1.2.0

hferentschik commented 7 years ago

This is caused by the configuration created by landrush in /etc/network/interfaces remaining after disabling landrush:

To be clear, you are talking about config on the guest, right? A couple of things here. The network configuration is really a provisioning thing, so I would not expect vagrant reload to touch this out of the box, since it does not run provisioning, unless explicitly requested.

That said, even with vagrant reload --provision the entry will persist. There is atm no inversion of this operation. You basically have to destroy and re-create the VM.

jojoob commented 7 years ago

To be clear, you are talking about config on the guest, right?

Yes.

Ok, thanks for the explanation.

You basically have to destroy and re-create the VM.

Or may it help to explicit specify the network configuration in the Vagrantfile and do vagrant reload --provision?