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 , , , , , , , , , | Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

*

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

  • Picks

  • Boxing Clock for AndroidOcton8 Diving T-ShirtsShaking Tower Panda Android GameLearn Chinese with Android
  • Student projects