Accessing an Apache server installed in VirtualBox from Mac
Set up Host-Only, Internal or Bridged Networking. Whenever you change the virtual machine's network configuration you need to inform the operating system within that virtual machine of that change. The easiest way is to simply reboot the virtual machine.
Look up the virtual machine's IP-Adress using ip addr eth0.
Verify basic connectivity using ping &lt;ip-address from previous step&gt; from your mac's terminal.
Edit your mac's /etc/hosts using sudo vim /etc/hosts (or use an editor like text mate that can elevate privileges by itself). Add a line that looks like this: &lt;ip-address as above&gt; myvirtualbox anothername yetanothername


A more powerful approach, albeit maybe only for a more console-savvy audience is Vagrant.