Can't ping between two guest OS in Virtualbox

Choose Bridged Adapter for the connection of all VMs; the Windows VM will come up connected, while in Kali, after booting, issue the commands

   ifconfig eth0 up
   dhclient eth0

That's all.

Edit:

The above works if the host is connected to a LAN, because both VMs will then get the necessary information (IP address, router's IP address, DNSs) from the LAN router.

If the host is not connected, you will need Host only network. Before configuring this in a VM, you must go to the panel File -> Preferences -> Network, select Host only Networks, click on the Plus sign, then the screwdriver. Under Adapter, choose:

  Ip address 192.168.56.1
  IPv4 Network Mask: 255.255.255.0

Then go to DHCP server, and choose:

  Enable Server (tick!)
  IP address 192.168.56.254
  Server Mask 255.255.255.0
  Lower Bound 192.168.56.100
  Upper Bound 192.168.56.200

Save, then go to your VM panel, choose for the Network adapter Host only. There is no need to configure the Advanced Options. Start your two VMs; Windows will already be connected, for Kali you will need to issue the same two commands as above, i.e.:

  ifconfig eth0 up
  dhclient eth0

At this point you will be connected to the Host; the host will be 192.168.56.1, and the two VMs 192.168.56.100 and 192.168.56.101 (which is which, between Windows and Kali, depends on which comes up first).

Just in case: you may also have two or more adapters on each VM, so that you can have simultaneously the Bridged adapter (or NAT) that connects you to the world, and the Host-Only adapter that connects to the host and to the other VMs. This however requires that you learn how to handle several connected adapters on Windows and Linux. It is not difficult, but it does require you to do some work.


Source Network Address Translation (NAT):

The "router", in this case, is the VirtualBox networking engine, which maps traffic from and to the virtual machine transparently. In VirtualBox this router is placed between each virtual machine and the host. This separation maximizes security since by default virtual machines cannot talk to each other.

If you are running a version greater than Virtualbox 4.3.0 (source) you can use the new NAT network option in the network dropdown. Networking improvements: A new Network Address Translation (NAT) option allows virtual machines to talk to each other on the same host, and communicate with the outside world

For earlier versions, internal network or host-only network is your choice. If you don't mind your VMs to be on the same physical network your host is connected to then you can use bridged adapter too.


You need to configure TWO network interfaces. First, Host-only, so that the VMs could talk to the Host (the VM IP address will be 192.168.56.). Second one, a bridged connection. This will allow you to connect the VM to the external world, as well as to each other, irrespective of whether they are on the same or different hosts. This will have an IP address something like 192.168.1.. You must use this second IP for your pings or Telnets etc, which will allow you to connect the VMs to each other.