Beniamin Szabo
Beniamin Szabo

Reputation: 1929

Accessing localhost from virtual machine

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.

Upvotes: 19

Views: 25615

Answers (4)

Fred K
Fred K

Reputation: 13910

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.

Upvotes: 22

Ricardo Zea
Ricardo Zea

Reputation: 10282

I know I'm late to the party, but here are some basic steps others can try in Windows 7/8 when using VirtualBox:

  1. Open a CMD (press 'Windows' key + R and type cmd, press Enter)
  2. Type: ipconfig
  3. You'll see a bunch of text, look for IPv4 Address
  4. Look all the way to the right, you'll see an IP address
  5. Type that IP address in you browser and press Enter
  6. Voilá!

Use ipconfig to find your IPv4 Address

Hope this helps.

Upvotes: 11

Muhammad Qasim
Muhammad Qasim

Reputation: 361

I do this with following steps. Try this and it should also work for you:

  1. Start wamp server on Host OS.
  2. Start virtual machine.
  3. Open your browser on virtual machine.
  4. Note your Host's IP Address and put it in the browser of your Guest's OS (Win XP if I am right) and hit enter it should open the localhost if not then you need to allow remote access to your wamp in httpd.conf as described here

I can access my host's wamp from VM without any problem with this method.

Upvotes: 2

Beniamin Szabo
Beniamin Szabo

Reputation: 1929

nevermind...I did it. I just had to use 10.0.2.2 in the guest machine's browser to access the localhost :D

Upvotes: 7

Related Questions