Introduction
The purpose is to communicate Multiple VM with the same application hosted on all of them and act as load balancer using Docker swarm.
We will be creating two VM (OS- Ubuntu) inside Windows 10 and will communicate by deploying application in both VM. There will be one Master node, 1 worker node using Docker Swarm, and for this, we will be using Virtual BOX.
The below link explains the steps for virtual box setup.
https://www.c-sharpcorner.com/article/how-to-install-ubuntu-on-windows-10-using-virtualbox/
NOTE
Don’t get confused with VM Name because I have reinstalled Ubuntu many times with different host Name, base line assume it as two machines as VM1, VM2 that’s it.
Problem
Before jumping into link, what you keep in mind is that:
- Both VM should have different IP addresses, else when you create VM they will have same IP, and it will trouble you while communicating.
- Check Network – it should be BRIDGED
As shown below 2 VM (Docker_Host_VM1, Docker_Host_VM2 both have same IP)

You can give different IP address to VM by following this https://www.youtube.com/watch?v=gqcVjn13PCE, and then check Ubuntu > Settings here:

System Requirement to set up
STEPS
Step 1
After Virtual box set up is configured you can see 2 Ubuntu VM as shown below:

Step 2
Run following commands one by one sequentially, for docker installation and required tools in use inside Ubuntu terminal.
- apt-get install -y openssh-server
- apt-get install -y curl
- apt-get install -y vim
- apt-get update
- systemctl enable ssh
- systemctl start ssh
- sudo apt install net-tools
Visually it should look like this:











Join the conversation! Your thoughts help the community grow.