Mostly in the testing environment, you may need to set up a network between virtual machines that are running on VMware Workstation and Oracle VirtualBox. These virtual machines can be on the same host or different hosts on the physical network.
Setting up a network among VMs in the same virtualization software such as VirtualBox is easy once we understand the available network type. How about settings up a network among VMs in different virtualization software from different physical computers? This guide shows how to set up network connectivity between VirtualBox and VMware virtual machines.
Two Scenarios Considered here:
1) Both software (VMware and VirtualBox) run on the same physical computer with several virtual machines.
2) Both software run on different physical computers on the network. These two physical computers have working network connectivity.
Without migrating virtual machines to a particular desktop virtualization software, we can use the below method to set up a network connection among them, no matter where VM is hosted.
For example, if you have a domain controller virtual machine on VMware, you can join the guest virtual machines from VirtualBox to that active directory domain from the same or different host.
There are a few network types available on both software products:
- NAT and Bridged (to communicate to physical network)
- Host-only type for the network between guest and host,
- Internal type for the network among virtual machines.
Scenario 1: Network Between VirtualBox & VMware VMs – On the Same Host
When a physical network is available on your computer, for example at the office, you do not need to connect virtual machines with the office network for security and testing purposes. So, setting up a bridged network with the physical network card where DHCP is enabled is not a good idea, because it may conflict with your office network.
The next option is to use ‘VirtualBox host-only adapter’ and bridge it with VMware Workstation.
1) Make sure to enable the ‘VirtualBox Host-Only Ethernet Adapter’ DHCP service. This option can be accessed from the File menu and “Host Network Manager” in the VirtualBox console.
2) Set the network type as ‘Host-only Adapter’ in VirtualBox virtual machine settings. Modify the same network settings for the VMs that need to communicate to VMware.
3) By default, the VirtualBox host-only adapter will be issuing IP addresses (as DHCP server) to clients. You can keep the same DHCP series or change it or even disable DHCP and assign IPs manually for the VMs.
4) Navigate to VMware Virtual Network Editor now. This option is available with VMware workstation versions only. VMplayer doesn’t have this option.
NOTE – When using VMware Player, you can select the ‘Bridged Network’ type for the virtual machine on VMware. This will not create any issues when the physical network adapter is not active or DHCP is not available on the physical network. If DHCP is available on LAN, then the VMware virtual machines will get IP from the physical LAN network instead of from the VirtualBox host-only adapter. In this case, you must use manual IP on all VMs in VMware and VirtualBox.
Changing ‘Automatic’ to VirtualBox Host Only Adapter network type will separate VMs network from physical LAN. VMnet0 is configured with the above settings in my environment.
5) In the network settings of the VMware virtual machine, change the network type to custom and point it to the network name you modified in the above step (VMnet0)
6) Now the guest VMs on VMware Workstation will get DHCP IP from the VirtualBox network. Assigning manual IP in the same range also will work in this setup.
Now we have successfully set up a network between VirtualBox and VMware virtual machines.
Here is the working network connection in my lab. I can ping from Windows OS (VMware) to another Windows OS (Oracle VirtualBox). It confirms the working network connectivity between these two virtualization software.
Scenario 2: VMware and VirtualBox Running on Different Hosts
In this setup, we need to have a working physical LAN to connect virtual machines between different hosts.
1) Select bridged network type in virtual machines settings of VirtualBox. Point the network adapter to the LAN network card which is connected to another VMware host.
If DHCP is available on physical LAN, your VM will get IP automatically, otherwise provide the manual IP.
2) Change the network settings of VMs in VMware.
Go to network settings and change to the ‘Bridged’ type. This allows the particular VM to communicate to the physical network where the host computer is connected.
In this way, this VM will communicate to VirtualBox VM you configured in the earlier step. DHCP or manual IP addresses are optional depending on your network setup. But make sure that both host computers and virtual machines are in the same IP range. Also, check the Windows firewall settings before doing any network test.
You may need to open or provide exceptions for particular network ports when you want to establish network connectivity among physical computers in a network.
I used these two scenarios to configure network connections among virtual machines running on different software and different host computers. It worked well without any issues. It is the ideal way to build a test lab with multiple VMs from several physical computers when you can’t host many VMs on a single computer.