Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is there a way to get 127.0.0.1 to route to the host computer (the one running the virtual machine, not the virtual machine itself)? I am supporting a web app that sometimes requires 127.0.0.1 to be the ip address, and NOT the 10.222.54.2 number I am getting for the host address at the moment.

Thanks!

share|improve this question

2 Answers 2

up vote 1 down vote accepted

You confused me. where are you running the web app ? Inside or outside VM ? you can forward packets with destination 127.0.0.1 to host's ip but propably you 'll break something if you do that.

If you are totally sure that it's the only way, you should better change the value in /etc/hosts from localhost 127.0.0.1 to localhost 10.something Which means that anything which are destined to "localhost" will go to host's ip (If something has destination 127.0.0.1 it will go to the virtual machine)

share|improve this answer
    
The web app is running in OS X. The browser (IE8 specifically) in inside the Guest OS, XP. Some parts of the web application don't allow for "localhost" and instead of require 127.0.0.1 So I can't do a usual override of localhost equaling something else. –  bobber205 Aug 20 '10 at 17:17
    
Unfortunately i can't help with windows :< If it was linux i 'll tell you to use iptables and forward the packets to host's ip. But for windows i don't know. You could look for windows routing application ... or something like that –  Nikolaidis Fotis Aug 20 '10 at 17:20
    
Found an app called NetworkActiv AUTAP that works well. ^_^ –  bobber205 Aug 20 '10 at 17:30

That defies the very definition of localhost or the loopback IP. No, there is no way to do that.

-Waldo

share|improve this answer
    
I sure can route a specific port on localhost to another IP. –  bobber205 Aug 23 '10 at 15:54
    
That sounds more like an ssl tunnel than redefining 127.0.0.1 It probably solves the problem that you were asking about, but it's not what I thought you were asking. (my bad.) –  gWaldo Aug 23 '10 at 19:44

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.