Vagrant.configure("2") do |config| config.vm.box = "ubuntu/focal64" (0..1).each do |i| config.vm.define "metal#{i}" do |metal| metal.vm.network "private_network", ip: "192.168.50.#{i+2}" end end config.vm.provider "virtualbox" do |vb| vb.cpus = 2 vb.memory = "4096" end config.vm.provision "file", source: "~/.ssh/id_rsa.pub", destination: "/tmp/id_rsa.pub" config.vm.provision "shell", inline: <<-SHELL apt-get update mkdir /root/.ssh cat /tmp/id_rsa.pub >> /root/.ssh/authorized_keys SHELL end