Ok, after more testing, I'm a little closer. If I edit /etc/network/interfaces to combine all dns-nameserver lines into one line.
dns-nameservers <ip1> <ip2> etc. Then run `systemctl restart networking.service`, the ssh session breaks, and `vagrant ssh xenial` shows the `The provider for ... is not ready ...` message. If I log into the vm via virt-manager, and run `ifup eth0`, I can vagrant ssh into it again, and my new dns settings will be applied. So, how can I automate all of that? Provisioning will break as soon as I run the `systemctl restart networking.service` and eth0 goes down. - David On Tuesday, August 20, 2019 at 12:40:10 PM UTC-7, David Reagan wrote: > > There is a known issue <https://github.com/lavabit/robox/issues/11> with > the robox generic boxes where the hardcoded dns servers prevent internal > dns from resolve. In my case, I have an Ubuntu mirror that I need to be > able to talk to. (I'm testing Ansible configuration against vagrant vms.) > > I was able to fix my Bionic vm with help from this comment: > https://github.com/lavabit/robox/issues/11#issuecomment-443289393 I just > write and apply the proper netplan config via a shell script provision. > > I haven't been able to get my Xenial vm to work. > > xenial.vm.provision "shell", inline: "sed 's/4\.2\.2\.1/10\.16\.0\.25/' > /etc/network/interfaces ; ifdown --exclude=lo -a && ifup --exclude=lo -a " > > Causes the vm to stall when running `vagrant up xenial`. Likely because > the ifdown command stops both network interfaces... > > After manually editing /etc/network/interfaces, restarting networking > services doesn't help. networking, systemd-resolvconf, etc. I thought the > ifdown and ifup commands would work, but testing just now shows they don't. > > So, how can I add an internal dns server to a generic/ubuntu1604 based vm > during the initial `vagrant up` process? > > As a side note, I'm not sure what it says that I've not had to restart > networking on Xenial very much when I've been running a few of them in > production for years.... Or that I haven't been able to find a solid answer > on how to modify dns servers on Ubuntu 16.04 just in general... Hrm... > > Any help is appreciated. > -- This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list. GitHub Issues: https://github.com/mitchellh/vagrant/issues IRC: #vagrant on Freenode --- You received this message because you are subscribed to the Google Groups "Vagrant" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/b61c5035-db7c-4908-984a-1b3b84e40850%40googlegroups.com.
