View Acquia Dev Desktop sites in a VM
I just needed to write this down so I don't forget it. I use Acquia Dev Desktop for my local Drupal development, and I found an awesome script at https://github.com/xdissent/ievms that installed VMs in VirtualBox with every version of Internet Explorer from IE6 to IE11 installed. However, since my sites are just on my local computer, I wasn't sure how to connect my VM with those sites. After a little digging (and a wild goose chase involving xip.io, which looks promising but was too much work for it to be worth my time at the moment), I realized it's actually really easy!
First off, you want to find your hosts file on the host machine (your computer). On my Mac, it's stored at /etc/hosts. DevDesktop auto-generated entries for the sites I had set up already:
# Acquia Dev Desktop automatically-added local addresses
127.0.0.1 bankcarduniversity-com.local
127.0.0.1 tm-university-com.local
127.0.0.1 volunteers-aarp-sdinstructortraining-org.local
127.0.0.1 drupal8.local
127.0.0.1 wealthmanagementuniversity-com.local
All those entries are doing is telling my computer to look at the ip address 127.0.0.1, which is always just the computer you're working from, whenever I type in one of those other addresses into my browser. So if I go to http://bankcarduniversity-com.local:8083/, it's actually looking for whatever's at http://127.0.0.1:8083/.
So why not just do the same thing with my VM?
Of course, working from my VM, I don't want to access 127.0.0.1, because that would be looking at the VM instead of the host machine. In order to access the host machine, I just peeked at my network configuration settings, where it told me my current IP address was 10.20.3.93. Since my VM and my host machine are on the same network (through the magic of VirtualBox), I know that my VM can "see" my host computer at 10.20.3.93.
So I open up the VM's hosts file. On Windows, the file is tucked away in C:\\WINDOWS\system32\drivers\etc\hosts (at least on Windows XP, which is what my IE8 virtual machine is running). Open that file, and basically you just copy and paste from the host machine's hosts file, trading out 127.0.0.1 for your network IP, which in my case was 10.20.3.93:
10.20.2.93 bankcarduniversity-com.local
10.20.2.93 tm-university-com.local
10.20.2.93 volunteers-aarp-sdinstructortraining-org.local
10.20.2.93 drupal8.local
10.20.2.93 wealthmanagementuniversity-com.local
After saving my hosts file on my VM, I was able to navigate to http://tm-university-com.local:8083/, and it brought up exactly the web site I expected!