<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>icicity.com &#187; fusion</title>
	<atom:link href="http://icicity.com/tag/fusion/feed" rel="self" type="application/rss+xml" />
	<link>http://icicity.com</link>
	<description>...it's beyond me...</description>
	<lastBuildDate>Fri, 25 Mar 2011 00:09:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Using Localhost Loopback With Fusion</title>
		<link>http://icicity.com/2009/06/01/using-localhost-loopback-with-fusion</link>
		<comments>http://icicity.com/2009/06/01/using-localhost-loopback-with-fusion#comments</comments>
		<pubDate>Mon, 01 Jun 2009 09:36:15 +0000</pubDate>
		<dc:creator>gonzo</dc:creator>
				<category><![CDATA[miscellaneous]]></category>
		<category><![CDATA[fusion]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[virtualisation]]></category>

		<guid isPermaLink="false">http://icicity.com/?p=479</guid>
		<description><![CDATA[So you develop websites on your Mac using virtual hosts mapped to the usual localhost loopback (127.0.0.1). Everything is fine until you install virtualisation software such as VMware&#8217;s Fusion to fight IE&#8217;s dodgy rendering issues. Of course you prefer Fusion to recognise all your locally mapped DEV sites, but you can&#8217;t simply tell the virtualised [...]]]></description>
			<content:encoded><![CDATA[<p>So you develop websites on your Mac using virtual hosts mapped to the usual localhost loopback (<code>127.0.0.1</code>). Everything is fine until you install virtualisation software such as VMware&#8217;s Fusion to fight IE&#8217;s dodgy rendering issues. Of course you prefer Fusion to recognise all your locally mapped DEV sites, but you can&#8217;t simply tell the virtualised Windows environment to use <code>127.0.0.1</code> since this will simply point back towards itself.</p>
<p>Suppose you have set up a virtual host for a site called <code>sample.dev</code>. This virtual host allows you to use URLs such as <code>http://sample.dev/about-us/our-team.html</code></p>
<p>Now you want to be able to use that same virtual host in your virtualised environment (=guest environment). You&#8217;re just a few simple steps away from making this work for you.</p>
<ol>
<li>
<h2>Unique Loopback Address</h2>
<p>To make all this a little easier, I prefer to use a different loopback address than the standard <code>127.0.0.1</code>. My preferred address is: <code>10.0.0.101</code>. I&#8217;ll explain why I use this address later on.</p>
</li>
<li>
<h2>Hosts file: Mac</h2>
<p>Ensure your <code>sample.dev</code> site is configured in your local <code>hosts</code> using the <code>10.0.0.101</code> address file as follows:</p>
<p>	<code><br />
		10.0.0.101 sample.dev<br />
		10.0.0.101 another-site.dev<br />
		10.0.0.101 yet-another-site.dev<br />
	</code></p>
<p>We&#8217;ll use the local IP address to bridge the guest and host environments. Please note that you can use any local IP address available to you (ie, not yet in use or assigned).</p>
</li>
<li>
<h2>Host file: Windows</h2>
<p>Next, we&#8217;ll add the same lines to the <code>host</code> file of the guest environment: locate the file (<code>windows/system32/drivers/etc</code> on XP) and duplicate the Mac host file entries:</p>
<p>	<code><br />
		10.0.0.101 sample.dev<br />
		10.0.0.101 another-site.dev<br />
		10.0.0.101 yet-another-site.dev<br />
	</code>
</li>
<li>
<h2>Applying the Glue</h2>
<p>Now that we have configured the <code>host(s)</code> files on both the guest and host environments all we have left to do is create the actual bridge for these environments. We do this by adding an <code>ifconfig</code> directive to our system by using <strong><code>launchd</code></strong> or <strong><code>rc.local</code></strong></p>
<ul>
<li>
<h3><code>launchd</code></h3>
<p>Introduced in OS X 10.4, <code>launchd</code> is a flexible way to start/stop/edit processes. To put it to our use, we&#8217;d create a <code>plist</code> entry in <code>/Library/LaunchDemons/</code></p>
<p>We do this by opening a <code>terminal</code> window and typing:</p>
<p><code>sudo touch /Library/LaunchDemons/ifconfig.plist</code></p>
<p>Next, open the file we just created in a text editor and add the following:</p>
<p><code></p>
<pre>
&lt;plist version="1.0"&gt;
    &lt;dict&gt;
        &lt;key&gt;Label&lt;/key&gt;
            &lt;string&gt;ifconfig&lt;/string&gt;
        &lt;key&gt;ProgramArguments&lt;/key&gt;
        &lt;array&gt;
            &lt;string&gt;/sbin/ifconfig&lt;/string&gt;
            &lt;string&gt;lo0&lt;/string&gt;
            &lt;string&gt;alias&lt;/string&gt;
            &lt;string&gt;10.0.0.101&lt;/string&gt;
            &lt;string&gt;netmask&lt;/string&gt;
            &lt;string&gt;255.255.255.0&lt;/string&gt;
        &lt;/array&gt;
        &lt;key&gt;RunAtLoad&lt;/key&gt;
        &lt;true/&gt;
    &lt;/dict&gt;
&lt;/plist&gt;
</pre>
<p></code></p>
<p>Finally, save and close the file.</p>
</li>
<li>
<h3><code>rc.local</code></h3>
<p>The <code>rc.local</code> file runs in the background at system start up. While deprecated and essentially replaced in Leopard by the more flexible <code>launchd</code>, it still can be used to launch processes.</p>
<p><code>rc.local</code> can be found at <code>/etc/rc.local</code>. If you&#8217;re running a more recent system installation, chances are that you&#8217;ll have to create this file as OS X has not created this file by default since version 10.4.</p>
<p>You can create the file by typing the following in your terminal window:</p>
<p><code>sudo touch /etc/rc.local</code></p>
<p>Now, open the file we just created in a text editor and add the following:</p>
<p><code>ifconfig lo0 inet 10.0.0.101 netmask 255.255.255.0 alias</code>
</li>
</ul>
</li>
<li>
<h2>Almost done</h2>
<p>You may need to reboot <strong>both</strong> the hosted and the hosting environment in order to have these changes come into effect.</p>
<p>Thanks to Rob Sanheim for <a href="http://robsanheim.com/2007/12/11/creating-a-static-loopback-address-to-use-in-vmware/">his tips</a> on the subject.</p>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://icicity.com/2009/06/01/using-localhost-loopback-with-fusion/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

