This brief tutorial shows students and new users how to enable virtual machines created on VirtualBox to communicate with each other. Since VirtualBox 5.2 was released, I have discovered some default settings that may be frustrating to students and new users.
For example, right out of the box, VirtualBox’s virtual machines can not communicate with each other while attached to the default NAT network. VMs configured with the default NAT network configurations can only get to the Internet. with no VM to VM or host IP communication.
In order to allow virtual machines to communicate with each other, you must change the VM network settings to use NAT Network. but you can’t use that network setting if you haven’t already created it. This brief tutorial is going to take the pain out of the process for students and new users.
Below is the Network table for VMs. as you can see VMs with NAT network settings can not talk to the Host, or other VMs, but can’t get to the Internet. VMs with NAT Network settings can not talk to the Host computer, but can communicate with other VMs and can’t go to the Internet.
|VM ↔ Host||VM1 ↔ VM2||VM → Internet||VM ← Internet|
|NAT Network||–||+||+||Port forwarding|
To allow VMs to communicate with each others, attach the VMs to the NAT Network settings. continue below to learn how to do that.
Step 1: Create VirtualBox NAT Network
Before you can use NAT Network settings for VM, you must first create a NAT Network interface. to do that, open VirtualBox software and click File ==> Preferences
On the Preferences page, go to Network and click Add to create a new NAT Network.
Step 2: Change Virtual Machine to use the new NAT Network
Now that the new NAT Network is created, go to each Virtual Machine and change the network settings to use NAT Network as shown in the image below
Save the VM settings and close out. Do this to all the VM that you want to enable inter-communication. After this change, all the VM that are attached to the NAT network should be able to communicate with each other and also get to the Internet.
This should probably be the default settings for a VMs created on VirtualBox.
You may also like the post below: