I’m using MAMP Pro for local web development on OSX Lion and needed to test some javascript compatibility with IE so I booted up a virtual machine. It took me a few minutes to figure how to have the DNS resolve to my local development domains that were set up on my main OS. I couldn’t find this tip immediately online so here it is.
If you want to be able to access your named virtual hosts that you set up on MAMP on a Windows 7 virtual machine make sure you update your hosts file on the Windows VM.
Here’s what works for me.
- Install MAMP Pro
- Setup local development host in MAMP
- Install Virtual Box
- Setup Windows 7
- Highly recommended process https://github.com/xdissent/ievms/
- Default Virtual Box network settings attached to NAT worked for me
- Edit the Windows 7 hosts file
- Run Notepad as admin in Windows.
- Open C:\Windows\System32\drivers\etc\hosts
- Add 10.0.2.2 yourdevdomain
- Add more if you have want.
- Save the file.
- Instance restart may be required.
If that doesn’t work, check what port Apache is running on and edit the hosts file accordingly.