Networking between VMWare & VirtualBox guests

2

0

I'm trying to set up a small virtual lab consisting of both vmware and virtualbox guests, and can't connect from/to the vmware guests.

  • The virtualbox guests are using the host-only network adapter, and get IPs in 192.168.56.0/24 via DHCP.
  • The vmware guests are using bridged network connection (bridged to virtualbox host only adapter), and get IPs in 192.168.56.0/24 via DHCP.

The following connections are working:

  • Host <-> virtualbox guests
  • virtualbox guests <-> virtualbox guests
  • vmware guests <-> vmware guests

If I run tshark on the vb guests, I can see broadcast traffic from the vmware guests, however no direct connections are working. Using netdiscover/arp on the vb guests, I can see entries for all guests. On the vmware guests however, most arp entries show (incomplete)

arp entries on the vmware guest: arp entries on the vmware guest

Any idea why direct connections from/to the vmware guests are not working? I'm using VirtualBox 5.1.8 and VMWare Player 12.5.1

Edit: This is the guide I followed when setting up the network: How to Setup Network Between VirtualBox and VMware Virtual Machines.

twobeers

Posted 2017-02-05T17:42:29.260

Reputation: 81

Questions: (1) Are all firewalls off? (2) What happens when all VMs are set to use directly the physical adapter? (3) Have you tried static IP addresses ? – harrymc – 2017-02-08T18:34:13.510

So do you need to get this to work then Host <-> vmware guests? It could be virtualbox guests <-> vmware guests? Let's ensure it's clear what you're trying to accomplish here that you cannot please. You give the examples of what is working but no example in this same context to show what you'd like to work which is not... I know you say "can't connect from/to the vmware guests" but that's kind of vague. It's hard to stop @twobeers though man!! – Pimp Juice IT – 2017-02-08T21:45:44.757

@Walmart I want to be able to make the following connections: virtualbox guests <-> vmware guests and optionally also host <-> vmware guests – twobeers – 2017-02-09T07:10:37.910

@harrymc (1) yes all firewalls are off (2) I want the VMs to be isolated from the physical network, so I won't attach them directly (3) yes I did, no change with static addresses – twobeers – 2017-02-10T09:41:37.943

I'm starting to think that VMWare & VB cannot connect their adapters so you need to use a 3rd party. For example use Hamachi to setup a private VPN for the VMs. – harrymc – 2017-02-11T18:03:35.277

Answers

4

Change your Virtualbox guests to use bridge networking. That way everything will be on the same LAN.

Charles Burge

Posted 2017-02-05T17:42:29.260

Reputation: 1 792

They are already on the same LAN, using the virtual network adapter "virtual box host-only network", with direct connection to this network for the virtual box vms, and bridged connection to this network for the vmware vms. – twobeers – 2017-02-05T22:03:31.430

Just so I understand correctly, are you running Virtualbox and VMware together on the same host? If so, why? Why not just use one hypervisor for all guests? – Charles Burge – 2017-02-08T00:00:09.020

I'm running VirtualBox and VMWare on the same physical host (Windows 7). I'm using preconfigured VMs from different sources, therefore the need for two different hypervisors. According to the guide I linked in my question, it should be possible to set up networking between these two. – twobeers – 2017-02-08T07:36:46.993

1@twobeers No, your machines are not on the same network: you are only (wrongly!) dishing out IP addresses from the same subnet, that's all. Just check your routing table to see the mess you created: how can your kernel decide thru which interface to route packets for, say, 192.168.56.103? That of Virtualboxo or that of VMWare? Charles Burge's suggestion works perfectly well. +1 from me. – MariusMatutiae – 2017-02-12T17:03:22.330

@MariusMatutiae In the most simple setup, I have 1 virtual box vm, only attached to the VB HostOnly adapter, and 1 VMWare VM, bridged to the VB HostOnly adapter. Both get IPs via dhcp in the same /24 range. On the virtual box vm, I can see the broadcast traffic (dhcp, arp) from the vmware VM, is this possible if they not on the same lan? the routing table has only 1 entry, dst:192.168.56.0 gw:0.0.0.0 iface:eth0 – twobeers – 2017-02-12T18:07:39.593

@CharlesBurge I will try out your suggestion. Which network adapter should I select for the "bridge networking" mode in virtual box? Which network connection mode should I use for the VMWare VMs? – twobeers – 2017-02-12T18:11:55.017

@twobeers: that's 8exactly* what I am saying: the kernel knows one routing rule, hence it correctly routes packets whenever that rule applies, and does not route the packets in the opposite direction. – MariusMatutiae – 2017-02-12T18:44:02.190

I'm not as familiar with VMware as I am with Virtualbox. If it has a bridged mode that works like bridged mode in Virtualbox, then use that. The idea is that all of the guests and the host are all on the same subnet. Like MariusMatutiae said, just because some machines have the same address schema doesn't mean they're actually on the same network. They need to be actually connected to each other. Bridged networking across the board will do that. – Charles Burge – 2017-02-13T02:21:41.323

@CharlesBurge I tried using Bridged networking (bridged to wireless/ethernet), however this does not work a) if there is no network connection on wireless/ethernet b) if the network connection is restricted (e.g. enterprise network, no network acess for arbitrary network interfaces). – twobeers – 2017-02-13T15:25:35.477

Well what do you mean by "it doesn't work"? Your VM's should still all be connected to each other, which is the goal, right? If something outside the host isn't connected then that is by definition an upstream problem. – Charles Burge – 2017-02-13T16:48:05.607

@CharlesBurge With no connection/restricted enterprise network -> no dhcp available, would require manual IP configuration for all VMs. I think it's easier to convert the VMs to virtual box, and use the builtin hostonly adapter with dhcp for all VMs. This way you have the additional benefit of isolating the VMs from the physical network. – twobeers – 2017-02-15T07:12:28.577

@twobeers Well, that's your prerogative. I've given a solution that will fix your problem. If you have reasons that you don't want to implement that solution then there really isn't much more I can say. – Charles Burge – 2017-02-15T16:06:57.043

0

Since it doesn't seem to be possible to connect from/to the vmware VMs using the VirutalBox HostOnly adapter, I used the following work-around:

  • Use VirtualBox to create a new VM using the settings from the vmx file (e.g. memory size)
  • Select the vmdk file of the VmWare VM as hard disk for the new VM
  • Set network to HostOnly adapter
  • Start VM

For a more detailed explanation including screenshots see here

Edit: Removed additonial issues not related to networking.

twobeers

Posted 2017-02-05T17:42:29.260

Reputation: 81

It is not surprising that the first configuration does not work, having the same network on two different virtual interfaces leaves the kernel in the dark as to how to reach one set of VMs, there can be only one route for a given network or two routes with different metric, which amounts to the same thing. Also, the need for PAE-NX is unrelated to this. It can all be done with routing and with netsh advfirewall. – MariusMatutiae – 2017-02-12T17:06:46.707