hashicorp / vagrant

Vagrant is a tool for building and distributing development environments.
https://www.vagrantup.com
Other
26.2k stars 4.43k forks source link

Replacing networkd with NetworkManager in vagrant #12805

Closed kimchitsigai closed 2 years ago

kimchitsigai commented 2 years ago

By default, vagrant seems to provision VMs with networkd as the netplan provider. Is there a way to replace networkd with NetworkManager ?

My configuration is :

My Vagrantfile is:

Vagrant.configure("2") do |config|
  config.ssh.insert_key = false
  config.vm.define "master" do |master|
    master.vm.box = "generic/ubuntu2004"
  end
  config.vm.define "worker" do |worker|
    worker.vm.box = "generic/ubuntu2004"
  end
  config.vm.network "public_network"
  config.vm.provider "virtualbox" do |vb|
    vb.memory = "3072"
    vb.cpus = "3"
  end
end

50-vagrant.yaml on master is:

---
network:
  version: 2
  renderer: networkd
  ethernets:
    eth1:

01-netcfg.yaml on master is:

network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      dhcp4: true
      dhcp6: false
      optional: true
      nameservers:
        addresses: [4.2.2.1, 4.2.2.2, 208.67.220.220]

Thanks a lot, Kimchi

chrisroberts commented 2 years ago

No, Vagrant does not have support for switch the renderer to NetworkManager. However, if the box has been pre-configured for NetworkManager as the renderer and networkd is disabled, it will then use NetworkManager.

Cheers!

github-actions[bot] commented 2 years ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.