<?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>Felipe Alfaro Solana &#187; Linux</title>
	<atom:link href="http://www.felipe-alfaro.org/blog/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.felipe-alfaro.org/blog</link>
	<description>A little bit of technology, security and networking with Linux, FreeBSD and Mac OS X, plus some personal opinions.</description>
	<lastBuildDate>Sun, 23 Oct 2011 16:46:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>BTRFS and Ubuntu Lucid 10.04</title>
		<link>http://www.felipe-alfaro.org/blog/2010/05/08/btrfs-and-ubuntu-lucid-10-04/</link>
		<comments>http://www.felipe-alfaro.org/blog/2010/05/08/btrfs-and-ubuntu-lucid-10-04/#comments</comments>
		<pubDate>Fri, 07 May 2010 22:17:03 +0000</pubDate>
		<dc:creator>Felipe Alfaro Solana</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.felipe-alfaro.org/blog/?p=510</guid>
		<description><![CDATA[Although Ubuntu Lucid 10.04 has native support for BTRFS, it does not like very much auto-mounting a BTRFS volume during start up. The problem seems to be that btrfsctl -a is not invoked during the boot process. It takes some hacks to udev and initramfs to get this working. I found the solution in HowTO: [...]]]></description>
			<content:encoded><![CDATA[<p>Although Ubuntu Lucid 10.04 has native support for BTRFS, it does not like very much auto-mounting a BTRFS volume during start up. The problem seems to be that <code>btrfsctl -a</code> is not invoked during the boot process.</p>
<p>It takes some hacks to <code>udev</code> and <code>initramfs</code> to get this working. I found the solution in <a href="http://ubuntuforums.org/showthread.php?t=1389279">HowTO: Btrfs Root Installation</a>:</p>
<p>This <code>initramfs</code> script will make sure the <code>btrfsctl</code> binary gets copied to the RAM disk:</p>
<div>
<pre>
$ cat /usr/share/initramfs-tools/hooks/btrfs
#!/bin/sh -e
# initramfs hook for btrfs

if [ "$1" = "prereqs" ]; then
    exit 0
fi

. /usr/share/initramfs-tools/hook-functions

if [ -x "`which btrfsctl`" ]; then
    copy_exec "`which btrfsctl`" /sbin
fi
</pre>
</div>
<p>I believe the following is not strictly necessary unless you plan on having a BTRFS-based root filesystem:</p>
<div>
<pre>
$ cat /usr/share/initramfs-tools/modules.d/btrfs
# initramfs modules for btrfs
libcrc32c
crc32c
zlib_deflate
btrfs
</pre>
</div>
<p>This will load the BTRFS module while the system boots up, and calls <code>btrfsctl -a</code> to prepare the BTRFS volumes:</p>
<div>
<pre>
$ cat /usr/share/initramfs-tools/scripts/local-premount/btrfs
#!/bin/sh -e
# initramfs script for btrfs

if [ "$1" = "prereqs" ]; then
    exit 0
fi

modprobe btrfs

if [ -x /sbin/btrfsctl ]; then
    /sbin/btrfsctl -a 2>/dev/null
fi
</pre>
</div>
<p>Mark the scripts executable:</p>
<div>
<pre>
chmod +x /usr/share/initramfs-tools/scripts/local-premount/btrfs
chmod +x /usr/share/initramfs-tools/hooks/btrfs
</pre>
</div>
<p>Rebuild the initial RAM disks and GRUB environment:</p>
<div>
<pre>
update-initramfs -u -k all
update-grub
</pre>
</div>
<p>That should do it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.felipe-alfaro.org/blog/2010/05/08/btrfs-and-ubuntu-lucid-10-04/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>vsftpd: anonymous FTP uploads</title>
		<link>http://www.felipe-alfaro.org/blog/2010/01/13/vsftpd-anonymous-ftp-uploads/</link>
		<comments>http://www.felipe-alfaro.org/blog/2010/01/13/vsftpd-anonymous-ftp-uploads/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 01:03:04 +0000</pubDate>
		<dc:creator>Felipe Alfaro Solana</dc:creator>
				<category><![CDATA[FTP]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.felipe-alfaro.org/blog/?p=494</guid>
		<description><![CDATA[In order to have an anonymous-only FTP server that allows anonymous uploads, based on vsftpd running on Ubuntu 9.10, I applied the following configuration changes: --- /etc/vsftpd.conf.orig 2010-01-13 02:00:46.287216196 +0100 +++ /etc/vsftpd.conf 2010-01-13 01:59:34.787215294 +0100 @@ -26,16 +26,18 @@ #local_enable=YES # # Uncomment this to enable any form of FTP write command. -#write_enable=YES +write_enable=YES # [...]]]></description>
			<content:encoded><![CDATA[<p>In order to have an anonymous-only FTP server that allows anonymous uploads, based on <code>vsftpd</code> running on Ubuntu 9.10, I applied the following configuration changes:</p>
<div>
<pre>
--- /etc/vsftpd.conf.orig	2010-01-13 02:00:46.287216196 +0100
+++ /etc/vsftpd.conf	2010-01-13 01:59:34.787215294 +0100
@@ -26,16 +26,18 @@
 #local_enable=YES
 #
 # Uncomment this to enable any form of FTP write command.
-#write_enable=YES
+write_enable=YES
 #
 # Default umask for local users is 077. You may wish to change this to 022,
 # if your users expect that (022 is used by most other ftpd's)
 #local_umask=022
+anon_umask=0222
+file_open_mode=0666
 #
 # Uncomment this to allow the anonymous FTP user to upload files. This only
 # has an effect if the above global write enable is activated. Also, you will
 # obviously need to create a directory writable by the FTP user.
-#anon_upload_enable=YES
+anon_upload_enable=YES
 #
 # Uncomment this if you want the anonymous FTP user to be able to create
 # new directories.
</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.felipe-alfaro.org/blog/2010/01/13/vsftpd-anonymous-ftp-uploads/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Chromium and ERR_NAME_NOT_RESOLVED</title>
		<link>http://www.felipe-alfaro.org/blog/2009/07/15/chromium-on-ubuntu-linux-and-err_name_not_resolved/</link>
		<comments>http://www.felipe-alfaro.org/blog/2009/07/15/chromium-on-ubuntu-linux-and-err_name_not_resolved/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 09:35:24 +0000</pubDate>
		<dc:creator>Felipe Alfaro Solana</dc:creator>
				<category><![CDATA[Chromium]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.felipe-alfaro.org/blog/?p=372</guid>
		<description><![CDATA[While trying to use Chromium on a Ubuntu 64-bit machine, I discovered I wasn&#8217;t able to browse to any web page. I always got the following error message: This webpage is not available. The webpage at http://www.google.com/ might be temporarily down or it may have moved permanently to a new web address. Here are some [...]]]></description>
			<content:encoded><![CDATA[<p>While trying to use Chromium on a Ubuntu 64-bit machine, I discovered I wasn&#8217;t able to browse to any web page. I always got the following error message:</p>
<blockquote><p>
<strong>This webpage is not available.</strong></p>
<p>The webpage at http://www.google.com/ might be temporarily down or it may have moved permanently to a new web address.</p>
<p>Here are some suggestions:<br />
Reload this web page later.<br />
More information on this error<br />
Below is the original error message</p>
<p>Error 105 (net::ERR_NAME_NOT_RESOLVED): The server could not be found.
</p></blockquote>
<p>DNS name resolution was working properly, so it was something else. I searched for this error and most of the search results were about Chrome on Windows having problems with proxy or firewall configuration. But, who cares about Windows? So, after spending a little bit more, I found the following <a href="http://code.google.com/p/chromium/issues/detail?id=13409">issue</a> in the official Google Code web site.</p>
<p>In the end, it was just a matter of:</p>
<div>
<pre>
$ sudo apt-get install lib32nss-mdns
</pre>
</div>
<p>Why Chromium has a an explicit dependency on mDNS is something that still puzzles me out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.felipe-alfaro.org/blog/2009/07/15/chromium-on-ubuntu-linux-and-err_name_not_resolved/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>libvirt and bridged networking</title>
		<link>http://www.felipe-alfaro.org/blog/2009/06/07/libvirt-and-bridged-networking/</link>
		<comments>http://www.felipe-alfaro.org/blog/2009/06/07/libvirt-and-bridged-networking/#comments</comments>
		<pubDate>Sun, 07 Jun 2009 00:26:34 +0000</pubDate>
		<dc:creator>Felipe Alfaro Solana</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Virtualization]]></category>

		<guid isPermaLink="false">http://www.felipe-alfaro.org/blog/?p=363</guid>
		<description><![CDATA[libvirt and virt-manager are a blessing. They bring powerful, free, open source management to Xen- and KVM-based virtualization environments. I&#8217;ve been using both for quite a while. Also, I&#8217;ve always prefered bridged networking support for my virtual machines over NAT. While NAT is non-disruptive and allows for isolation, I typically like to easily access services [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://libvirt.org/">libvirt</a> and <a href="http://virt-manager.et.redhat.com/">virt-manager</a> are a blessing. They bring powerful, free, open source management to Xen- and KVM-based virtualization environments.</p>
<p>I&#8217;ve been using both for quite a while. Also, I&#8217;ve always prefered bridged networking support for my virtual machines over NAT. While NAT is non-disruptive and allows for isolation, I typically like to easily access services provided by my virtual machines, like SSH or NFSv4. Turns out that setting bridged networking support in <code>libvirt</code> is very easy, as long as bridged interface is detected by <code>libvirt</code>.</p>
<p>The simplest solution consists of creating a bridge interface that enslaves all the physical networks interfaces used to connect to the LAN or the Internet. For example, in Ubuntu, in order to enslave <code>eth0</code> to a <code>br0</code> bridge interface, while using DHCP for IPv4 address configuration, <code>/etc/network/interfaces</code> needs to look like this:</p>
<div>
<pre>
# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet manual

# The bridge
auto br0
iface br0 inet dhcp
        bridge_ports eth0
        bridge_stp off
        bridge_fd 0
        bridge_maxwait 0
</pre>
</div>
<p>Next time, when creating a new virtual machine, it will be possible to use bridged networking in addition to NAT-based networking. There is one caveat, at least in Ubuntu: <code>libvirt</code> and <code>virt-manager</code> by default connect to <code>qemu:///user</code> instead of <code>qemu:///system</code>. This is neither good nor bad by itself. <code>qemu:///user</code> allows a non-privileged user to create and use virtual machines and the process of creating and destroying the virtual network interfaces used by the virtual machines is done within the context of the user running <code>virt-manager</code>. Due to lack of <code>root</code> privileges, virtual machines are limited to QEMU&#8217;s usermode networking support. In order to use advanced networking feautures like bridged networking, make sure you connect to <code>qemu:///system</code> instead. That is typically achieved by running <code>virt-manager</code> as <code>root</code> (which is not necessarily nice). I tried playing with <code>udev</code> and device ownership and permission masks but it all boils down to the inability of a non-privileged user to use <code>brcrl</code> to enslave network interfaces to a bridge.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.felipe-alfaro.org/blog/2009/06/07/libvirt-and-bridged-networking/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Comments on building a new RAID5 array</title>
		<link>http://www.felipe-alfaro.org/blog/2009/05/20/comments-on-building-a-new-raid5-array/</link>
		<comments>http://www.felipe-alfaro.org/blog/2009/05/20/comments-on-building-a-new-raid5-array/#comments</comments>
		<pubDate>Wed, 20 May 2009 09:27:29 +0000</pubDate>
		<dc:creator>Felipe Alfaro Solana</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[RAID]]></category>

		<guid isPermaLink="false">http://www.felipe-alfaro.org/blog/?p=355</guid>
		<description><![CDATA[I&#8217;ve rescued the following e-mail from Neil Brown about building a new RAID5 array in Linux and why one the disks, while the array is being constructed, is marked as a spare: When creating a new raid5 array, we need to make sure the parity blocks are all correct (obviously). There are several ways to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve rescued the following <a href="http://marc.info/?l=linux-raid&#038;m=112044009718483">e-mail from Neil Brown</a> about building a new RAID5 array in Linux and why one the disks, while the array is being constructed, is marked as a spare:</p>
<blockquote><p>
When creating a new raid5 array, we need to make sure the parity<br />
blocks are all correct (obviously).  There are several ways to do<br />
this.</p>
<ol>
<li>Write zeros to all drives.  This would make the array unusable until the clearing is complete, so isn&#8217;t a good option.</li>
<li>Read all the data blocks, compute the parity block, and then write out the parity block.  This works, but is not optimal.  Remembering that the parity block is on a different drive for each &#8216;stripe&#8217;, think about what the read/write heads are doing. The heads on the &#8216;reading&#8217; drives will be somewhere ahead of the heads on the &#8216;writing&#8217; drive.  Every time we step to a new stripe and change which is the &#8216;writing&#8217; head, the other reading heads have to wait for the head that has just changes from &#8216;writing&#8217; to  &#8216;reading&#8217; to catch up (finish writing, then start reading). Waiting slows things down, so this is uniformly sub-optimal.</li>
<li>Read all data blocks and parity blocks, check the parity block to see if it is correct, and only write out a new block if it wasn&#8217;t. This works quite well if most of the parity blocks are correct as all heads are reading in parallel and are pretty-much synchronised. This is how the raid5 &#8216;resync&#8217; process in md works.  It happens after an unclean shutdown if the array was active at crash-time. However if most or even many of the parity blocks are wrong, this process will be quite slow as the parity-block drive will have to read-a-bunch, step-back, write-a-bunch.  So it isn&#8217;t good for initially setting the parity.</li>
<li>Assume that the parity blocks are all correct, but that one drive is missing (i.e. the array is degraded).  This is repaired by reconstructing what should have been on the missing drive, onto a spare.  This involves reading all the &#8216;good&#8217; drives in parallel, calculating them missing block (whether data or parity) and writing it to the &#8216;spare&#8217; drive.  The &#8216;spare&#8217; will be written to a few (10s or 100s of) blocks behind the blocks being read off the &#8216;good&#8217; drives, but each drive will run completely sequentially and so at top speed.
</li>
</ol>
<p>On a new array where most of the parity blocks are probably bad, &#8217;4&#8242;<br />
is clearly the best option. &#8216;mdadm&#8217; makes sure this happens by creating a raid5 array not with N good drives, but with N-1 good drives and one spare.  Reconstruction then happens and you should see exactly what was reported: reads from all but the last drive, writes to that last drives.
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.felipe-alfaro.org/blog/2009/05/20/comments-on-building-a-new-raid5-array/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>LVM snapshots and non-destructive Linux upgrades</title>
		<link>http://www.felipe-alfaro.org/blog/2009/05/16/lvm-snapshots-and-non-destructive-linux-upgrades/</link>
		<comments>http://www.felipe-alfaro.org/blog/2009/05/16/lvm-snapshots-and-non-destructive-linux-upgrades/#comments</comments>
		<pubDate>Sat, 16 May 2009 12:53:55 +0000</pubDate>
		<dc:creator>Felipe Alfaro Solana</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.felipe-alfaro.org/blog/?p=350</guid>
		<description><![CDATA[This post roughly describes what I do when I want to non-destructively upgrade my Linux system. By non-destructive means a procedure that allows me to upgrade but also to rollback if something goes wrong. As an example, I wanted to upgrade my Ubuntu system from Jaunty to Karmic. Since Karmic is now Alpha 1, the [...]]]></description>
			<content:encoded><![CDATA[<p>This post roughly describes what I do when I want to non-destructively upgrade my Linux system. By non-destructive means a procedure that allows me to upgrade but also to rollback if something goes wrong. As an example, I wanted to upgrade my Ubuntu system from Jaunty to Karmic. Since Karmic is now Alpha 1, the chances of the upgrade going bad or eating my data were high. Here is where LVM and LVM snapshots come into scene.</p>
<p>Basically, the idea consists of taking a snapshot of the root filesystem using an LVM snapshot, then reboot the system to use the filesystem from the LVM snapshot as the root filesystem, perform an in-place upgrade of Jaunty to Karmic and see what happens. Since the upgrade takes place on a system running with the root filesystem mounted from the LVM snapshot, the original root volume is kept intact. Hence, if something goes wrong I can always reboot in order to use the original root filesystem and the system would behave as if no modifications were done at all during the upgrade.</p>
<p>The LVM snapshot volume should be big enough to, in the worst case, store a completely new Linux installation. The average Ubuntu installation requires less than 8GB of disk, so the LVM snapshot should be about that size plus some slack required to download the packages. In my case, and since I have free enough disk space, I chose 16GB just to be on the safe side.</p>
<h2>Resize the root filesystem and root volume</h2>
<p>This step is only required if there is no space in the volume group to accommodate for the snapshot volume. In my case, the volume group is full so I need to shrink the root filesystem and the root volume. <code>resize2fs</code> does not currently allow one to shrink a filesystem online, so I booted from the Jaunty LiveCD and entered rescue mode. From there:</p>
<div>
<pre>
# e2fsck -f /dev/root/root
# resize2fs /dev/root/root 80G
# lvresize -L 80G /dev/root/root
</pre>
</div>
<h2>Create the LVM snapshot</h2>
<p>To create an 16GB LVM snapshot volume of my root volume:</p>
<div>
<pre>
# lvcreate -s -n karmic-root -L 16G /dev/root/root
</pre>
</div>
<h2>Prepare the boot environment</h2>
<p>Mount the filesystem from the LVM snapshot volume and modify <code>/etc/fstab</code> to replace the device name where the original root filesystem is with the device name where the snapshotted rool filesystem lives:</p>
<div>
<pre>
# mount /dev/root/karmic-root /mnt
# vi /mnt/etc/fstab
</pre>
</div>
<p>In my case, the line for the new root filesystem looks like:</p>
<div>
<pre>
/dev/root/karmic-root /  ext4 defaults 0 1
</pre>
</div>
<h2>Reboot into the snapshot</h2>
<p>Trigger the <code>grub</code> menu and modify the <code>kernel</code> entry that corresponds to the Ubuntu system. The idea is to use the device name for the LVM snapshot. This is how the new <code>kernel in the menu looks like:</p>
<div>
<pre>
kernel /vmlinuz-2.6.28-11-generic root=/dev/root/karmic-root ro
</pre>
</div>
<p>Then press </code><code>b</code> to boot the system. The system should boot normally, but instead of using the original root filesystem it should be using the filesystem from the LVM snapshot:</p>
<div>
<pre>
$ grep /dev/mapper /proc/mounts
/dev/mapper/root-karmic--root / ext4 rw,relatime,errors=remount-ro,barrier=1,data=ordered 0 0
</pre>
</div>
<h2>In-place upgrade</h2>
<p>I won&#8217;t describe how to do an in-place upgrade of Ubuntu. There are many resources out there that describe how to do that. The point here is that the upgrade will modify the snapshot while the original root filesystem is kept intact.</p>
<h2>Destroy the snapshot</h2>
<p>If something goes wrong with the update, and it usually goes wrong when upgrading to an Alpha version, to bring the system back to a usable state is just a matter of rebooting the system and using the right entry listed in <code>grub</code>. In-place upgrades of Ubuntu will typically add a new kernel to the list of entries in <code>grub</code> but won&#8217;t modify the existing ones.</p>
<p>After rebooting into the original system, the snapshot can be removed:</p>
<div>
<pre>
# lvremove /dev/root/karmic-root
</pre>
</div>
<p>If you don&#8217;t intend to experiment with upgrades, perhaps you want to resize the root LVM volume, then the root filesystem back to their original size.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.felipe-alfaro.org/blog/2009/05/16/lvm-snapshots-and-non-destructive-linux-upgrades/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Scrolling with the Thinkpad&#8217;s TrackPoint in Ubuntu 8.10 Intrepid</title>
		<link>http://www.felipe-alfaro.org/blog/2008/10/11/scrolling-with-the-thinkpads-trackpoint-in-ubuntu-810-intrepid/</link>
		<comments>http://www.felipe-alfaro.org/blog/2008/10/11/scrolling-with-the-thinkpads-trackpoint-in-ubuntu-810-intrepid/#comments</comments>
		<pubDate>Sat, 11 Oct 2008 13:16:13 +0000</pubDate>
		<dc:creator>Felipe Alfaro Solana</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[X11]]></category>

		<guid isPermaLink="false">http://www.felipe-alfaro.org/blog/?p=249</guid>
		<description><![CDATA[Recently, I upgraded to Ubuntu 8.10 Intrepid Ibex and found that my Thinkpad&#8217;s TrackPoint scrolling stopped working. While searching on the Internet, I found a post called Scrolling with the Thinkpad&#8217;s TrackPoint in Ubuntu 8.10 Intrepid by Phil Sung that explains in a clear and concise way how to enabling scrolling in Ubuntu 8.10 using [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I upgraded to Ubuntu 8.10 Intrepid Ibex and found that my Thinkpad&#8217;s TrackPoint scrolling stopped working. While searching on the Internet, I found a post called <a href="http://psung.blogspot.com/2008/09/scrolling-with-thinkpads-trackpoint-in.html">Scrolling with the Thinkpad&#8217;s TrackPoint in Ubuntu 8.10 Intrepid</a> by <a href="http://psung.blogspot.com">Phil Sung</a> that explains in a clear and concise way how to enabling scrolling in Ubuntu 8.10 using the ThinkPad TrackPoint.</p>
<p>I&#8217;m quoting what Phil says in his post:</p>
<blockquote><p>Ubuntu Intrepid (8.10) switches to evdev for X server input, which has the unfortunate side effect of breaking old EmulateWheel configurations. So scrolling using the middle button + TrackPoint (which I absolutely love) was broken for a while. However, the version of evdev in Intrepid has now caught up and supports these features. Instead of modifying your <code>xorg.conf</code>, create a new file called <code>/etc/hal/fdi/policy/mouse-wheel.fdi</code> with the following contents:
</p></blockquote>
<div>
<pre>
&lt;match key="info.product" string="TPPS/2 IBM TrackPoint"&gt;
 &lt;merge key="input.x11_options.EmulateWheel" type="string"&gt;true&lt;/merge&gt;
 &lt;merge key="input.x11_options.EmulateWheelButton" type="string"&gt;2&lt;/merge&gt;
 &lt;merge key="input.x11_options.XAxisMapping" type="string"&gt;6 7&lt;/merge&gt;
 &lt;merge key="input.x11_options.YAxisMapping" type="string"&gt;4 5&lt;/merge&gt;
 &lt;merge key="input.x11_options.ZAxsisMapping" type="string"&gt;4 5&lt;/merge&gt;
 &lt;merge key="input.x11_options.Emulate3Buttons" type="string"&gt;true&lt;/merge&gt;
&lt;/match></pre>
</div>
<p>Thanks, Phil!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.felipe-alfaro.org/blog/2008/10/11/scrolling-with-the-thinkpads-trackpoint-in-ubuntu-810-intrepid/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Linux, mplayer and ipcrm</title>
		<link>http://www.felipe-alfaro.org/blog/2008/08/09/linux-mplayer-and-ipcrm/</link>
		<comments>http://www.felipe-alfaro.org/blog/2008/08/09/linux-mplayer-and-ipcrm/#comments</comments>
		<pubDate>Fri, 08 Aug 2008 23:20:08 +0000</pubDate>
		<dc:creator>Felipe Alfaro Solana</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[IPC]]></category>

		<guid isPermaLink="false">http://www.felipe-alfaro.org/blog/2008/08/09/linux-mplayer-and-ipcrm/</guid>
		<description><![CDATA[For the past few days, and after a few hours of uptime, mplayer refused to play videos. It was hanging while trying to open the ALSA audio. I could verify this because using -ao none as a command-line argument to mplayer fixed (as in being able to play a video with no sound) the problem. [...]]]></description>
			<content:encoded><![CDATA[<p>For the past few days, and after a few hours of uptime, <code>mplayer</code> refused to play videos. It was hanging while trying to open the ALSA audio. I could verify this because using <code>-ao none</code> as a command-line argument to mplayer <em>fixed</em> (as in being able to play a video with no sound) the problem.</p>
<p>Tired of this, I decided to <code>strace mplayer</code>. I could see it was hanging on the <code>semop()</code> system call for a semaphore with an ID of 32768. Looking at <code>/proc/sysvipc/sem</code> I could see that semaphore ID 32768 existed even when mplayer was not running, and that this IPC resource was created by a process running as me.</p>
<p>I used the <code>ipcrm -s 32768</code> command to kill this IPC resource, and I saw that this fixed the problem: I could listen to audio and videos again. I haven&#8217;t been able to determine if <code>mplayer</code> has a bug that prevents it from freeing/destroying IPC semaphores or if this is a bug of the ALSA library, though.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.felipe-alfaro.org/blog/2008/08/09/linux-mplayer-and-ipcrm/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Configuring a diskless Ubuntu</title>
		<link>http://www.felipe-alfaro.org/blog/2007/12/09/configuring-a-diskless-ubuntu/</link>
		<comments>http://www.felipe-alfaro.org/blog/2007/12/09/configuring-a-diskless-ubuntu/#comments</comments>
		<pubDate>Sun, 09 Dec 2007 02:30:02 +0000</pubDate>
		<dc:creator>Felipe Alfaro Solana</dc:creator>
				<category><![CDATA[DHCP]]></category>
		<category><![CDATA[NFS]]></category>
		<category><![CDATA[PXE]]></category>
		<category><![CDATA[TFTP]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.felipe-alfaro.org/blog/2007/12/09/configuring-a-diskless-ubuntu/</guid>
		<description><![CDATA[This post is not about doing a PXE-based network installation of Ubuntu. There are already many posts describing how to do this. This post is about setting up an Ubuntu workstation in diskless mode, such as the workstation boots via PXE and the root filesystem is mounted over NFS. The process consists on the following [...]]]></description>
			<content:encoded><![CDATA[<p>This post is not about doing a PXE-based network installation of Ubuntu. There are already many posts describing how to do this. This post is about setting up an Ubuntu workstation in diskless mode, such as the workstation boots via PXE and the root filesystem is mounted over NFS.</p>
<p>The process consists on the following main steps:</p>
<ol>
<li>Setting up the DHCP server</li>
<li>Setting up the TFTP server and configuring PXE boot</li>
<li>Setting up the NFS server</li>
<li>Bootstrapping a Ubuntu installation into the client&#8217;s root filesystem</li>
<li>Booting up the diskless workstation</li>
</ol>
<h2>1. Setting up the DHCP server</h2>
<p>PXE-enabled workstations need to get an additional option during the DHCP negotiation that will point them to a TFTP server where the PXE-compatible boot loader code can be downloaded. Configuring <a href="http://www.thekelleys.org.uk/dnsmasq/doc.html"><code>dnsmasq</code></a> to hand this option to clients is just as easy as adding the following line to <code>/etc/dnsmasq.conf</code>:</p>
<div>
<pre>
dhcp-boot=pxelinux.0,tftp.lan,10.42.242.13
</pre>
</div>
<p>and restarting the <code>dnsmasq</code> service.</p>
<h2>2. Setting up the TFTP server and configuring PXE boot</h2>
<p>Now that DHCP has been configured, the next step is setting up the TFTP server. The TFTP server will be used by PXE-compatible clients to download the PXE boot loader code, and also the Linux kernel and Linux initial RAM disk.</p>
<p>I will use H. P. Anvin&#8217;s TFTP server as it&#8217;s widely used and works fairly well:</p>
<div>
<pre>
root@tftp.lan:# apt-get install tftpd-hpa
</pre>
</div>
<p><code>tftpd-hpa</code> does not integrate automatically with <code>xinetd</code> so if you want to run the TFTP server under <code>xinetd</code>, you will have to create the following file, which was ported from the <code>inetd</code> description that is created automatically in <code>/etc/inetd.conf</code> when <code>tftpd-hpa</code> is installed:</p>
<div>
<pre>
service tftp
{
        disable         = no
        id              = chargen-dgram
        socket_type     = dgram
        protocol        = udp
        user            = root
        wait            = yes
        server          = /usr/sbin/in.tftpd
        server_args     = -s /var/lib/tftpboot/
}
</pre>
</div>
<p>then restarting the <code>xinetd</code> service.</p>
<p>Configuring PXE boot is just a matter of copying the PXE boot loader code, a configuration file, the Linux kernel and initial RAM disks under the TFTP root. First, install <code>syslinux</code> and copy the PXE boot loader code to the TFTP server root:</p>
<div>
<pre>
root@tftp.lan:# apt-get install syslinux
root@tftp.lan:# cp /usr/lib/syslinux/pxelinux.0 /var/lib/tftpboot/
root@tftp.lan:# mkdir /var/lib/tftpboot/pxelinux.cfg
</pre>
</div>
<p>The Linux PXE boot loader code, <code>syslinux</code>, expects that a configuration file describing what kernel, its boot parameters, and the initial RAM disk to use to be stored within a directory named <code>pxelinux.cfg</code> just under the TFTP server root.</p>
<p>Client-specific config files can be created (based on the client MAC address, for example). We will create a config file that is suitable for any client. This configuration file is called <code>default</code> and can be created by running the following commands:</p>
<div>
<pre>
root@tftp.lan:# KERNEL_VERSION=2.6.22-14-generic
root@tftp.lan:# NFS_IPADDR=$(host nfs.lan | cut -d' ' -f4)
root@tftp.lan:# cat &gt; /var/lib/tftpboot/pxelinux.cfg/default &lt;&lt; EOF
> LABEL linux
> KERNEL vmlinuz-${KERNEL_VERSION}
> APPEND root=/dev/nfs initrd=initrd.img-${KERNEL_VERSION} nfsroot=${NFS_IPADDR}:/home/nfsroot ip=dhcp rw
> EOF
</pre>
</div>
<h2>3. Setting up the NFS server</h2>
<p>In this step, we will configure the NFS server and export the directory where the client&#8217;s root filesystem will be stored.</p>
<p>Let&#8217;s start by installing the NFS server packages:</p>
<div>
<pre>
root@nfs.lan:# apt-get install nfs-kernel-server nfs-common
</pre>
</div>
<p>I will use <code>/home/nfsroot</code> as the root for the client&#8217;s root filesystem</p>
<div>
<pre>
root@nfs.lan:# mkdir /home/nfsroot
</pre>
</div>
<p>Next, add the following line to <code>/etc/exports</code> in order to export the the client&#8217;s root filesystem:</p>
<div>
<pre>
/home/nfsroot *,gss/krb5(rw,no_subtree_check,async,no_root_squash)
</pre>
</div>
<p>Then re-export all the filesystems:</p>
<div>
<pre>
root@nfs.lan:# exportfs -avr
</pre>
</div>
<h2>4. Bootstrapping a Ubuntu installation into the client&#8217;s root filesystem</h2>
<p>The following steps will bootstrap the installation of a minimal Ubuntu Hardy Heron GNU/Linux system into the client&#8217;s root:</p>
<div>
<pre>
root@nfs.lan:# debootstrap --arch i386 hardy \
  /home/nfsroot http://ch.archive.ubuntu.com/ubuntu/
</pre>
</div>
<p>Only the minimum required packages will be downloaded from the Internet and installed into <code>/home/nfsroot</code>. The output of the previous command should look like this:</p>
<div>
<pre>
I: Retrieving Release
I: Retrieving Packages
I: Validating Packages
I: Resolving dependencies of required packages...
I: Resolving dependencies of base packages...
I: Found additional required dependencies: libdb4.6
I: Checking component main on http://ch.archive.ubuntu.com/ubuntu...
I: Retrieving adduser
I: Validating adduser
...
I: Base system installed successfully.
</pre>
</div>
<p>Once the system has been bootstrapped, we need to populate <code>fstab</code>. At least, <code>/proc</code> and <code>/</code> must get mounted, but other filesystems might be referenced in this file too, like additional NFS exports, swap files, and so on. The difference with respect a traditional, disk-based Ubuntu installation, is that the root filesystem gets mounted via NFS by the intial RAM disk, and is referenced by the kernel&#8217;s <code>/dev/nfs</code> block device.</p>
<p>The contents of <code>/home/nfsroot/etc/fstab</code> should look like this:</p>
<div>
<pre>
# /etc/fstab: static file system information.
#
# &lt;file system&gt; &lt;mount point&gt; &lt;type&gt; &lt;options&gt; &lt;dump&gt; &lt;pass&gt;
proc            /proc         proc   defaults       0      0
/dev/nfs        /             nfs    defaults       0      0
</pre>
</div>
<p>Another difference with a traditional Ubuntu system is that we don&#8217;t want the network interfaces be managed by Network Manager. In fact, the main (probably Ethernet) network interface was already configured by the kernel based on PXE&#8217;s supplied configuration. Letting Nework Manager reconfigure or manage this network interface might mean losing the connection to the NFS server and, thus, rendering the system unusable.</p>
<p>To stop Network Manager from managing the main network interface, the contents of <code>/home/nfsroot/etc/network/interfaces</code> must look like this:</p>
<div>
<pre>
# Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
# /usr/share/doc/ifupdown/examples for more information.

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface, commented out for NFS root
iface eth0 inet manual
</pre>
</div>
<p>Finally, we will give the client a generic name. This can be done by storing that generic name into /etc/hostname:</p>
<div>
<pre>
root@nfs.lan:# echo client.lan &gt; /home/nfsroot/etc/hostname
</pre>
</div>
<h2>Booting up the diskless workstation</h2>
<p>Once everything is set up, the last thing to do is testing that the diskless workstation is able to boot via PXE. The mechanics of booting via PXE depend on the machine. On some machines, it&#8217;s just a matter of pressing ESC to get into a menu that allows to override the boot device. On others, the same can be done by pressing F12 during the POST. On most modern systems it&#8217;s possible to reconfigure the system to always boot from the network.</p>
<p>If the client is able to boot from PXE successfully, this is what you will briefly see on your screen:</p>
<div>
<pre>
CLIENT MAC ADDR: 00 11 22 33 44 55 66  GUID: 00000000 0000 0000 0000 000000000000
CLIENT IP: 192.168.0.2  MASK: 255.255.255.0  DHCP IP: 192.168.0.1
GATEWAY IP: 192.168.0.1

PXELNUX 3.36 Debian-2007-08-30  Copyright (C) 1994-2007 H. Peter Anvin
UNDI data segment at:   00094140
UNDI data segment size: 94B0
UNDI code segment at:   0009D5F0
UNDI code segment size: 20B0
PXE entry point found (we hope) at 9D5F:0106
My IP address seems to be C0A80001 192.168.0.2
ip=192.168.0.2:192.168.0.1:192.168.0.1:255.255.255.0
TFTP prefix:
Tring to load: pxelinux.cfg/00-01-02-03-04-05
Tring to load: pxelinux.cfg/C0A80001
Tring to load: pxelinux.cfg/C0A8000
Tring to load: pxelinux.cfg/C0A800
Tring to load: pxelinux.cfg/C0A80
Tring to load: pxelinux.cfg/C0A8
Tring to load: pxelinux.cfg/C0A
Tring to load: pxelinux.cfg/C0
Tring to load: pxelinux.cfg/C
Tring to load: pxelinux.cfg/default
boot:
Loading vmlinuz...
</pre>
</div>
<p>If the system boots up, we will be dropped into a text-mode console where we can log in as <code>root</code> with no password. Of course, the first thing you should do is creating a password for the <code>root</code> user, but if you have been able to get to this point, you probably know how to do it <img src='http://www.felipe-alfaro.org/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Once you are logged in as your in your new diskless workstation, you will probably want to add more functionality. For example, installing the <a href="http://www.openssh.org">OpenSSH</a> server, or the packages for the typical Ubuntu desktop system. Before you do that, we will need to add more Ubuntu repositories to <code>/etc/apt/sources.list</code>. This is how mine looks like:</p>
<div>
<pre>
deb http://ch.archive.ubuntu.com/ubuntu/ feisty main restricted
deb-src http://ch.archive.ubuntu.com/ubuntu/ feisty main restricted
deb http://ch.archive.ubuntu.com/ubuntu/ feisty-updates main restricted
deb-src http://ch.archive.ubuntu.com/ubuntu/ feisty-updates main restricted
deb http://ch.archive.ubuntu.com/ubuntu/ feisty universe
deb-src http://ch.archive.ubuntu.com/ubuntu/ feisty universe
deb http://ch.archive.ubuntu.com/ubuntu/ feisty multiverse
deb-src http://ch.archive.ubuntu.com/ubuntu/ feisty multiverse
deb http://ch.archive.ubuntu.com/ubuntu/ feisty-backports main restricted universe multiverse
deb-src http://ch.archive.ubuntu.com/ubuntu/ feisty-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu feisty-security main restricted
deb-src http://security.ubuntu.com/ubuntu feisty-security main restricted
deb http://security.ubuntu.com/ubuntu feisty-security universe
deb-src http://security.ubuntu.com/ubuntu feisty-security universe
deb http://security.ubuntu.com/ubuntu feisty-security multiverse
deb-src http://security.ubuntu.com/ubuntu feisty-security multiverse
</pre>
</div>
<p>Finally, I decided to install OpenSSH, OpenNTPD and the typical Ubuntu desktop:</p>
<div>
<pre>
root@client.lan:# apt-get update
root@client.lan:# apt-get install openssh-server openntpd ubuntu-desktop
</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.felipe-alfaro.org/blog/2007/12/09/configuring-a-diskless-ubuntu/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Installing FreeNX 0.7.1 on Ubuntu</title>
		<link>http://www.felipe-alfaro.org/blog/2007/11/24/installing-freenx-071-on-ubuntu/</link>
		<comments>http://www.felipe-alfaro.org/blog/2007/11/24/installing-freenx-071-on-ubuntu/#comments</comments>
		<pubDate>Sat, 24 Nov 2007 12:27:20 +0000</pubDate>
		<dc:creator>Felipe Alfaro Solana</dc:creator>
				<category><![CDATA[NX]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://felipe-alfaro.org/blog/2007/11/24/installing-freenx-071-on-ubuntu/</guid>
		<description><![CDATA[Introduction DISCLAIMER: The contents of this post are mostly based on Manual Installation How-To. Thanks to Brent Davidson and Fabian Franz for writing such a nice HowTo and the beautiful open and free implementation of FreeNX, respectively. I decided to use FreeNX instead of NoMachine&#8217;s own implementation due to the instability of the latter. Most [...]]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p><strong>DISCLAIMER</strong>: The contents of this post are mostly based on <a href="http://www.nabble.com/Manual-Installation-How-To-t4726723.html">Manual Installation How-To</a>. Thanks to Brent Davidson and Fabian Franz for writing such a nice HowTo and the beautiful open and free implementation of FreeNX, respectively.</p>
<p>I decided to use FreeNX instead of NoMachine&#8217;s own implementation due to the instability of the latter. Most of the times, I could not reconnect to my running sessions, or else NX decided to kill my running session and start a new one. FreeNX is a collection of shell scripts, which makes it easier to debug and troubleshoot problems.</p>
<p>The process described in this post starts with the NoMachine&#8217;s binary components, downloadable from the Web, and then overwrites or replaces key components that are binary-only and closed with FreeNX&#8217;s open and free shell scripts, which provides much more flexibility. In my own experience, FreeNX is more robust, stable, predictable, easier to customize and to debug than NoMachine&#8217;s closed binary components.</p>
<h2>Installing the base NoMachine&#8217;s NX binary components</h2>
<p>Download <code>nxclient</code>, <code>nxnode</code> and <code>nxserver</code> from <a href="http://www.nomachine.com/select-package.php?os=linux&#038;id=1">NoMachine</a> as <code>.tar.gz</code> files. The files can be found in the <a href="http://www.nomachine.com/select-package.php?os=linux&#038;id=1">NoMachine downloads</a> or can be downloaded directly from this site, if you trust me:</p>
<p>For IA-32 systems:</p>
<ul>
<li><a href="/blog/wp-content/NX/nxclient-3.0.0-84.i386.tar.gz">nxclient-3.0.0-84.i386.tar.gz</a></li>
<li><a href="/blog/wp-content/NX/nxnode-3.0.0-93.i386.tar.gz">nxnode-3.0.0-93.i386.tar.gz</a></li>
<li><a href="/blog/wp-content/NX/nxserver-3.0.0-79.i386.tar.gz">nxserver-3.0.0-79.i386.tar.gz</a></li>
</ul>
<p>For x86_64 systems:</p>
<ul>
<li><a href="/blog/wp-content/NX/nxclient-3.0.0-84.x86_64.tar.gz">nxclient-3.0.0-84.x86_64.tar.gz</a></li>
<li><a href="/blog/wp-content/NX/nxnode-3.0.0-93.x86_64.tar.gz">nxnode-3.0.0-93.x86_64.tar.gz</a></li>
<li><a href="/blog/wp-content/NX/nxserver-3.0.0-79.x86_64.tar.gz">nxserver-3.0.0-79.x86_64.tar.gz</a></li>
</ul>
<p>Extract the files to <code>/usr</code>. Since the <code>.tar.gz</code> packages always contain relative pathnames that start with <code>./NX</code>, this will create a whole directory tree under <code>/usr/NX</code>.</p>
<div>
<pre>
# tar -C /usr –xzf nxserver-3.0.0-79.i386.tar.gz
# tar -C /usr –xzf nxclient-3.0.0-84.i386.tar.gz
# tar -C /usr –xzf nxnode-3.0.0-93.i386.tar.gz
</pre>
</div>
<h2>Compiling the NX compression libraries</h2>
<h3>Compiling <code>nxcomp</code></h3>
<p>Download the source code for <code>nxcomp</code> from <a href="http://www.nomachine.com/sources.php">NoMachine&#8217;s source code</a> or here from<br />
<a href="/blog/wp-content/NX/nxcomp-3.0.0-48.tar.gz">nxcomp-3.0.0-48.tar.gz</a>.</p>
<p>The <code>./configure</code> is not very robust and doesn&#8217;t check for missing dependencies. This are the packages that are needed to compile <code>nxcomp</code>:</p>
<div>
<pre>
# apt-get install zlib1g-dev libX11-dev libjpeg-dev libpng12-dev \
    x11proto-xext-dev libxdamage-dev libxrandr-dev libxtst-dev \
    libaudiofile-dev
</pre>
</div>
<p>Configuring, building the library and copying it to its final location is just as easy as running:</p>
<div>
<pre>
# tar -xzf nxcomp-3.0.0-48.tar.gz
# cd nxcomp
# ./configure --prefix=/usr/NX
# make
# cp -P libXcomp.so* /usr/NX/lib
</pre>
</div>
<h3>Compiling <code>nxcompext</code></h3>
<p>Download the source code for <code>nxcompext</code> and <code>nx-X11</code> from <a href="http://www.nomachine.com/sources.php">NoMachine&#8217;s source code</a> or here from<br />
<a href="/blog/wp-content/NX/nxcompext-3.0.0-18.tar.gz">nxcompext-3.0.0-18.tar.gz</a> and <a href="/blog/wp-content/NX/nx-X11-3.0.0-37.tar.gz">nx-X11-3.0.0-37.tar.gz</a>, and extract them:</p>
<div>
<pre>
# tar -xzf nxcompext-3.0.0-18.tar.gz
# tar -xzf nx-X11-3.0.0-37.tar.gz
</pre>
</div>
<p>Before compiling <code>nxcompext</code>, apply the <a href="/blog/wp-content/NX/NXlib-xgetioerror.patch">NXlib-xgetioerror.patch</a>.</p>
<div>
<pre>
# cd nxcompext
# patch -p0 < NXlib-xgetioerror.patch
</pre>
</pre>
</div>
<p>This is required or else the resulting <code>libXcomp.so</code> shared library will complain about <code>_XGetIOError</code> symbol being undefined. In order to troubleshoot this, I had to enable logging in <code>/usr/NX/etc/node.conf</code>:</p>
<div>
<pre>
NX_LOG_LEVEL=7
SESSION_LOG_CLEAN=0
NX_LOG_SECURE=0
</pre>
</div>
<p>Then, looking at <code>/var/log/nxserver.log</code> I found the following error message:</p>
<pre>
Info: Established X client connection.
Info: Using shared memory parameters 1/1/1/4096K.
Info: Using alpha channel in render extension.
Info: Not using local device configuration changes.
/usr/NX/bin/nxagent: symbol lookup error: /usr/NX/lib/libXcompext.so.3:
undefined symbol: _XGetIOError
NX> 1006 Session status: closed
</pre>
<p>Applying the patch solves the problem:</p>
<div>
<pre>
# ./configure --x-includes="/usr/include/xorg -I/usr/include/X11" --prefix=/usr/NX
# make
# cp -P libXcompext.so* /usr/NX/lib
</pre>
</div>
<h3>Compiling <code>nxcompshad</code></h3>
<p>Download the source code for <code>nxcompshad</code> from <a href="http://www.nomachine.com/sources.php">NoMachine&#8217;s source code</a> or here from<br />
<a href="/blog/wp-content/NX/nxcompshad-3.0.0-19.tar.gz">nxcompshad-3.0.0-19.tar.gz</a>.</p>
<div>
<pre>
# tar -xzf nxcompshad-3.0.0-19.tar.gz
# cd nxcompshad
# ./configure --prefix=/usr/NX
# make
# cp -P libXcompshad.so* /usr/NX/lib
</pre>
</div>
<h3>Compiling <code>nxesd</code></h3>
<p>Download the source code for <code>nxesd</code> from <a href="http://www.nomachine.com/sources.php">NoMachine&#8217;s source code</a> or here from<br />
<a href="/blog/wp-content/NX/nxesd-3.0.0-4.tar.gz">nxesd-3.0.0-4.tar.gz</a>.</p>
<div>
<pre>
# tar -xzf nxesd-3.0.0-4.tar.gz
# cd nxesd
# ./configure --prefix=/usr/NX
# make
# make install
</pre>
</div>
<h2>Installing FreeNX</h2>
<p>Download <a href="http://freenx.berlios.de/">FreeNX</a> from <a href="http://freenx.berlios.de/download.php">FreeNX downloads</a>, or from this Web site at <a href="/blog/wp-content/NX/freenx-0.7.1.tar.gz">freenx-0.7.1.tar.gz</a> and extract them and apply the <code>gentoo-machine.diff</code> patch:</p>
<div>
<pre>
# tar -xzf freenx-X.Y.Z.tar.gz
# cd freenx-X.Y.Z
# patch -p0 < gentoo-nomachine.diff
</pre>
</pre>
</div>
<p>The <code>gentoo-machine.diff</code> patch must be applied if you are using the <code>/usr/NX</code> directory structure that the NoMachine libraries use.</p>
<p>Next, we replace the original NoMachine key binaries (in fact, they are compiled Perl scripts) with the FreeNX shell scripts:</p>
<div>
<pre>
# cp -f nxkeygen /usr/NX/bin/
# cp -f nxloadconfig /usr/NX/bin/
# cp -f nxnode /usr/NX/bin/
# cp -f nxnode-login /usr/NX/bin/
# cp -f nxserver /usr/NX/bin/
# cp -f nxsetup /usr/NX/bin/
# cp -f nxcups-gethost /usr/NX/bin/
</pre>
</div>
<p>Next, we need to compile the <code>nxserver-helper</code> binary, which is used by the slave mode of <code>nxnode</code>. Basically, <code>nxserver-helper</code> runs a command that has both <code>/dev/fd/3</code> and <code>/dev/fd/4</code> mapped into both ends of a UNIX SOCKET.</p>
<div>
<pre>
# cd nxserver-helper
# make
# cp -f nxserver-helper /usr/NX/bin/
</pre>
</div>
<p>Before being able to set up the FreeNX, install <code>expect</code>, the OpenSSH server and <code>smbmount</code> and <code>smbumount</code>:</p>
<div>
<pre>
$ sudo apt-get install expect smbfs openssh-server
</pre>
</div>
<p>The next step creates symbolic links in <code>/usr/bin</code> to all FreeNX scripts that live in <code>/usr/NX/bin</code> and additional symbolic links for NX compatibility:</p>
<div>
<pre>
# ln -s /usr/NX/bin/nxserver /usr/bin/nxserver
# ln -s /usr/NX/bin/nxsetup /usr/sbin/nxsetup
# ln -s /usr/NX/bin/nxloadconfig /usr/sbin/nxloadconfig
# ln -s /usr/NX/lib/libXrender.so.1.2.2 /usr/NX/lib/libXrender.so.1.2
# ln -s /usr/NX/bin/nxagent /usr/NX/bin/nxdesktop
# ln -s /usr/NX/bin/nxagent /usr/NX/bin/nxviewer
# ln -s /usr/bin/foomatic-ppdfile /usr/lib/cups/driver/foomatic-ppdfile
# ln -s /etc/X11/xinit /etc/X11/xdm
# ln -s /sbin/mount.cifs /sbin/smbmount
# ln -s /sbin/umount.cifs /sbin/smbumount
</pre>
</div>
<p>The final step consists is running the installation stage of FreeNX:</p>
<div>
<pre>
# nxsetup --install
</pre>
</div>
<p>This will create <code>/usr/NX/var</code> directory tree, create the <code>nx</code> user, install the appropiate SSH keys (either the NoMachine&#8217;s keys or custom keys).</p>
<p>Before being able to use FreeNX, create the <code>node.conf</code> configuration file that allow changing the behavior of FreeNX, like logging, path names to several scripts used to start GNOME or KDE, and so on:</p>
<div>
<pre>
# cd freenx-X.Y.Z
# cp node.conf.sample /usr/NX/etc/node.conf
</pre>
</div>
<h2>Future development and ideas</h2>
<ul>
<li>Not having to depend on any single binary file from NoMachine.
<p>The idea is compiling all the components from source code, instead of starting with a binary distribution and replacing key components with their open and free counterparts.</li>
<li>Customizing FreeNX so that I can bypass NoMachine&#8217;s <code>nxclient</code> completely.
<p>Most of my network components are Kerberized and having to keep supplying my password to <code>nxclient</code> seems like a thing of the past to me. The idea is customizing FreeNX in such a way that I can leverage Kerberos authentication and drop password-based authentication completely.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.felipe-alfaro.org/blog/2007/11/24/installing-freenx-071-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>

