Accessing localhost from virtual machine

Beniamin Szabo picture Beniamin Szabo · Sep 12, 2013 · Viewed 21.4k times · Source

I have installed a virtual machin with Windows XP using Virtualbox and i want to acces the localhost from it (i am using Wamp Server). Is it possible? I am using Windows 7 on mi computer.

Answer

Fred K picture Fred K · Dec 16, 2014

This solution works on Mac OS X: open IE and simply enter the URL http://10.0.2.2:8888 (8888 is the Apache port, in MAMP is 8888).

Also, for a better solution: open your hosts file in C:\WINDOWS\system32\drivers\etc and add this line:

10.0.2.2    localhost

For a more comprehensive explanation check this link.