Preview Sites on Mac Localhost Using Virtual Windows Machine


Using a virtual machine setup to test websites in different versions of IE, you probably want to view sites on your Mac localhost from your virtual machine.

This is something I found awkward the first few times, but after trying lots of different methods, I’ve established a simple way that works great for me.

Using VMWare

  1. Go to Settings and choose Network Card.
  2. Use the radio buttons to change the default NAT setting to use Bridging instead. This gives your virtual machine the same IP as your Mac.
  3. Go to C:/Windows/ and run Notepad.exe as Administrator.
  4. Open C:/Windows/System32/drivers/etc/hosts.
  5. Now you can add whatever settings you have in /etc/hosts to this file. Using your shared IP instead of 127.0.0.1 you can keep these files identical.

I have my IP reserved on my router. That way it’s always the same.

Example Hosts

192.168.0.9 localhost
192.168.0.9 somedomain.co.uk www.somedomain.co.uk


You might also need to flush your DNS. You can do this in the Windows Command Prompt using the command:

ipconfig /flushdns

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>