I assume you have already installed vagrant and virtual box on your windows PC.
This is the vagrant file I have used to create multiple vagrant centos7 box in my private network for testing purposes.
I have used following configuration in Vagrant file
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(“2”) do |config|
config.vm.define “webserver1” do |vm1|
vm1.vm.hostname = “webserever1”
vm1.vm.box = “bento/centos-7.6”
vm1.vm.network “private_network”, ip: “192.168.33.10”
vm1.vm.provider “virtualbox” do |vb|
vb.gui = false
vb.memory = “512”
end
end
config.vm.define “webserver2” do |vm2|
vm2.vm.hostname = “webserver2”
vm2.vm.box = “bento/centos-7.6”
vm2.vm.network “private_network”, ip: “192.168.33.20”
vm2.vm.provider “virtualbox” do |vb|
vb.gui = false
vb.memory = “512”
end
end
end
Place this Vagrant file in your directory. Then use the command
#vagrant up
This will create 2 vagrant machines with linux centOS7 on your PC
You can ssh using following command
#vagrant ssh
After that if you install apache in webserver1 and if you access with 192.168.33.10 in your browser you can see that a default apache page will be loaded.