Set up localhost on VirtualBox
November 25, 2014
My local stack includes MAMP, VirtualBox and ModernIE. ModernIE is great for cross-browser testing, but you have configure your “hosts” file. Here are the steps to get localhost working through VirtualBox:
1) Click on “settings -> network” 2) Select “bridged adapter” from the dropdown
3) Boot up your virtual machine 4) Navigate to C:\Windows\System32\drivers\etc 5) Change permissions. Right click, “Properties -> Security -> Advanced”. Select Users, and “Change Permissions”. Click “Full Control -> Ok”.
7) Enter the IP address of your localhost and the URL
8) Save changes 9) Open Internet Explorer (or whatevs) and type in your address. Your localhost should now resolve.
For testing on Ubuntu (via VirtualBox), you will need to bridge the network adapter and edit your host file as well. It’s much easier than on Windows!
1) After bridging the network adapter (like above) open Terminal, and type:
sudo nano /etc/hosts
2) Enter the IP address of your localhost and the URL
3) Save the changes ( CTRL + X + Y ) and exit
**Note: If your localhost is setup for DHCP, you’ll probably need to update the hosts file with your new IP on a regular basis.