Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 235
Beniamin Szabo Avatar asked Sep 12 '13 13:09

Beniamin Szabo


People also ask

How do I connect to a local machine in VMware?

Open the virtual machine settings window from within your installation of VMware Workstation, VMware Server, or VMware Player by clicking VM > Settings. In the hardware tab, highlight the network adapter and ensure that the bridged network connection checkbox is selected.

How can I access my localhost from another computer?

You need to find what your local network's IP of that computer is. Then other people can access to your site by that IP. You can find your local network's IP by go to Command Prompt or press Windows + R then type in ipconfig . It will give out some information and your local IP should look like 192.168.

How do I access localhost?

To access the server from itself, use http://localhost/ or http://127.0.0.1/ . To access the server from a separate computer on the same network, use http://192.168.X.X where X.X is your server's local IP address. You can find the sever's local IP address (assuming it's Linux) by running hostname -I . 127.0.


1 Answers

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.

like image 64
Fred K Avatar answered Sep 22 '22 06:09

Fred K