Skip to content

Using VMWare + Windows to Test Web Sites on Windows

Categories: Web Development

Table of Contents

Step 1: Retrieve Emulator’s Gateway IP Address

Grab the inet number resulting from `ifconfig vmnet1`.

Step 2: Add Test Site’s Local Hostname to Window’s Host File

For each site I develop I setup a new Apache virtual host (some info on apache virtual hosts here). For instance, the local domain / hostname for a website could be mabblog.localhost. When developing locally there are some hardlinks to the local development hostname, for this reason the it isn’t enough to use the inet vmnet1 address retrieved above when debugging in VMWare / Parallels; the local hostname must be added to the Windows host file.

Wikipedia has an extensive listing of the location of the host file on various systems, on Windows XP it is located here:[code]c:windowssystem32driversetchosts[/code] Open up the file in notepad and add your host entry, for example:
[code]
172.16.232.1 abc.localhost
[/code]

Step 3: Add Emulator’s Gateway IP Address to Your VirtualHost

In order for apache to properly handle the request coming from the emulator gateway you have to add the emulator gateway IP to the VirtualHost statement.

From: /etc/apache2/users/Name.conf
[code]
NameVirtualHost 172.16.232.1

ServerName abc.localhost
DocumentRoot /Users/Mike/Sites/abc

[/code]

References:

Keep in Touch

Subscribe to my email list to keep in touch. I’ll send you new blog posts and other thoughts.