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.
don't forget sudo!! – Andy – 2014-07-15T16:42:59.243
I gave Bridged adapter for both the VM and I choose eth0 for both Bridged adapter.Right now my Host machine is not connected to any network.The windows VM came up but the Kali VM shows network disconnected..Is it may be coz the host network is down.? – 3lokh – 2014-02-02T19:31:29.137
@Nikhil It's due to the fact that the host machine is not connected. What I wrote works only in this case, because bridged adapter means the VMs will get IP address, gateway address and DNSs from your home router. If you want to connect them when the host is not connected, just le me know, I'll show you how. – MariusMatutiae – 2014-02-02T19:49:58.323
Thanks for the reply Marius, can you tel me how to connect between two VM when is host is not connected..? I'm actually doing an academic project which wants me to run an exploit from metasploit framework in Kali VM with Win XP VM as target..So i just need both VM's connected.. – 3lokh – 2014-02-02T19:54:15.980
@Nikhil Please see the edit to my post – MariusMatutiae – 2014-02-02T20:16:51.410
Hi Marius, In the Network->Adapter 1 I selected 'Attached to:Host-Only Adapter' but in 'Name' field below it shows 'Not Selected', i have no items to select there, show it shows invalid settings...can't save it – 3lokh – 2014-02-03T05:16:05.413
@Nikhil You need to complete the part on the File panel, first. – MariusMatutiae – 2014-02-03T06:06:02.577
@MariusMatutiae....Thanks a lot...It worked !!!....I actually got confused about where to look for the file panel, finally got it from Virtualbox Menu.. – 3lokh – 2014-02-03T06:50:35.097