<?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>Ulf Wiger &#187; Linux</title>
	<atom:link href="http://ulf.wiger.net/weblog/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://ulf.wiger.net/weblog</link>
	<description>Feuerworks Inc - @uwiger - ulf (at) feuerworks.com</description>
	<lastBuildDate>Fri, 12 Nov 2010 05:21:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>coLinux &#8211; the devil&#8217;s in the details&#8230;</title>
		<link>http://ulf.wiger.net/weblog/2008/10/15/colinux-the-devils-in-the-details/</link>
		<comments>http://ulf.wiger.net/weblog/2008/10/15/colinux-the-devils-in-the-details/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 15:17:51 +0000</pubDate>
		<dc:creator>Ulf Wiger</dc:creator>
				<category><![CDATA[Erlang]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://ulf.wiger.net/weblog/?p=59</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>Pleased with my initial success with coLinux, I set out to add the finishing touches.</p>
<p>I&#8217;ve gone back and forth on the network configuration, trying e.g. to carefully follow <a href="http://colinux.wikia.com/wiki/Bebbo%27s_Configuration">Bebbo&#8217;s config example</a>. It didn&#8217;t work for me. There seem to be issues running TAP on Vista, and bridging with my Wireless LAN interface caused the WLAN connection to start acting up. I also tried the Microsoft Loopback adapter, but no joy. I finally figured out that just using slirp with the following (recommended) setting:</p>
<p>(upate: I made a last minute change that proved wrong. This is what works.)<br />
<del datetime="2008-10-16T21:32:54+00:00"><code>eth0=slirp</code></del><br />
<code>eth0=slirp,,tcp:5901:5900</code> </p>
<p>worked just fine. The only problem was that I thought I had to set the DISPLAY variable to the (dynamically configured) IP address of my laptop. But looking at the auto-generated setting for eth0 in /etc/network/interfaces, I realized that slirp had assigned an IP address for my laptop, as seen from the coLinux end:</p>
<p><code>iface eth0 inet static<br />
   address 10.0.2.15<br />
   broadcast 10.0.2.255<br />
   netmask 255.255.255.0<br />
   gateway 10.0.2.2</code></p>
<p>The &#8220;gateway&#8221; address was the one I needed, so I could just hardcode the following in my .bashrc:</p>
<p><code>export DISPLAY=10.0.2.2:0.0</code></p>
<p><a href="http://sourceforge.net/projects/xming">Xming</a> is said to be a lighter and better X-Windows server than Cygwin X, so I set out to change. No major issues, except that I had a very hard time figuring out how to get it do display Swedish characters. I&#8217;d suffered this in the coLinux console too, but that was ok, since I intended to jump into X as soon as possible.</p>
<p>Fixing the language support in the console was &#8230; uhm, not so easy, but I&#8217;ll attribute that to my being sorely out of practice on linux admin chores. Googling indicated that the cure was</p>
<p><code>apt-get install locales<br />
dpkg-reconfigure locales<br />
apt-get install console-data<br />
dpkg-reconfigure console-data</code></p>
<p>Close, but no cigar. I also had to do<br />
<code>apt-get install kbd</code></p>
<p>Now, I had Swedish characters in the console, but not in X. Finally, I found <a href="http://www.linux.nu/modules.php?op=modload&#038;name=phpBB_14&#038;file=index&#038;action=viewtopic&#038;topic=14226&#038;forum=25&#038;1">this post</a> (in Swedish), suggesting that it&#8217;s a bug in Xming&#8217;s definition of the Swedish layout. Specifying Finnish layout instead solved the problem.</p>
<p>The command line for Xming now looks like this:</p>
<p><code>exec0="c:\Program Files\Xming\Xming.exe -multiwindow -clipboard -silent-dup-error -xkbmodel pc105 -xkblayout fi"</code></p>
<p>I also switched to <a href="http://www.pulseaudio.org/">PulseAudio</a>. Following the <a href="http://colinux.wikia.com/wiki/Sound_support_in_Colinux">instructions on the coLinux wiki</a> worked for me.</p>
<p>I also tried setting the environment variable COLINUX_NO_SMP_WORKAROUND=Y, to get coLinux to use both cores. I was disappointed to see that <code>erl -smp</code> still only saw one CPU. Apparently, coLinux makes internal use of SMP, but makes it look like a single-core system for the linux applications. My win32 version of Erlang does see both CPUs, though.</p>
<p>Also, it seems as if erlang under coLinux suffers from the same problem as under Win32 &#8211; erlang:now() doesn&#8217;t have sufficient resolution:</p>
<p><code>Eshell V5.6.4  (abort with ^G)<br />
1&gt; [erlang:now() || _ &lt;- lists:seq(1,10)].<br />
[{1224,77892,229402},<br />
 {1224,77892,229403},<br />
 {1224,77892,229404},<br />
 {1224,77892,229405},<br />
 {1224,77892,229406},<br />
 {1224,77892,229407},<br />
 {1224,77892,229408},<br />
 {1224,77892,229409},<br />
 {1224,77892,229410},<br />
 {1224,77892,229411}]</code></p>
<p>Note how it increments by 1 usec each time? On my other laptop running Ubuntu, the diff is ca 12 usec between each (by definition, erlang:now() <em>always</em> steps up at least 1 usec). I wish I could say that my Vista laptop is ~10x faster, but that&#8217;s not it. Apparently, coLinux doesn&#8217;t offer a gethrtime(). gethrvtime() also seems to be missing, and configure reports clock_gettime() as &#8220;not stable&#8221;. No disaster, perhaps, but a good erlang:now() is often useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://ulf.wiger.net/weblog/2008/10/15/colinux-the-devils-in-the-details/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>coLinux on top of Vista</title>
		<link>http://ulf.wiger.net/weblog/2008/10/14/colinux-on-top-of-vista/</link>
		<comments>http://ulf.wiger.net/weblog/2008/10/14/colinux-on-top-of-vista/#comments</comments>
		<pubDate>Tue, 14 Oct 2008 13:10:44 +0000</pubDate>
		<dc:creator>Ulf Wiger</dc:creator>
				<category><![CDATA[Erlang]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[erlang linux vista]]></category>

		<guid isPermaLink="false">http://ulf.wiger.net/weblog/?p=46</guid>
		<description><![CDATA[Since I&#8217;m lugging around a dual-core Vista laptop, I thought I&#8217;d try to make it more useful for hacking. I&#8217;ve tried using the win32 version of xemacs, Eclipse (crashed due to some lock violation), other editors like TotalEdit, et al, but it all feels very clunky compared to a unix environment. Cygwin is ok, but [...]]]></description>
			<content:encoded><![CDATA[<p>Since I&#8217;m lugging around a dual-core Vista laptop, I thought I&#8217;d try to make it more useful for hacking.</p>
<p>I&#8217;ve tried using the win32 version of xemacs, Eclipse (crashed due to some lock violation), other editors like TotalEdit, et al, but it all feels very clunky compared to a unix environment. Cygwin is ok, but has its issues as well. For one thing, running erlang from within a cygwin shell messes up command-line editing.</p>
<p>Enter <a href="http://www.colinux.org">Cooperative Linux</a>, or coLinux &#8211; a port of the Linux kernel that allows it to run natively alongside another OS. I played around a bit with various pre-built distributions, and finally settled for the bare-bones Debian Etch root file system that comes as an option with the basic coLinux install. I <a href="http://colinux.wikia.com/wiki/XCoLinux">use my existing Cygwin X server</a>, and <a href="http://colinux.wikia.com/wiki/ExpandingRoot">resized the root partition</a> up to <del datetime="2008-10-18T21:08:38+00:00">16</del> 8 GB.</p>
<p>So far, so good. I&#8217;ve used apt-get to install the necessary utilities, and was able to build Erlang/OTP R12B-4 without problems. The system feels pretty much like a native linux installation.</p>
<p><a href="http://ulf.wiger.net/images/colinux-vista.jpg"><img src="http://ulf.wiger.net/images/colinux-vista.jpg" alt="coLinux on Vista" width="505" height="426"/></a></p>
<p>The thing I have yet to figure out is how to share a file system between coLinux and Vista. I thought of using a Cygwin NFS daemon, but I don&#8217;t seem to have enough access privileges on my work laptop to pull that off. But overall, it feels extremely promising.</p>
]]></content:encoded>
			<wfw:commentRss>http://ulf.wiger.net/weblog/2008/10/14/colinux-on-top-of-vista/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

