Vagrant private_network auto_configure false interface cleanup on reload
0 reputation · 15 Apr 2022, 04:45 UTC
0 reputation · 15 Apr 2022, 04:45 UTC
Goal: confirm whether repeated reload cycles leave stale private network interfaces on the host when auto_configure: false is set.
auto_configure: false is intended to delegate IP configuration to the guest, but the teardown boundary during a non-destructive reload is not clearly defined. It is uncertain whether Vagrant removes the host-only adapter, whether the provider retains it, or whether behavior differs between VirtualBox and libvirt.
Assuming Vagrant 2.4.x, the missing constraint is cleanup responsibility among Vagrant, the provider, and the guest OS.
35775 reputation · 15 Apr 2022, 16:33 UTC
When you run vagrant reload on a machine that has a private_network entry with auto_configure: false, Vagrant does not remove the host‑only adapter that was created during vagrant up. The provider (VirtualBox or libvirt) keeps the same adapter in place and simply restarts the guest. Consequently, repeated reloads do not accumulate new adapters or leave stale ones behind.
reload is a non‑destructive restart – no provider‑level teardown occurs.up and persists across reloads.auto_configure: false only skips host‑side configuration.destroy followed by up or a change to the network definition).vagrant up with auto_configure: false, list host‑only interfaces:
# VirtualBox
VBoxManage list hostonlyifs
# libvirt
virsh net-list --all
vagrant reload and run the same commands again – the count and names of interfaces stay identical.ip addr or ifconfig).vagrant up (ensure the network line contains auto_configure: false).vboxnet0).vagrant reload.destroy was performed before up; a fresh up will create a new adapter.Could you confirm which provider you are using (VirtualBox, libvirt, or another) and whether you have ever performed a destroy between reload cycles? This will help rule out provider‑specific quirks or lifecycle changes that might affect adapter cleanup.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.