fgrehm/vagrant-lxc

Private network disappears after reboot

tjaacks opened this issue · 3 comments

I have configured a private network in my vagrant LXC container as follows:

config.vm.network "private_network", ip: "192.168.20.100", lxc__bridge_name: 'lxcbr1'

Aftter vagrant up the interface eth1 is correctly brought up. However, when I call sudo reboot from within the vagrant container and call vagrant ssh again, the interface is gone. Only the default interface eth0 is there. Trying to bring it up manually using sudo ifconfig eth1 up fails:

eth1: ERROR while getting interface flags: No such device

I am using Vagrant 2.1.2 with this box:

https://vagrantcloud.com/debian/boxes/stretch64/versions/9.1.0

I found out that vagrant configures eth1 AFTER the machine has booted using a vagrant-lxc-wrapper call. When the container is rebooted from inside, this step (of course) is missing. Am I correct, that the only possibility is to reboot the container using vagrant halt && vagrant up?

ccope commented

Yes, vagrant has to manage the container lifecycle in order to apply all of its settings.

Hey, sorry for the silence here but this project is looking for maintainers 😅

As per #499, I've added the ignored label and will close this issue. Thanks for the interest in the project and LMK if you want to step up and take ownership of this project on that other issue 👋