VirtualBox Networking – Can’t Ping Between Two Guest OS in VirtualBox

networkingvirtualbox

Host OS: Ubuntu 13.04
VMM: Virtualbox

Guest OS1: Kali Linux
Network Setting: Adapter 1 attached to NAT

Guest OS2: Windows XP
Network Setting: Adapter 1 attached to NAT

Issue: can't ping between guest OS.

When i checked the IP, both the guest machines have same IP address, howz that possible..? What is the required network setting i have to apply in guest OS for networking the guest os together(ping guest1 from guest2 and vice versa)

Best Answer

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.

Related Question