2

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.

3 Answers 3

7

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!).

1
  • Thanks for the answer dude. But I don't have any options in the Name field. What should I do???
    – Milad.N
    Oct 6, 2013 at 15:02
3

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.

3
  • That definitely was it, Thanks a lot. I though that it was the gateway of my DSL router
    – Milad.N
    Oct 6, 2013 at 15:06
  • Using the public IP to reach the host from the guest is like flying from Europe to Africa via the US.
    – gertvdijk
    Oct 6, 2013 at 15:09
  • So what would be the direct route???? Your answer?
    – Milad.N
    Oct 6, 2013 at 15:24
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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .