<p>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.</p>

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

[{'answer_id': 61455, 'author': 'JW.', 'author_id': 4321, 'author_profile': 'https://Stackoverflow.com/users/4321', 'pm_score': 8, 'selected': True, 'text': '<p>On the XP machine, find your IP address by going to the command prompt and typing <code>ipconfig</code>. Try replacing the last number with 1 or 2. For example, if your IP address is 192.168.78.128, use <a href="http://192.168.78.1:3000" rel="noreferrer">http://192.168.78.1:3000</a>.</p>\n'}, {'answer_id': 61656, 'author': 'Michael Larocque', 'author_id': 3859, 'author_profile': 'https://Stackoverflow.com/users/3859', 'pm_score': 6, 'selected': False, 'text': '<p>You can use your host Mac\'s (or any other Mac on the network) \'local\' name:</p>\n\n<p><a href="http://macname.local:3000/" rel="noreferrer">http://macname.local:3000/</a></p>\n\n<p>where macname is the network name of your host (or other desired) Mac.</p>\n'}, {'answer_id': 191707, 'author': 'Richard Poirier', 'author_id': 26842, 'author_profile': 'https://Stackoverflow.com/users/26842', 'pm_score': 3, 'selected': False, 'text': '<ol>\n<li>On the XP machine, Start -> Connect To -> Show all connections.</li>\n<li>Double click Local Area Connection.</li>\n<li>Click the Support tab.</li>\n<li>Take the Default Gateway IP <code>&lt;gateway-ip</code>> and hit http://<code>&lt;gateway-ip</code>>:3000 in your browser.</li>\n</ol>\n\n<p>Gotcha: You must have http:// in the address or IE will give you "The webpage cannot be displayed".</p>\n'}, {'answer_id': 2094910, 'author': 'J. Perkins', 'author_id': 93921, 'author_profile': 'https://Stackoverflow.com/users/93921', 'pm_score': 4, 'selected': False, 'text': '<p>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:</p>\n\n<pre><code>192.168.78.1   myrubyapp\n</code></pre>\n\n<p>Now you can access the site in IE at the address <a href="http://myrubyapp:3000" rel="noreferrer">http://myrubyapp:3000</a></p>\n\n<p>If you use virtual hosts under Apache you\'ll need this to provide the correct server name.</p>\n'}, {'answer_id': 6688618, 'author': 'Jess Telford', 'author_id': 473961, 'author_profile': 'https://Stackoverflow.com/users/473961', 'pm_score': 3, 'selected': False, 'text': '<p>As this question is quite old and referring to XP, here is an alternative for new OSs;</p>\n\n<hr>\n\n<p>If you\'re rocking <strong>Vista</strong> or <strong>Windows 7</strong> as the Guest OS, and you have Virtual Hosts setup in the Host via Apache, here\'s how to setup:</p>\n\n<p>In the Host OS, you need to ensure the network connection is done via NAT;</p>\n\n<ol>\n<li>Right click the network icon in the VM window (bottom-right)</li>\n<li>Select "NAT"</li>\n<li>Select "Connect"</li>\n<li>Wait for the guest OS reconnect to the network</li>\n</ol>\n\n<p>Then, In the Guest OS;</p>\n\n<ol>\n<li>Click Start > Network > Network &amp; Sharing Center</li>\n<li>Click "View Status" next to the network connection</li>\n<li>Click "Details"</li>\n<li>Find "IPv4 Default Gateway"</li>\n<li>Open Wordpad</li>\n<li>Edit C:\\Windows\\System32\\drivers\\etc\\hosts</li>\n<li><p>Add a line to the file such as: </p>\n\n<pre><code>[default-gateway-IP] www.example.com\n[default-gateway-IP] example.com\n</code></pre></li>\n<li><p>Save</p></li>\n<li>Try opening <code>http://www.example.com</code> or <code>http://example.com</code> in IE</li>\n</ol>\n\n<p><a href="https://i.stack.imgur.com/kw8ck.png" rel="noreferrer"><img src="https://i.stack.imgur.com/kw8ck.png" width="441" height="344"></a></p>\n'}, {'answer_id': 9828343, 'author': 'Dennis Plucinik', 'author_id': 184302, 'author_profile': 'https://Stackoverflow.com/users/184302', 'pm_score': 3, 'selected': False, 'text': '<p>I just spent an hour trying to get this to work following the steps on SO but mine ended up being a bit different.</p>\n\n<p><strong>VMWare settings</strong><br></p>\n\n<p>1.) Set VMWare connection to NAT<br>\n2.) run > cmd > ipconfig > copy Default Gateway value<br>\n3.) edit hosts file (c:/Windows/System32/drivers/etc/hosts)<br></p>\n\n<ul>\n<li>add this to your hosts file:</li>\n</ul>\n\n<p><code>&lt;gateway-ip> yourserver.local</code></p>\n\n<p><strong>OS X settings</strong><br></p>\n\n<p>1.) edit Apache config (e.g., sudo vim /etc/apache2/httpd.conf) </p>\n\n<ul>\n<li>add this vhost entry to your httpd.conf file:</li>\n</ul>\n\n<pre>\nNameVirtualHost 127.0.0.1\n&lt;VirtualHost 127.0.0.1>\n    DocumentRoot "/path/to/your/project"\n    ServerName yourserver.local\n\n    &lt;Directory "/path/to/your/project">\n        AllowOverride All\n        Options All\n    &lt;/Directory>\n&lt;/VirtualHost>\n</pre>\n\n<ul>\n<li>save &amp; quit (:wq)</li>\n</ul>\n\n<p>2.) Edit your hosts file (sudo vim /etc/hosts)</p>\n\n<ul>\n<li>add this line to your hosts file</li>\n</ul>\n\n<p><code>127.0.0.1 yourserver.local</code></p>\n\n<p>3.) Restart Apache (sudo apachectl restart)</p>\n\n<p>I found that I had to switch the connection setting on VMWare in order to restart the connection before these settings worked for me. I hope this helps.</p>\n'}, {'answer_id': 10835797, 'author': 'Googol', 'author_id': 400316, 'author_profile': 'https://Stackoverflow.com/users/400316', 'pm_score': 3, 'selected': False, 'text': '<p>For Django it\'s important to do the following:</p>\n\n<p>./manage.py runserver [default-gateway-IP]:8000</p>\n\n<p>because</p>\n\n<p><a href="https://docs.djangoproject.com/en/dev/ref/django-admin/">https://docs.djangoproject.com/en/dev/ref/django-admin/</a></p>\n\n<p>Note that the default IP address, 127.0.0.1, is not accessible from other machines on your network. To make your development server viewable to other machines on the network, use its own IP address (e.g. 192.168.2.1) or 0.0.0.0 or :: (with IPv6 enabled).</p>\n'}]
['https://Stackoverflow.com/questions/61449', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1450/']