<?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>notes2myself &#187; virtual machine</title>
	<atom:link href="http://spinczyk.net/blog/tag/virtual-machine/feed/" rel="self" type="application/rss+xml" />
	<link>http://spinczyk.net/blog</link>
	<description>a seo and web-developer's daily stuff</description>
	<lastBuildDate>Tue, 19 Oct 2010 10:34:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>setting up a bridged network for virtualbox on ubuntu linux (Host Interface)</title>
		<link>http://spinczyk.net/blog/2008/03/05/setting-up-a-bridged-network-for-virtualbox-on-ubuntu-linux/</link>
		<comments>http://spinczyk.net/blog/2008/03/05/setting-up-a-bridged-network-for-virtualbox-on-ubuntu-linux/#comments</comments>
		<pubDate>Wed, 05 Mar 2008 17:13:35 +0000</pubDate>
		<dc:creator>simon</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[virtual machine]]></category>

		<guid isPermaLink="false">http://spinczyk.net/blog/?p=3</guid>
		<description><![CDATA[In order for this to run, you will most likely need a wired network connection, since most wireless-adapters won&#8217;t support bridged networking! This description is intended to be used with VirtualBox &#62;= 1.4.0, since earlier versions handle the virtual networking &#8230; <a href="http://spinczyk.net/blog/2008/03/05/setting-up-a-bridged-network-for-virtualbox-on-ubuntu-linux/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In order for this to run, you will most likely need a wired network connection, since most wireless-adapters won&#8217;t support bridged networking! This description is intended to be used with VirtualBox &gt;= 1.4.0, since earlier versions handle the virtual networking differently due to kernel changes in 2.6.18 and later.</p>
<p>First of all, you&#8217;ll have to check the permissions on the device <span style="color: #993300;">/dev/net/tun <span style="color: #ffffff;">. The user running VirtualBox with bridged networking needs to have access to this device. The easiest way to do this is by chown&#8217;ing the group vboxusers to it:</span> </span></p>
<pre lang="bash">sudo chown :vboxusers /dev/net/tun
sudo chmod 0660 /dev/net/tun</pre>
<p>You will also have to install the package bridge-utils and uml-utilities:</p>
<pre lang="bash">sudo apt-get install bridge-utils uml-utilities</pre>
<p>Now we will create 2 scripts which are executed when the virtual machine starts/stops. I will create those scripts in my home dir. Here is the start script, I called it starttun.sh:</p>
<pre lang="bash">#!/bin/bash
brctl addbr br0
ifconfig eth0 0.0.0.0
brctl addif br0 eth0

#if you have a dhcp-server uncomment this line:
#dhclient3 br0

#If you have a static IP uncomment the following lines and</pre>
<pre lang="bash">#change the IP accordingly to your subnet:
#ifconfig br0 192.168.178.5 up
#route add default gw 192.168.178.1

#Now we will create the tap device for the vm,!</pre>
<pre lang="bash"># change your username accordingly
tunctl -t tap0 -u simon

#Now add the tap-device to the bridge:
ifconfig tap0 up
brctl addif br0 tap0</pre>
<p>Now you&#8217;ll have to create the stop script, i called it stoptun.sh <img src='http://spinczyk.net/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<pre lang="bash">#!/bin/bash
#bring the interfaces down
ifconfig tap0 down
ifconfig br0 down
brctl delif br0 tap0
brctl delbr br0

#now setup your network-interface again
#for dhcp uncomment the following line
#dhclient3 eth0

#For a static IP uncomment the following lines and change them accordingly:
#ifconfig eth0 192.168.178.5
#route add default gw 192.168.178.1 dev eth0</pre>
<p>Finally you&#8217;ll have to make the scripts executable:</p>
<pre lang="bash">sudo chmod ug+x starttun.sh
sudo chmod ug+x stoptun.sh</pre>
<p>It&#8217;s time to set up VirtualBox to use the interface. For this go to the SetUp of your Virtual Machine under Network and tell VirtualBox to start/stop thescripts, when the VM is started/stopped. To do this, select &#8220;Host Interface&#8221; under Attached To. As Interface Name you use &#8220;tap0&#8243; and for the startscript you use:</p>
<p>&#8220;gksudo /home/YOURHOMEDIR/starttun.sh&#8221;</p>
<p>For the stopscript accordingly:</p>
<p>&#8220;gksudo /home/YOURHOMEDIR/stoptun.sh&#8221;</p>
<p>Note: If you use KDE, you&#8217;ll have to use kdesu instead of gksudo</p>
]]></content:encoded>
			<wfw:commentRss>http://spinczyk.net/blog/2008/03/05/setting-up-a-bridged-network-for-virtualbox-on-ubuntu-linux/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
	</channel>
</rss>

