1

I am unable to access applications running on my host machine via localhost on my guest machine. I have reviewed this question, and tried to implement several answers but I am unable to access localhost in XP and Windows 8 (Windows 7 works fine).

My configuration on the all of the virtual boxes:

  • VirtualBox: I have 1 network adapter, which is set to NAT
  • OS: I have added 10.0.2.2 localhost to C:\WINDOWS\System32\drivers\etc\hosts
  • An application running at :4567 on my host machine is accessible in the guest machine via http://10.0.2.2:4567 but not http://localhost:4567

I have several large applications interacting with the application I am currently testing that all hard code resources to localhost, so using anything but localhost is not going to work. I understand that this is not ideal, but I don't have the time to make things more flexible at the moment :\

Community
  • 1
  • 1
Nick Tomlin
  • 28,402
  • 11
  • 61
  • 90

1 Answers1

0

If you only need a quick workaround, you only have to install an Apache HTTP server on the guest acting as a reverse proxy towards the host. The config should be something like :

<VirtualHost *:4567> 
# 
ServerName localhost
ProxyPass / http://10.0.2.2:4567/
ProxyPassReverse / http://10.0.2.2:4567/
#
</VirtualHost>
Serge Ballesta
  • 143,923
  • 11
  • 122
  • 252
  • You make a good point. Ideally I wouldn't want to proxy something like this, but I will go this route if there are no other options. – Nick Tomlin Aug 26 '14 at 17:36