If you can’t ping between two guest OS in VirtualBox (two Debian 9.1 in my example) try:
- Change the network adapter to “Bridged Adapter” on both virtual machines.
- Turn Off the Wired Connection and then Turn On on each virtual machine.
Now the virtual machines can ping between them and, of course, it can access to the exposed services like Apache, nginx, MySQL,…