VirtualBox guest OS accessing local server on host OS

Enable ONE network adapter. Set it to NAT and start your machine. Don't need to configure anything.

On guest machine's browser type http://10.0.2.2 which will show you the same content as "localhost" in the host OS.

10.0.2.2 is the "default gateway" for NAT connections and your guest OS' IP is 10.0.2.15

Of course you can set a "HOST-ONLY" or an "Internal Network" which will allow you another advanced configurations. I recommend to stay with NAT.

Enjoy

M.


Also a point to make when using the ip address of 10.0.2.2 is if you're using MAMP for instance add the port number :8888 so the full address reads http://10.0.2.2:8888


The easiest way of allow uninterrupted access to your VirtualBox Guest machine is to set the network device as a 'bridge' to your eth0 on to your LAN.

The Guest machine will grab a LAN IP via DHCP from your router.