Using VMWare + Windows to Test Web Sites on Windows

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:

c:\windows\system32\drivers\etc\hosts

Open up the file in notepad and add your host entry, for example:

172.16.232.1    abc.localhost

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

NameVirtualHost 172.16.232.1
<virtualhost 127.0.0.1 172.16.232.1>
ServerName abc.localhost
DocumentRoot /Users/Mike/Sites/abc
</virtualhost>

References:

0 Response to “Using VMWare + Windows to Test Web Sites on Windows”


  • No Comments

Leave a Reply