0

I installed Kali Linux on VirtualBox recently.

I do not have an external adapter; only my internal adapter.

The problem is when I set “VirtualBox -> Settings -> Network ->Adapter1 -> NAT” I can access the Internet through the Iceweasel browser but ifconfig shows my IP address as 10.2.0.15 which is certainly not my IP address.

I tried to set Adapter 2 to Bridged Network but when I do that I cannot even access the Internet through my browser. I tried installing Compat wireless but that does not solve the problem.

I want my IP address should be either the IP of my host computer or another seperate of the guest OS. I am stuck on this problem for months.

I want to learn Metasploit but in order to build the payload I need an IP address. Hence my learning has halted.

Giacomo1968
  • 58,727
Jeetesh
  • 11

1 Answers1

1

I can access the Internet through the Iceweasel browser but ifconfig shows my IP address as 10.2.0.15 which is certainly not my IP address.

Yes, your IP address for the Kali Linux install in VirtualBox is indeed 10.2.0.15. VirtualBox has a virtual NAT server built-in to it’s software to allow for basic routing. Any basic VirtualBox install will be able to use DHCP to connect to use the host machine’s network via the NAT setup in VirtualBox.

But you say this:

I want to learn Metasploit but in order to build the payload I need an IP address.

What you are talking about is a different thing from the main IP address/interface. As explained before, any out-of-the-box install on VirtualBox will be able to use DHCP to connect to the VirtualBox NAT and get a network connection. But if you are looking for an IP address another machine/host can connect to outside of VirtualBox—such as connecting from the host machine to the Kali Linux setup you have—then what you need is a “host-only” adapter setup on another network adapter in VirtualBox in addition to your main network interface.

I have posted another answer with details on how I do this in VirtualBox for Mac OS X running an Ubuntu virtual machine, but the overall concept should be the same for your Kali Linux setup: You need to have your main NAT connected adapter setup as you already have but you also need a “host-only” adapter setup as well.

And then—as I explain in this other answer here—you could connect to your guest OS Kali Linux install from the host OS via the router address of 192.168.56.1.

Giacomo1968
  • 58,727