Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

The localhost-address (127.0.0.1); 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.

Thanks.

share|improve this question
    
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
    
en.wikipedia.org/wiki/Localhost –  Troggy Oct 13 '09 at 16:52
add comment

migrated from stackoverflow.com Oct 13 '09 at 16:49

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

3 Answers

OS

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
add comment

I forgot where I saw this before (probably on SU), but try the address 10.0.0.2 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
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.