0

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!

bobber205
  • 241
  • 1
  • 6
  • 17

2 Answers2

1

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)

Nikolaidis Fotis
  • 1,994
  • 11
  • 13
  • 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
0

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

-Waldo

gWaldo
  • 11,887
  • 8
  • 41
  • 68
  • 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