VirtualBox – Access Ubuntu localhost from MacOS

To access ubuntu localhost running on VirtualBox from MacOS, some minor tweaks are required and in this post we are going to see that.

One easy way to do this – is to start VirtualBox with following configurations.

  • Shut down virtual machine (If already running)
  • In VirtualBox, right click on the virtual machine in which you have installed Ubuntu 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“.
  • After you have completed above steps, launch virtual machine (Ubuntu)
VirtualBox network settings

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

You can access the localhost (ubuntu) using this IP from your MacOS.

Leave a Reply

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