Filing under: not very interesting but very useful (I hope) tutorials, here’s a step-by-step guide to accessing your local server (ex. the one you’ve got running on localhost:3000).
Why might you need this?
Because you need to test on IE and you have a not-Windows machine. Cool? Moving on.
Getting the VM
Update the hosts file so you can access your local server
Step 1: Open Notepad as an administrator:
Step 3: Open the hosts file
Choose “Open” and find the hosts file. It’s at C:\Windows\System32\drivers\etc. Be sure to “show all” file endings, as you won’t see the hosts file otherwise (it doesn’t end in .txt!)
Step 4: Edit the hosts file to at 10.0.2.2 with some name
Don’t name it localhost because weird things will happen. And don’t forget that you still need to put the port when you’re accessing your server, mysite.com won’t work in your VM, but mysite.com:3000 will if that’s the port for your local server.
5. Take a snapshot of your machine
Save your machine state. Run your VM from this snapshot to lock it in time when you had this set up, which should also prevent the VM self-combust clock from running (the Windows licenses are only good for so long).
Hope this helps others! Shoutout to my colleague Dave for reminding me how to get this done a while ago, and now there’s a blog post for everyone else to benefit 🙂