VirtualBox – Access Guest Localhost from Host Computer

Oracle VirtualBox is a free, open source and powerful virtualization tool. Some minor configurations tweaks are required to access guest localhost from host computer. I am running VirtualBox with Ubuntu on my MAC OS.

One easy way to access guest localhost from host computer is to start VirtualBox with following configurations. I have Ubuntu installed on virtual machine, but steps should be similar for other OS versions as well:

  • Shut down virtual machine
  • In VirtualBox, right click on the virtual machine and go to “Settings
  • Select “Network” tab
  • Select “Adapter1
  • Select “Enable Network Adapter” checkbox
  • Click on “Attached to” drop down box and select “Host-only Adapter
  • Next, go to “Advanced” section
  • Click on “Promiscuocus Mode” drop down box and select “Allow VMs
  • Finally, launch virtual machine

Now, open command promt or terminal window and type “ifconfig“. From the output of this command, select “inet addr” value (this is IP address of your virtual machine).

Finally, go to host computer, open browser and attempt to access http://<ip_address>” (inet addr value). This should display default Apache2 web page (assuming Apache2 is installed and running)

Leave a Reply

Your email address will not be published. Required fields are marked *