<?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>logIt &#187; virtualization</title>
	<atom:link href="https://lakm.us/logit/tag/virtualization/feed/" rel="self" type="application/rss+xml" />
	<link>https://lakm.us/logit</link>
	<description>Log Around The Clock</description>
	<lastBuildDate>Sat, 06 Jun 2015 14:17:37 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>That Handy Tap Interface on Mac OSX</title>
		<link>https://lakm.us/logit/2013/01/handy-tap-interface-mac-osx/</link>
		<comments>https://lakm.us/logit/2013/01/handy-tap-interface-mac-osx/#comments</comments>
		<pubDate>Fri, 04 Jan 2013 09:04:46 +0000</pubDate>
		<dc:creator>Arif</dc:creator>
				<category><![CDATA[Moving to Mac]]></category>
		<category><![CDATA[daemon]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[virtualization]]></category>

		<guid isPermaLink="false">http://lakm.us/logit/?p=426</guid>
		<description><![CDATA[Ubuntu has been my desktop for some years. I&#8217;ve become so attached in a way that I no longer know how to work without. Then of course, the pain of moving to Mac is one foreseeable future. Unlike my usual repository where everything is on the table and for free, this one is a little [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.ubuntu.com/" title="Ubuntu" target="_blank">Ubuntu</a> has been my desktop for some years. I&#8217;ve become so attached in a way that I no longer know how to work without. Then of course, the pain of moving to <a href="http://www.apple.com/macbook-pro/" title="MacBook Pro" target="_blank">Mac</a> is one foreseeable future. Unlike my usual repository where everything is on the table and for free, this one is a little tougher to handle. Well, if I were to cut to the chase, <a href="./2009/02/startup-script-for-tap-interfaces/" title="Startup script for TAP interfaces" target="_blank">tap interface</a> for instance, was nowhere near to be found. My <a href="https://www.virtualbox.org/" title="VirtualBox" target="_blank">VirtualBox</a> depends a lot on these virtual networks as I&#8217;m used to try things out.</p>
<blockquote><p>
<em>..you’ll always have love-hate relationship with the tools you work with.. blindly turning yourself into devoted-fanatic is another thing..</em></p></blockquote>
<p>
<p>Enough bragging (let&#8217;s spare that). First we need to have <code>/dev/tap0</code>, <code>/dev/tap1</code>, etc., available using <a href="http://tuntaposx.sourceforge.net/" title="TunTap - SourceForge" target="_blank">TunTap</a> kernel extension.</p>
<p>I modify the small script from <a href="http://snakeoilresearch.com/blog_discussing_snake_oil_o/using_taptun_interfaces_in_.html" title="Using 'tap/tun' interfaces in Mac OS X with VirtualBox" target="_blank">this post</a> to have it available on background instead of keeping a shell open all the time:</p>
<p>I saved it as <code>/usr/local/bin/setup-tap1.py</code></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/python</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">os</span>
<span style="color: #ff7700;font-weight:bold;">while</span> <span style="color: #ff4500;">1</span>:
	<span style="color: #ff7700;font-weight:bold;">try</span>:
		file_path = <span style="color: #483d8b;">'/dev/tap1'</span>
		dev_file = <span style="color: #dc143c;">os</span>.<span style="color: #008000;">open</span><span style="color: black;">&#40;</span>file_path, <span style="color: #dc143c;">os</span>.<span style="color: black;">O_RDWR</span><span style="color: black;">&#41;</span>
		interface = <span style="color: #483d8b;">'tap1'</span>
		<span style="color: #ff7700;font-weight:bold;">while</span> <span style="color: #ff4500;">1</span>:
			<span style="color: #ff7700;font-weight:bold;">pass</span>
	<span style="color: #ff7700;font-weight:bold;">except</span>:
		<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;tap interface is closing&quot;</span>
		exit<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
		<span style="color: #ff7700;font-weight:bold;">break</span></pre></td></tr></table></div>

<p>Let the shell takes care of putting it to background (daemon):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>setup-tap1.py <span style="color: #000000; font-weight: bold;">&amp;</span></pre></div></div>

<p>and there you have one working tap interface:</p>
<div class="wp-caption aligncenter" style="width: 460px"><img alt="virtualbox-mac-osx-tap-interface.png" src="../../../../images/virtualbox-mac-osx-tap-interface.png" title="VirtualBox tap interface in Mac OSX Lion" width="438" height="249" /><p class="wp-caption-text">VirtualBox tap interface in Mac OSX Lion 10.7</p></div>
<p>[Moving-in would probably be easier if I started <code>life</code> with <code><a href="http://en.wikipedia.org/wiki/FreeBSD" title="FreeBSD" target="_blank">FreeBSD</a></code>. More posts to come]</p>
]]></content:encoded>
			<wfw:commentRss>https://lakm.us/logit/2013/01/handy-tap-interface-mac-osx/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ubuntu ARM on QEMU Processor Emulator</title>
		<link>https://lakm.us/logit/2011/11/ubuntu-on-qemu-processor-emulator/</link>
		<comments>https://lakm.us/logit/2011/11/ubuntu-on-qemu-processor-emulator/#comments</comments>
		<pubDate>Sun, 27 Nov 2011 04:14:55 +0000</pubDate>
		<dc:creator>Arif</dc:creator>
				<category><![CDATA[ARM Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[ARMv7]]></category>
		<category><![CDATA[embedded system]]></category>
		<category><![CDATA[emulator]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[Lucid]]></category>
		<category><![CDATA[OMAP3]]></category>
		<category><![CDATA[QEMU]]></category>
		<category><![CDATA[rootfs]]></category>
		<category><![CDATA[RootStock]]></category>
		<category><![CDATA[virtualization]]></category>

		<guid isPermaLink="false">http://xp-racy.lan/it/?p=300</guid>
		<description><![CDATA[There are times when you need to try things on virtualized environment before hand e.g. 1) checking application functionality or 2) actual device shipment is still on its long way. Those were also my cases with ARM Linux. Unlike virtualization in production environment however, putting software to emulate CPU architecture will slow down the guest [...]]]></description>
				<content:encoded><![CDATA[<p>There are times when you need to try things on virtualized environment before hand e.g. 1) checking application functionality or 2) actual device shipment is still on its long way. Those were also my cases with ARM Linux. Unlike virtualization in production environment however, putting software to emulate CPU architecture will slow down the guest machine a lot.</p>
<p>Ready-to-use image for from the old Ubuntu 9.10 Karmic is avalaible as suggested in <a href="https://wiki.ubuntu.com/ARM/RootfsFromScratch">RootStock Wiki</a> .</p>
<p>To run Ubuntu 10,04 Lucid you can create similar <code>.img</code> filled by RootStock generated root file system as described in <a href="../2011/10/running-ubuntu-on-devkit8500d-natty-kernel-and-lucid-rootfs/">this post</a> generating <code>lucid-arm.img</code>. Boot image is obtained from <a href="http://ports.ubuntu.com/dists/lucid/main/installer-armel/current/images/versatile/netboot/vmlinuz">Lucid port page</a>, of which I saved with the name <code>vmlinuz-lucid-current-ports</code> which is actually linux kernel 2.6.32-21. Running QEMU is then:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">qemu-system-arm <span style="color: #660033;">-M</span> versatilepb <span style="color: #660033;">-cpu</span> cortex-a8 \
  <span style="color: #660033;">-kernel</span> vmlinuz-lucid-current-ports \
  <span style="color: #660033;">-hda</span> lucid-arm.img <span style="color: #660033;">-m</span> <span style="color: #000000;">256</span> <span style="color: #660033;">-append</span> <span style="color: #ff0000;">&quot;root=/dev/sda mem=256M devtmpfs.mount=0 rw&quot;</span></pre></div></div>

<p>However, adding <code>-redir tcp:3232::22</code> isn&#8217;t directly working (although <code>telnet</code> is showing both directions are functional). This redirection is working with the Karmic image which gives instant <code>ssh</code> on my host laptop as in:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh</span> localhost <span style="color: #660033;">-oPort</span>=<span style="color: #000000;">3232</span> <span style="color: #660033;">-l</span> ubuntu</pre></div></div>

<p>Note: successful QEMU machine image probably won&#8217;t boot successfully with the real board. I can&#8217;t use kernel 2.6.38-10 for Lucid rootfs on QEMU, but successfully boot that on DevKit8500D board.</p>
<div class="wp-caption aligncenter" style="width: 510px"><img alt="qemu-ubuntu-10.04-lucid-kernel-2.6.32-21.jpg" src="../../../../images/qemu-ubuntu-10.04-lucid-kernel-2.6.32-21.jpg" title="qemu-ubuntu-10.04-lucid-kernel-2.6.32-21.jpg" class="aligncenter" width="480" height="435" /><p class="wp-caption-text">QEMU console of Ubuntu 10.04 VM</p></div>
]]></content:encoded>
			<wfw:commentRss>https://lakm.us/logit/2011/11/ubuntu-on-qemu-processor-emulator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
