<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>The Way I See It</title>
	<atom:link href="http://macanta.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://macanta.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Sun, 08 May 2011 17:45:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='macanta.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>The Way I See It</title>
		<link>http://macanta.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://macanta.wordpress.com/osd.xml" title="The Way I See It" />
	<atom:link rel='hub' href='http://macanta.wordpress.com/?pushpress=hub'/>
		<item>
		<title>VirtualBox networking Vista host and Ubuntu guests</title>
		<link>http://macanta.wordpress.com/2009/06/25/virtualbox-networking-vista-host-and-ubuntu-guests/</link>
		<comments>http://macanta.wordpress.com/2009/06/25/virtualbox-networking-vista-host-and-ubuntu-guests/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 15:11:01 +0000</pubDate>
		<dc:creator>Frank Henry</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[VirtualBox]]></category>

		<guid isPermaLink="false">http://macanta.wordpress.com/?p=5</guid>
		<description><![CDATA[This post describes how to set up a VirtualBox environment consisting of a Windows Vista host and two guests running Ubuntu 9.04. I wanted to set up a web development environment consisting of a Windows Vista host and two guests, one running Ubuntu Server and the other running Ubuntu Desktop. I wanted a typical web [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=macanta.wordpress.com&amp;blog=8201831&amp;post=5&amp;subd=macanta&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This post describes how to set up a VirtualBox environment consisting of a Windows Vista host and two guests running Ubuntu 9.04.</p>
<p>I wanted to set up a web development environment consisting of a Windows Vista host and two guests, one running Ubuntu Server and the other running Ubuntu Desktop. I wanted a typical web server environment (Apache, MySQL and PHP) on the Ubuntu server, and I would have Vista and Ubuntu Desktop clients for testing. I wanted a setup that would work on wired or wireless, on my home and office networks, and on the occasional hotel or public hotspot. Ideally, the host and guest machines should all be able to communicate with each other, and they should all be able to access the Internet.</p>
<p>With the help of Google and the VirtualBox manual I was able to get it up and running without too much difficulty. All the web articles I found were written before the most recent (version 2.2.x) releases of VirtualBox, in which there were significant changes, so I wanted to share my experience in the hope that it will help someone else.</p>
<p>It&#8217;s quite a simple solution. You basically set up your Ubuntu guest systems to have two network interfaces, one to communicate with the host and the other guest, and one to provide Internet access.</p>
<h3>Communication between host and guests</h3>
<p>Communication between host and guets, and between the two guests, is achieved with Host-only networking. Host-only networking is a new feature introduced in VirtualBox 2.2.0. It creates on the Vista PC a virtual network adapter, and Windows uses this adapter to communicate with the guests.</p>
<p>The virtual adapter shows up in your guest system as a regular network adapter. Likewise, in Vista it appears in your network settings like any other adapter. To enable communication between host and guests, you simply need to<br />
configure the virtual adapter on the Vista host to communicate with the corresponding adapter in your Ubuntu guests. To enable your host and guests to access the internet, you set up a second adapter, this time using NAT.</p>
<h3>Network settings</h3>
<p>I used the following IP addresses:</p>
<ul>
<li>Virtual adapter on Vista PC: <strong>10.10.1.100</strong></li>
<li>Virtual adapter (eth0) on Ubuntu Server: <strong>10.10.1.101</strong></li>
<li>Virtual adapater (eth0) on Ubuntu Desktop: <strong>10.10.1.102</strong></li>
</ul>
<h3>Creating the virtual adapter</h3>
<p>On Vista&#8230;</p>
<ol>
<li>Select Preferences&#8230; from the File menu in VirtualBox. In the Settings dialog box, click the Network tab. Then click the &#8220;+&#8221; icon to add a new adapter.<br />
<a href="http://macanta.files.wordpress.com/2009/06/network-settings.jpg"><img class="size-medium wp-image-7 aligncenter" title="Add a Host-only adapter" src="http://macanta.files.wordpress.com/2009/06/network-settings.jpg?w=300&#038;h=206" border="0" alt="Add a Host-only adapter" width="300" height="206" /></a>When the adapter is created, click the screwdriver icon to change the settings. This displays the Host-only Network Details dialog box.<a href="http://macanta.files.wordpress.com/2009/06/network-details.jpg"><img class="size-medium wp-image-8 aligncenter" title="Network details for host-only adapter" src="http://macanta.files.wordpress.com/2009/06/network-details.jpg?w=300&#038;h=160" border="0" alt="Network details for host-only adapter" width="300" height="160" /></a></li>
<li>In the Adapter tab, enter the IPv4 address (<strong>10.10.1.100</strong>) and the network mask (<strong>255.255.255.0</strong>).</li>
<li>In the DHCP Server tab, make sure the Enable Server checkbox is unticked.</li>
<li>Click OK in the Host-only Network Details dialog box and again in the VirtualBox Settings dialog box.</li>
<li>In the main VirtualBox window, select the Ubuntu Server instance and click the Settings icon.</li>
<li>In the Settings dialog box, click the Network tab. You will see four tabs named Adapter 1 to Adapter 4. These correspond to devices eth0 to eth3 in your Ubuntu guest.<br />
<a href="http://macanta.files.wordpress.com/2009/06/guest-settings-1.jpg"><img class="size-medium wp-image-13  aligncenter" title="VirtualBox settings for Ubuntu guest" src="http://macanta.files.wordpress.com/2009/06/guest-settings-1.jpg?w=300&#038;h=206" border="0" alt="VirtualBox settings for Ubuntu guest" width="300" height="206" /></a>In the tab for Adapter 1, tick the &#8220;Enable Network Adapter&#8221; box. Unless you have some reason to change the Adapter Type, leave it at at the default (PCnet-FAST III). From the Attached To: dropdown, select &#8220;Host-only Adapter&#8221; and from the Name drop-down, select the virtual adapter you created earlier.Click on OK. Repeat the process for the Ubuntu Desktop instance.On Vista, open the Network and Sharing Center from the control panel. In the list of network connections, you will see &#8220;VirtualBox Host-Only Network&#8221;.<br />
<a href="http://macanta.files.wordpress.com/2009/06/network-connections.jpg"><img class="aligncenter size-medium wp-image-36" title="VirtualBox adapter appears in list of network connections" src="http://macanta.files.wordpress.com/2009/06/network-connections.jpg?w=300&#038;h=135" border="0" alt="VirtualBox adapter appears in list of network connections" width="300" height="135" /></a></p>
<p style="text-align:center;">Double-click this connection and configure it to have a static IP address of 10.10.1.100 and a subnet mask of 255.255.255.0.<br />
<a href="http://macanta.files.wordpress.com/2009/06/ip-settings.jpg"><img class="aligncenter size-medium wp-image-40" title="Vista IP settings for VirtualBox adapter" src="http://macanta.files.wordpress.com/2009/06/ip-settings.jpg?w=270&#038;h=300" border="0" alt="Vista IP settings for VirtualBox adapter" width="270" height="300" /></a></p>
</li>
</ol>
<p>This completes the setup on Vista. Now for Ubuntu&#8230;</p>
<ol>
<li>Start your Ubuntu Server guest and log in.</li>
<li>Configure the network interface. If you used Adapter 1 in the VirtualBox settings, the corresponding device on Ubuntu is eth0, eth1 corresponds to Adapter 2, and so on. This example assumes eth0.</li>
<li>
<pre>frank@ubuntu-server:&gt; sudo nano etc/network/interfaces
# The loopback network interface
auto lo
iface lo inet loopback

# VirtualBox host-only adapter
auto eth0
iface eth0 inet static
address 10.10.1.101
netmask 255.255.255.0
gateway 10.10.0.1
broadcast 10.10.0.255</pre>
<p>Then, restart networking:</p>
<pre>sudo /etc/init.d/networking restart</pre>
<p>You should now be able to ping the Vista PC from Ubuntu Server:</p>
<pre>ping 10.10.1.100</pre>
<p>And from the Vista PC, you should now be able to ping Ubuntu Server:</p>
<pre>ping 10.10.1.101</pre>
<p>And of course, if Apache is installed, the home page of Ubuntu Server should be accessible on http://10.10.1.101.</p>
<p>Setup for the Ubuntu desktop is the same. Use the address 10.10.1.102. When finished, you should be able to ping the Vista PC on 10.10.1.100 and ping the Ubuntu server on 10.10.1.101.</p>
<h3>Communication with the Internet</h3>
<p>To enable the Ubuntu guests to access the Internet, you need to configure a second network adapter. This second adapter uses Network Address Translation (NAT) to transparently route Internet traffic to and from the virtual machine.</p>
<ol>
<li>In the main VirtualBox window, select the Ubuntu Server instance and click the Settings icon.</li>
<li>In the Settings dialog box, click the Network tab.<a href="http://macanta.files.wordpress.com/2009/06/guest-settings-2.jpg"><img class="aligncenter size-medium wp-image-22" title="VirtualBox settings for Ubuntu guest" src="http://macanta.files.wordpress.com/2009/06/guest-settings-2.jpg?w=300&#038;h=206" border="0" alt="VirtualBox settings for Ubuntu guest" width="300" height="206" /></a>In the tab for Adapter 2, tick the &#8220;Enable Network Adapter&#8221; box. Unless you have some reason to change the Adapter Type, leave it at at the default (PCnet-FAST III). From the Attached To: dropdown, select &#8220;NAT&#8221; and from the Name drop-down, select the virtual adapter you created earlier.</li>
</ol>
<p>Click on OK. Repeat the process for the Ubuntu Desktop instance.</p>
<p>This completes the setup on Vista. Now for Ubuntu&#8230;</p>
<ol>
<li>Start your Ubuntu Server guest and log in.</li>
<li>Configure the network interface. If you used Adapter 2 in the VirtualBox settings, the corresponding device on Ubuntu is eth1, and so on. This example assumes eth1.</li>
<pre>frank@ubuntu-server:&gt; sudo nano etc/network/interfaces
# The loopback network interface
auto lo
iface lo inet loopback

# VirtualBox host-only adapter
auto eth0
iface eth0 inet static
address 10.10.1.101
netmask 255.255.255.0
gateway 10.10.0.1
broadcast 10.10.0.255

# VirtualBox NAT adapter
auto eth1
iface eth1 inet dhcp</pre>
<p>Then, restart networking:</p>
<pre>sudo /etc/init.d/networking restart</pre>
</ol>
</li>
</ol>
<p>You should now be able to access the Internet from Ubuntu Server:</p>
<pre>ping www.google.com</pre>
<p>And you should still be able to ping Ubuntu Server from the Vista PC and vice versa.</p>
<p>Now, repeat the process from Ubuntu Desktop, test your connections and you are done.</p>
<h3>Other ways to skin the cat</h3>
<p>There may be other ways to skin this cat, for example by using bridging and internal networking. It depends on your requirements. For me, this method works best because in addition to being the most &#8220;real&#8221; scenario it doesn&#8217;t need any reconfiguring for different Internet connections.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/macanta.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/macanta.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/macanta.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/macanta.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/macanta.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/macanta.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/macanta.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/macanta.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/macanta.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/macanta.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/macanta.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/macanta.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/macanta.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/macanta.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=macanta.wordpress.com&amp;blog=8201831&amp;post=5&amp;subd=macanta&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://macanta.wordpress.com/2009/06/25/virtualbox-networking-vista-host-and-ubuntu-guests/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7c60a53d36c479ea15f46bcb87051fe0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Frank</media:title>
		</media:content>

		<media:content url="http://macanta.files.wordpress.com/2009/06/network-settings.jpg?w=300" medium="image">
			<media:title type="html">Add a Host-only adapter</media:title>
		</media:content>

		<media:content url="http://macanta.files.wordpress.com/2009/06/network-details.jpg?w=300" medium="image">
			<media:title type="html">Network details for host-only adapter</media:title>
		</media:content>

		<media:content url="http://macanta.files.wordpress.com/2009/06/guest-settings-1.jpg?w=300" medium="image">
			<media:title type="html">VirtualBox settings for Ubuntu guest</media:title>
		</media:content>

		<media:content url="http://macanta.files.wordpress.com/2009/06/network-connections.jpg?w=300" medium="image">
			<media:title type="html">VirtualBox adapter appears in list of network connections</media:title>
		</media:content>

		<media:content url="http://macanta.files.wordpress.com/2009/06/ip-settings.jpg?w=270" medium="image">
			<media:title type="html">Vista IP settings for VirtualBox adapter</media:title>
		</media:content>

		<media:content url="http://macanta.files.wordpress.com/2009/06/guest-settings-2.jpg?w=300" medium="image">
			<media:title type="html">VirtualBox settings for Ubuntu guest</media:title>
		</media:content>
	</item>
	</channel>
</rss>
