You can use any virtualization platform such as Oracle VirtualBox or VMware player.
While using virtual environments.
The virtual machines should be on the same network to see each other.
Now we're going to use virtual machines in Nat mode.
If you're using VirtualBox because of its architecture, you should create a Nat network.
If you use a virtual machine in net mode without configuring any Net network, a network is created
for that virtual machine and it doesn't see other virtual machines even if they are in net mode.
If you're using one of the VMware tools such as VMware Player fusion or workstation using Nat mode for
network interfaces will be enough for the virtual machines to see each other.
Oh, and I should probably tell you that since there are a lot of vulnerabilities in it, do not use
the virtual machines in bridge mode, which are intentionally vulnerable, such as Metasploitable or
Owasp, broken Web applications.
If you use them in bridge mode, they will be accessible in the network where your host machine is.
Someone in that network might hack the vulnerable virtual machines and try to access the host machine,
which means your computer.
Now, if you would like to use virtual machines and host only network mode, please just learn how the
virtualization platform works in that mode first.