views:

3314

answers:

4

I've just created a new Windows XP VM on my Mac using VMware Fusion. The VM is using NAT to share the host's Internet connection.

How do I access a Rails application, which is accessible on the Mac itself using http://localhost:3000?

+5  A: 

On the XP machine, find your IP address by going to the command prompt and typing "ipconfig". Try replacing the last number with 1 or 2. For example, if your IP address is 192.168.78.128, use http://192.168.78.1:3000.

JW
+7  A: 

You can use your host Mac's (or any other Mac on the network) 'local' name:

http://macname.local:3000/

where macname is the network name of your host (or other desired) Mac.

Michael Larocque
Superb. I didn't know about the .local bit. Thanks!
wentbackward
+5  A: 
  1. On the XP machine, Start -> Connect To -> Show all connections.
  2. Double click Local Area Connection.
  3. Click the Support tab.
  4. Take the Default Gateway IP <gateway-ip> and hit http://&lt;gateway-ip>:3000 in your browser.

Gotcha: You must have http:// in the address or IE will give you "The webpage cannot be displayed".

Richard Poirier
+4  A: 

For future visitors: once you've got the IP address figured out, you can add an entry to the Windows hosts file, which is located at C:\Windows\system32\drivers\etc\hosts, to map the IP address to a (virtual) server name. Add a line like this:

192.168.78.1   myrubyapp

Now you can access the site in IE at the address http://myrubyapp:3000

If you use virtual hosts under Apache you'll need this to provide the correct server name.

starkos