Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The localhost-address (; is this an addresses supported by the OS or is this the address for the computer?

I want to know this because I want to make a program in Java to use as a file-transfer-bridge between the main OS and a session in VirtualBox.


share|improve this question

migrated from Oct 13 '09 at 16:49

This question came from our site for professional and enthusiast programmers.

Why so many closes?? Is there a dup? – Martijn Courteaux Oct 13 '09 at 16:47
because this is the wrong place for such questions. – SilentGhost Oct 13 '09 at 16:47
Serverfault or Superuser .. unfortunately SO is not a one stop shop :) – Tim Post Oct 13 '09 at 16:49 – Troggy Oct 13 '09 at 16:52


The only "computer" address is the MAC address, but even that is specific to the network device. Your virtual box OS will most likely link to a virtual network device with a unique MAC address.

share|improve this answer
So I have to use in Java: InetAddress.getLocalHost()? – Martijn Courteaux Oct 13 '09 at 16:49
Correct, that's how you would get that address – Chris Thompson Oct 13 '09 at 16:52
In the case of a virtual machine the localhost address refers to the guest virtual machine not the host machine. There's no way inside the VM OS (without using proprietary tools) to get the host machine's address. – Chris Nava Oct 13 '09 at 17:29

I forgot where I saw this before (probably on SU), but try the address from within the virtualbox machine, it should be the address of the host machine (the real machine).

share|improve this answer
I will try that – Martijn Courteaux Oct 14 '09 at 16:53

Localhost is a reserved domain name used to refer to 'this computer' localhost will always resolve to (on IPv4). Check out Localhost and loopback.

share|improve this answer

You must log in to answer this question.

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