> ## Content Index
> Fetch the complete content index at: https://scriptcrunch.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# How To Launch Multiple VM's With Single Vagrantfile
- URL: https://scriptcrunch.com/launch-multiple-vms-single-vagrantfile/
- Published: 2017-12-14T19:41:45.000Z
- Updated: 2026-06-23T08:56:15.000Z
- Author: Scriptcrunch Editorial
- Tags: #Migrated-1758801465347, #wp, #wp-post, #Import 2025-09-25 11:57

Often times you might want to launch more than one VM of a related application with different configurations. In this case, you don't have to create multiple [vagrant](https://scriptcrunch.com/tag/vagrant/) configurations. You can use a single Vagrantfile with multiple configurations as shown below. The best part is you can start VM's individually rather than starting all VM's at once.

An example configuration which launches three VM's is shown below.

Vagrant.configure("2") do |config| config.vm.provision "shell", inline: "sudo yum update -y" config.vm.define "master" do |master| master.vm.box = "bento/centos-7.1" master.vm.network "private\_network", ip: "192.168.5.2" master.vm.hostname = "master" master.vm.provider "virtualbox" do |vb| vb.memory = "2048" vb.cpus = "2" end end config.vm.define "node1" do |node1| node1.vm.box = "bento/centos-7.1" node1.vm.network "private\_network", ip: "192.168.5.3" node1.vm.hostname = "node1" node1.vm.provider "virtualbox" do |vb| vb.memory = "2048" vb.cpus = "2" end end config.vm.define "node2" do |node2| node2.vm.box = "bento/centos-7.1" node2.vm.network "private\_network", ip: "192.168.5.4" node2.vm.hostname = "node2" node2.vm.provider "virtualbox" do |vb| vb.memory = "2048" vb.cpus = "2" end end end

To start the VM's, open the terminal and browse to the location which contains the Vagrantfile. execute the following command to bring up the VM's.

vagrant up

To [ssh](https://scriptcrunch.com/ssh-concept/), you can use the individual VM names mentioned in the configuration.

For example,

vagrant ssh master