Multiple Virtual Computers in Minutes – Vagrant Multimachine

You can install multiple virtual computers in minutes.
This example shows how to install two Ubuntu 16.04 virtual machines and configure SSH – in a couple minutes.
The computers are created for Puppet master-slave practice, as shown by the names of the machines.

Vagrantfile

$ cat Vagrantfile
# http://TeroKarvinen.com/
Vagrant.configure(2) do |config|
 config.vm.box = "bento/ubuntu-16.04"
 config.vm.define "slave01" do |slave01|
   slave01.vm.hostname = "slave01"
 end
 config.vm.define "slave02" do |slave02|
   slave02.vm.hostname = "slave02"
 end
end

Boot the Machines

$ vagrant up

Connect

You can ssh to each machine with

$ vagrant ssh slave01

And you’re in

vagrant@slave02:~$

See also

Vagrant documentation: Multi-Machine
Install Ubuntu Virtual Machine in Minutes with Vagrant

Adminstrivia

Fixed loop variable in Vagrantfile. Now you can ssh to slave01 and slave02, two different computers.

Posted in Uncategorized | Tagged , , , , , , , , , | Comments Off on Multiple Virtual Computers in Minutes – Vagrant Multimachine

Comments are closed.