Ubuntu: find host ip address when guest machine is connected to host



Question:

I have an XP virtual machine on an Ubuntu installation. I can connect to the internet in the guest OS(XP). Now I want to find the ip address of the host OS(Ubuntu). I can find the guest IP address in the Connection Properties in XP, but how do I find the IP of the ubuntu machine?

You should know, I want to add a DNS record in my \system32\drivers\hosts so that I can access a virtual host in my Ubuntu (apache). Using ifconfig, I can see that I have only three adapter. One is my LAN adapter(ethernet), the loopback and a wireless adapters. I have even tried the Gateway address.


Solution:1

Simply open xterm or press CTRL+ALT+F1 and write:

ifconfig  

The "inet" string is the ip. Of course this is the local IP and not the public one.
To obtain your public IP (reachable from the outside) visit www.whatismyip.com (or an equivalent web site) or enter in your router interface (it will tell you the public ip). For the hosts file there is a specific guideat www.rackspace.com.

Bye, hope you will solve.


Solution:2

Using NAT

In VirtualBox using regular NAT networking you can reach the host itself by using the gateway IP address. In Windows guest OS you can see this using the network adapter properties as shown below:

enter image description here

Host-only networking

The alternative is to connect another network adapter using "Host-only" networking as shown below.

First add a Host-only network entry in the global Virtualbox network settings:

enter image description here

Then add it to the networking settings of the guest:

enter image description here

You will then be able to reach the host at 192.168.56.1 (magic numbers here, I know!).


Solution:3

you can use nmap tool. By using it you can find the Host IP too.

assume that your IP addresses wills start from 192.168.1.1 then If you would like to see all the systems which are in the given range

nmap 192.168.1.1-255  

thats for scanning all from 1-255 range.

if you have a firewall protected host then you can use

nmap -PN 192.168.1.1-255  

hope that helps.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »