<?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>edwi.nl/og &#187; mce remote</title>
	<atom:link href="http://edwi.nl/og/tag/mce-remote/feed/" rel="self" type="application/rss+xml" />
	<link>http://edwi.nl/og</link>
	<description>Edwin Woudt's weblog</description>
	<lastBuildDate>Sat, 18 Apr 2009 00:15:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>MCE Remote on a Mac &#8211; or: I want more buttons!</title>
		<link>http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-or-i-want-more-buttons/</link>
		<comments>http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-or-i-want-more-buttons/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 16:30:12 +0000</pubDate>
		<dc:creator>edwin</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[htpc]]></category>
		<category><![CDATA[lirc]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[mce remote]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[vlc]]></category>
		<category><![CDATA[vm]]></category>

		<guid isPermaLink="false">http://edwi.nl/og/?p=182</guid>
		<description><![CDATA[This is a series on using an MCE Remote Control with a Mac.
While programs like Remote Buddy and Mira allow you to get much more from your apple remote, there is one drawback: it has only 6 buttons. This may work well for many people, and for applications specifically designed for it, but I just [...]]]></description>
			<content:encoded><![CDATA[<p><img class="size-full wp-image-93 alignleft" style="border: 1px solid #dddddd; margin-bottom: 12px; margin-right: 20px;" title="mac-mce-120x120" src="http://edwi.nl/og/uploads/2009/04/mac-mce-120x120.png" alt="MCE Remote on a Mac" width="120" height="120" />This is a series on using an <a href="http://www.mythtv.org/wiki/MCE_Remote">MCE Remote Control</a> with a Mac.</p>
<p>While programs like <a href="http://www.iospirit.com/">Remote Buddy</a> and <a href="http://twistedmelon.com/mira/">Mira</a> allow you to get much more from your apple remote, there is one drawback: it has only 6 buttons. This may work well for many people, and for applications specifically designed for it, but I just like to have much more control. As a recent switcher from a Windows desktop/media pc and FreeBSD/Unix server to a one-Mac-Mini-fits-all setup, I had one of those MCE remotes lying around, so that&#8217;s the one I wanted to use.</p>
<p>However, an intensive search on google and all sorts of forums did not help: as far as I know, the thing just isn&#8217;t supported. Using Remote Buddy or Mira I can use the eHome receiver delivered with my MCE Remote, but only with an Apple Remote and not the MCE Remote itself. Even looking at the Linux community did not help: while a port of the <a href="http://www.lirc.org">LIRC</a> software is available in <a href="http://www.macports.org/">MacPorts</a> it does not have any hardware support, but can only connect to a remote host. Having some good experience with running Windows and Linux as a virtual machine in <a href="http://www.parallels.com/">Parallels Desktop</a> I came to the following &#8220;solution&#8221; for my problem:</p>
<ul>
<li>Take a small Linux distribution, and run it as a VM</li>
<li>Install LIRC and the needed linux kernel modules in this VM</li>
<li>Connect my USB eHome IR receiver to LIRC in this VM</li>
<li>Also install LIRC on the Mac natively and connect it to LIRC in the Linux VM</li>
<li>Convert the button presses on the Remote Control to keypresses on my Mac using a combination of LIRC software and AppleScript</li>
</ul>
<p>It took quite a bit of digging, but in the end I got everything working and I am now controlling my <a href="http://www.videolan.org/vlc/">VLC media player</a> using an MCE remote control.</p>
<p>A few words of warning: this tutorial is not for people who:</p>
<ul>
<li>Expect ready to use software with a graphical installer, neat configuration screens etc. All of this is basically a clever workaround, and it works well for me, but if the only thing you want is a way to reconfigure some buttons from your Apple remote, then Remote Buddy or Mira is the way to go.</li>
<li>Are afraid of using the Terminal. You do not need to be a UNIX guru to follow the steps in this tutorial, but if you do not know what the Terminal is within Mac OS X, you better look through some <a href="http://www.google.com/search?q=mac%20terminal">basic toturials</a> first.</li>
</ul>
<p>If you still want to proceed, read the following three articles for the nitty gritty instructions:<br />
- <a href="http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-1-installing-finnix-as-a-parallels-vm/">Step 1: installing Finnix as a Parallels VM</a><br />
- <a href="http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-2-installing-lirc-in-the-finnix-vm/">Step 2: installing LIRC in the Finnix VM</a><br />
- <a href="http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-3-configuring-lirc-in-os-x/">Step 3: configuring LIRC in OS X</a></p>
]]></content:encoded>
			<wfw:commentRss>http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-or-i-want-more-buttons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MCE Remote on a Mac &#8211; Step 3: configuring LIRC in OS X</title>
		<link>http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-3-configuring-lirc-in-os-x/</link>
		<comments>http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-3-configuring-lirc-in-os-x/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 16:08:49 +0000</pubDate>
		<dc:creator>edwin</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[htpc]]></category>
		<category><![CDATA[lirc]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[macports]]></category>
		<category><![CDATA[mce remote]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[vlc]]></category>

		<guid isPermaLink="false">http://edwi.nl/og/?p=156</guid>
		<description><![CDATA[This is part 3 in a series on using an MCE Remote Control with a Mac. See the:
- Main article
- Step 1: installing Finnix as a Parallels VM
- Step 2: installing LIRC in the Finnix VM
Installing LIRC using MacPorts
The LIRC client executables can be installed using MacPorts. We will use these executables to connect to [...]]]></description>
			<content:encoded><![CDATA[<p><img class="size-full wp-image-93 alignleft" style="border: 1px solid #dddddd; margin-bottom: 12px; margin-right: 20px;" title="mac-mce-120x120" src="http://edwi.nl/og/uploads/2009/04/mac-mce-120x120.png" alt="MCE Remote on a Mac" width="120" height="120" />This is part 3 in a series on using an MCE Remote Control with a Mac. See the:<br />
- <a href="http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-or-i-want-more-buttons/">Main article</a><br />
- <a href="http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-1-installing-finnix-as-a-parallels-vm/">Step 1: installing Finnix as a Parallels VM</a><br />
- <a href="http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-2-installing-lirc-in-the-finnix-vm/">Step 2: installing LIRC in the Finnix VM</a></p>
<h3>Installing LIRC using MacPorts</h3>
<p>The <a href="http://www.lirc.org/">LIRC</a> client executables can be installed using <a href="http://www.macports.org/">MacPorts</a>. We will use these executables to connect to the LIRC daemon in the Finnix VM.</p>
<p>First you need to install:</p>
<ul>
<li>Apple <a href="http://developer.apple.com/TOOLS/xcode/">Xcode</a></li>
<li>MacPorts (<a href="http://www.macports.org/install.php">installation instructions</a>)</li>
</ul>
<p>Then fire up a terminal, and execute the following commands in a Mac terminal to initialize your ports tree and install LIRC:<br />
<code>$ sudo port -v selfupdate<br />
$ sudo port install lirc</code></p>
<p>While you are waiting for lirc to install, let&#8217;s already execute the next step: in order to connect to your virtual machine, you need to know the IP address used by it. Run the ifconfig command in your Finnix VM. The output looks someting like:<br />
<code>root@tty1:~# ifconfig eth0<br />
eth0&nbsp;&nbsp;&nbsp;&nbsp;Link encap:Ethernet  HWaddr 00:1c:42:f0:e5:19<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inet addr:10.37.129.3  Bcast:10.37.129.255  Mask:255.255.255.0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RX packets:813 errors:0 dropped:0 overruns:0 frame:0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TX packets:145 errors:0 dropped:0 overruns:0 carrier:0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;collisions:0 txqueuelen:1000<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RX bytes:73804 (72.0 KiB)  TX bytes:11687 (11.4 KiB)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Interrupt:10 Base address:0x8200</code></p>
<p>The ip address you are looking for is the one after &#8216;inet addr:&#8217; on the second line.</p>
<p>When lirc is installed, let&#8217;s connect to it by typing the following in your <em>Mac</em> terminal (and not the Finnix VM), obviously replacing the ip address with the one you found in the previous step:<br />
<code># sudo lircd --connect 10.37.129.3<br />
# sudo chmod 666 /opt/local/var/run/lircd</code></p>
<p>Now let&#8217;s test your setup by running &#8216;irw&#8217; and pushing some buttons. Your terminal should look like:<br />
<code># irw<br />
000000037ff07bf2 00 Home mceusb<br />
000000037ff07bf2 01 Home mceusb<br />
000000037ff07bf2 02 Home mceusb<br />
000000037ff07be9 00 Play mceusb<br />
000000037ff07be0 00 Down mceusb</code></p>
<p>Congratulations! You are now receiving your MCE Remote events on your Mac. Read on for information on how to control an application with it.<br />
<span id="more-156"></span></p>
<h3>Controlling VLC with LIRC</h3>
<p>This tutorial will now show you how to control the <a href="http://www.videolan.org/vlc/">VLC media player</a> using your MCE remote by mapping your remote buttons to keypresses.</p>
<p>First of all a script is needed that can send keystrokes. <a href="http://www.apple.com/applescript/">AppleScript</a> is the most logical candidate. A script like the following should do the trick (note: at the end of this posting you can find a link to download a full version of this script):<br />
<code>--&nbsp;Filename:&nbsp;keystroke-simple.applescript<br />
--&nbsp;Author:&nbsp;&nbsp;&nbsp;Edwin&nbsp;Woudt<br />
--&nbsp;Version:&nbsp;&nbsp;20090407-1<br />
--<br />
--&nbsp;Note:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This&nbsp;is&nbsp;a&nbsp;simplified&nbsp;version&nbsp;of&nbsp;the&nbsp;full&nbsp;script.<br />
--&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Download&nbsp;keystroke.applescript&nbsp;below&nbsp;for&nbsp;the&nbsp;full&nbsp;version.<br />
&nbsp;<br />
on run argv<br />
&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;set xkey to (item 1 of argv)<br />
&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;if ((count of argv) > 1) then<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set xmod to (item 2 of argv)<br />
&nbsp;&nbsp;&nbsp;&nbsp;else<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set xmod to ""<br />
&nbsp;&nbsp;&nbsp;&nbsp;end if<br />
&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;set xcode to 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;if xkey = "down" then set xcode to 125<br />
&nbsp;&nbsp;&nbsp;&nbsp;if xkey = "up" then set xcode to 126<br />
&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;if xmod = "" then<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if xcode = 0 then<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tell application "System Events" to keystroke xkey<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tell application "System Events" to key code xcode<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end if<br />
&nbsp;&nbsp;&nbsp;&nbsp;else<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if xcode = 0 then<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if xmod = "x" then tell application "System Events" to keystroke xkey using command down<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if xmod = "x" then tell application "System Events" to key code xcode as integer using command down<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end if<br />
&nbsp;&nbsp;&nbsp;&nbsp;end if<br />
&nbsp;&nbsp;&nbsp;&nbsp;<br />
end run</code></p>
<p>This script can be called with two command line parameters:</p>
<ol>
<li>A key, either a letter or a special key like &#8216;up&#8217;, &#8216;down&#8217;, &#8216;esc&#8217; or &#8216;enter&#8217;</li>
<li>An optional modifier, consisting of one or more of the following letters: &#8216;c&#8217; for Control, &#8216;o&#8217; for Option, &#8217;s&#8217; for Shift and/or &#8216;x&#8217; for Command (note: the simple version only supports the &#8216;x&#8217; modifier, the full version below supports all modifiers and all combinations).</li>
</ol>
<p>This script will be called from a &#8216;lircrc&#8217; file, of which the following is a small example:<br />
<code>#&nbsp;Filename:&nbsp;vlc-simple.lircrc<br />
#&nbsp;Author:&nbsp;&nbsp;&nbsp;Edwin&nbsp;Woudt<br />
#&nbsp;Version:&nbsp;&nbsp;20090407-1<br />
&nbsp;<br />
#&nbsp;&nbsp;Note:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This&nbsp;is&nbsp;a&nbsp;simplified&nbsp;version&nbsp;of&nbsp;the&nbsp;full&nbsp;file.<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Download&nbsp;vlc.lirrc&nbsp;below&nbsp;for&nbsp;the&nbsp;full&nbsp;version.<br />
&nbsp;<br />
#&nbsp;Play&nbsp;button<br />
begin<br />
&nbsp;&nbsp;&nbsp;&nbsp;prog&nbsp;&nbsp;&nbsp;=&nbsp;irexec<br />
&nbsp;&nbsp;&nbsp;&nbsp;button&nbsp;=&nbsp;Play<br />
&nbsp;&nbsp;&nbsp;&nbsp;config&nbsp;=&nbsp;/usr/bin/osascript&nbsp;~edwin/Documents/Scripts/keystroke.applescript&nbsp;p&nbsp;x<br />
end<br />
&nbsp;<br />
#&nbsp;Volume&nbsp;buttons<br />
begin<br />
&nbsp;&nbsp;&nbsp;&nbsp;prog&nbsp;&nbsp;&nbsp;=&nbsp;irexec<br />
&nbsp;&nbsp;&nbsp;&nbsp;button&nbsp;=&nbsp;VolUp<br />
&nbsp;&nbsp;&nbsp;&nbsp;config&nbsp;=&nbsp;/usr/bin/osascript&nbsp;~edwin/Documents/Scripts/keystroke.applescript&nbsp;up&nbsp;x<br />
end<br />
begin<br />
&nbsp;&nbsp;&nbsp;&nbsp;prog&nbsp;&nbsp;&nbsp;=&nbsp;irexec<br />
&nbsp;&nbsp;&nbsp;&nbsp;button&nbsp;=&nbsp;VolDown<br />
&nbsp;&nbsp;&nbsp;&nbsp;config&nbsp;=&nbsp;/usr/bin/osascript&nbsp;~edwin/Documents/Scripts/keystroke.applescript&nbsp;down&nbsp;x<br />
end</code></p>
<p>This file will basically instruct lirc to output a &#8216;Command-P&#8217; when I click on the Play button, &#8216;Command-Up Arrow&#8217; for the volume up button and &#8216;Command-Down Arrow&#8217; for the volume down button. These correspond to the default keys used by VLC, according to the VLC Preferences -> Hotkeys.</p>
<p>Create the file with a texteditor (or download my full version below) and run it in a terminal using:<br />
<code>irexec ~edwin/Documents/Scripts/vlc.lircrc</code></p>
<p>Note: all my scripts assume their location to be in the Documents/Scripts subdirectory of my home directory. Feel free to change it to a different location.</p>
<p>Now start up a video in VLC media player and try to use some buttons!</p>
<p>Download attachments:<br />
<a href="http://edwi.nl/og/uploads/2009/04/vlc.lircrc">vlc.licrc</a><br />
<a href="http://edwi.nl/og/uploads/2009/04/keystroke.applescript">keystroke.applescript</a></p>
<h3>Next steps</h3>
<p>You have now reached the end of this three part tutorial on getting your MCE remote control to work on your Mac.  Hopefully this has all worked out for you: let me know through a comment or by mailing me at <em>edwin AT woudt DOT nl</em>. </p>
<p>A few things you could do after this tutorial:</p>
<ul>
<li>change the configuration for the VLC media player to be more of your liking</li>
<li>add configuration files for other applications</li>
<li>somehow extend all this with detection of which application is running (using AppleScript?) and change the behaviour of the remote based on that</li>
<li>use a different linux distribution</li>
<li>use VirtualBox as a free alternative to Parallels</li>
</ul>
<p>If I get around to one of these things, I will post the results on this blog. Of course: should you have anything to add, let me know, whether it is a solution to one of the above suggestions, or a completely different thing. </p>
]]></content:encoded>
			<wfw:commentRss>http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-3-configuring-lirc-in-os-x/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>MCE Remote on a Mac &#8211; Step 2: installing LIRC in the Finnix VM</title>
		<link>http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-2-installing-lirc-in-the-finnix-vm/</link>
		<comments>http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-2-installing-lirc-in-the-finnix-vm/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 16:05:32 +0000</pubDate>
		<dc:creator>edwin</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[finnix]]></category>
		<category><![CDATA[htpc]]></category>
		<category><![CDATA[lirc]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[mce remote]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[parallels]]></category>

		<guid isPermaLink="false">http://edwi.nl/og/?p=64</guid>
		<description><![CDATA[This is part 2 in a series on using an MCE Remote Control with a Mac. See the:
- Main article
- Step 1: installing Finnix as a Parallels VM
- Step 3: configuring LIRC in OS X
Configure and Reboot the VM
First we need to attach our IR receiver permanently to the Finnix VM.

In the &#8216;Parallels Desktop&#8217; menu, [...]]]></description>
			<content:encoded><![CDATA[<p><img class="size-full wp-image-93 alignleft" style="border: 1px solid #dddddd; margin-bottom: 12px; margin-right: 20px;" title="mac-mce-120x120" src="http://edwi.nl/og/uploads/2009/04/mac-mce-120x120.png" alt="MCE Remote on a Mac" width="120" height="120" />This is part 2 in a series on using an MCE Remote Control with a Mac. See the:<br />
- <a href="http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-or-i-want-more-buttons/">Main article</a><br />
- <a href="http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-1-installing-finnix-as-a-parallels-vm/">Step 1: installing Finnix as a Parallels VM</a><br />
- <a href="http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-3-configuring-lirc-in-os-x/">Step 3: configuring LIRC in OS X</a></p>
<h3>Configure and Reboot the VM</h3>
<p>First we need to attach our IR receiver permanently to the Finnix VM.</p>
<ol>
<li>In the &#8216;Parallels Desktop&#8217; menu, select the &#8216;Preferences&#8217; option</li>
<li>On the &#8216;USB&#8217; page, click the &#8216;+&#8217;-sign at the bottom and select the &#8216;eHome Infrared Transceiver&#8217; to connect to the &#8216;Finnix IR&#8217; virtual machine. [<a href="http://edwi.nl/og/uploads/2009/04/usb_receiver_attach_20090406_01.png" rel="lightbox[64]">screenshot</a>]</li>
</ol>
<p>Now here comes the tricky part: while you installed Finnix on the virtual hard disk, you need to reboot it from the original virtual CD. This is because the hard disk is read-only when you boot from it, thus you cannot make any configuration changes. You can boot from the LiveCD using the following instructions:</p>
<ol>
<li>In the configuration for the Finnix VM, select the &#8216;Boot Order&#8217; page and check the &#8216;Select boot device on startup&#8217; option. [<a href="http://edwi.nl/og/uploads/2009/04/boot_finnix_cd_20090406_01.png" rel="lightbox[64]">screenshot</a>]</li>
<li>Then go to the &#8216;CD/DVD-ROM 1&#8242; page, check the &#8216;Connected&#8217; option and make sure the .iso file is still selected. [<a href="http://edwi.nl/og/uploads/2009/04/boot_finnix_cd_20090406_02.png" rel="lightbox[64]">screenshot</a>]</li>
<li>Boot the VM and press the &#8216;Esc&#8217; key. Then select option &#8216;3&#8242; to boot from the live CD. [<a href="http://edwi.nl/og/uploads/2009/04/boot_finnix_cd_20090406_03.png" rel="lightbox[64]">screenshot</a>]</li>
<li>To prevent the VM from booting from the hard disk (the livecd finds the installation in the hard disk before it&#8217;s own), select the first option and press the &#8216;Tab&#8217; key. Add &#8216;root=/dev/hdb&#8217; to the line and press &#8216;Enter&#8217;. [<a href="http://edwi.nl/og/uploads/2009/04/boot_finnix_cd_20090406_04.png" rel="lightbox[64]">screenshot</a>]</li>
</ol>
<p>To check if you have correctly booted from the Live CD instead of the hard disk, use the following command:<br />
<code>mount -l | grep ramdisk</code><br />
If the result starts with <em>/ramdisk/dev/hdb</em> then you were succesful. On the other hand if the result starts with <em>/ramdisk/dev/hda1</em> then try again!</p>
<p>Read on for the gory details of LIRC installation.<br />
<span id="more-64"></span></p>
<h3>Installing LIRC and compiling the LIRC kernel modules</h3>
<p>Some fiddling is required with the build names to get things right. This is because Finnix adds a &#8216;-finnix&#8217; to the kernel version, and replaces the 486/686 with a x86. For example, Finnix 92.1 reports its kernel version as &#8216;2.6.26-1-x86-finnix&#8217; while the corresponding Debian package with the correct headers needed for building kernel modules has version number &#8216;2.6.26-1-686&#8242;. The following commands will give you two environment variables that are helpful there (note: all of these commands need to be entered in the Finnix VM and not the Mac Terminal):<br />
<code># FINNIX=`uname -r`<br />
# VERSION=`uname -r | sed s/-finnix/ | sed s/x86/686/`<br />
# echo $FINNIX -- $VERSION</code></p>
<p>Let&#8217;s go and install some software:<br />
<code># apt-get update<br />
# apt-get install lirc lirc-modules-source linux-headers-$VERSION<br />
# m-a prepare</code><br />
Just press Enter on any questions.</p>
<p>Now here comes the fiddling: we need to trick Finnix to think the installed header files are actually from a Finnix kernel:<br />
<code># echo \#define UTS_RELEASE \"$FINNIX\" &gt; /usr/src/linux-headers-$VERSION/include/linux/utsrelease.h<br />
# echo $FINNIX &gt; /usr/src/linux-headers-$VERSION/include/config/kernel.release<br />
# mv /usr/src/linux-headers-$VERSION /usr/src/linux-headers-$FINNIX</code></p>
<p>And now we can build the lirc modules:<br />
<code># m-a a-b lirc</code></p>
<p>Next we&#8217;re going to install all relevant packages in an overlay directory which Finnix will load automatically on the next boot from the harddisk:<br />
<code># mount /dev/hda1<br />
# mkdir -p /mnt/hda1/FINNIX/overlay.d/lircoverlay<br />
# cd /mnt/hda1/FINNIX/overlay.d/lircoverlay<br />
# dpkg -X /usr/src/lirc-modules-*.deb .<br />
# dpkg -X /var/cache/apt/archives/lirc_*.deb .<br />
# dpkg -X /var/cache/apt/archives/liblirc*.deb .<br />
# dpkg -X /var/cache/apt/archives/libasound*.deb .</code></p>
<p>Install the right remote control file for our remote control. Should you have another remote control, have a look around in the usr/share/doc/lirc/remotes directory to see if your remote is supported.<br />
<code># cd /mnt/hda1/FINNIX/overlay.d/lircoverlay<br />
# cp usr/share/doc/lirc/remotes/mceusb/lircd.conf.mceusb etc/lirc/lircd.conf</code></p>
<p>Finally create a startup script so the kernel modules are automatically loaded and lircd is automatically started:<br />
<code># cd /mnt/hda1/FINNIX<br />
# cat &gt; /mnt/hda1/FINNIX/finnix.sh &lt;<br />
&gt; #!/bin/bash<br />
&gt; depmod<br />
&gt; modprobe -f lirc_dev<br />
&gt; modprobe -f lirc_mceusb2<br />
&gt; lircd -d /dev/lirc0 -l<br />
&gt; EOF</code><br />
Again here: if you have a different receiver then the eHome &#8216;new-style&#8217; IR receiver, edit the line with &#8216;lirc_mceusb2&#8242; on it and replace it with the correct driver for your IR receiver.</p>
<h3>Finishing up</h3>
<p>Now that all is installed, let&#8217;s tune the VM down a bit so that it does not use that many resources. You need to shutdown the VM before changing these settings.</p>
<ol>
<li>The VM does not need networking, so let&#8217;s confine it to &#8216;Host-Only Networking&#8217; on the &#8216;Network Adapter 1&#8242; page in the VM configuration. [<a href="http://edwi.nl/og/uploads/2009/04/close_up_finnix_vm_20090406_01.png" rel="lightbox[64]">screenshot</a>]</li>
<li>The amount of memory needed is not that much. I use 48 MB, but 40 MB also works at the cost of extra startup time. [<a href="http://edwi.nl/og/uploads/2009/04/close_up_finnix_vm_20090406_02.png" rel="lightbox[64]">screenshot</a>]</li>
<li>When saving Parallels will give you a warning which can be ignored. [<a href="http://edwi.nl/og/uploads/2009/04/close_up_finnix_vm_20090406_03.png" rel="lightbox[64]">screenshot</a>]</li>
</ol>
<h3>Screenshots</h3>

<a href='http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-2-installing-lirc-in-the-finnix-vm/boot_finnix_cd_20090406_01/' title='boot_finnix_cd_20090406_01'><img width="150" height="150" src="http://edwi.nl/og/uploads/2009/04/boot_finnix_cd_20090406_01-150x150.png" class="attachment-thumbnail" alt="" title="boot_finnix_cd_20090406_01" /></a>
<a href='http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-2-installing-lirc-in-the-finnix-vm/boot_finnix_cd_20090406_02/' title='boot_finnix_cd_20090406_02'><img width="150" height="150" src="http://edwi.nl/og/uploads/2009/04/boot_finnix_cd_20090406_02-150x150.png" class="attachment-thumbnail" alt="" title="boot_finnix_cd_20090406_02" /></a>
<a href='http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-2-installing-lirc-in-the-finnix-vm/boot_finnix_cd_20090406_03/' title='boot_finnix_cd_20090406_03'><img width="150" height="150" src="http://edwi.nl/og/uploads/2009/04/boot_finnix_cd_20090406_03-150x150.png" class="attachment-thumbnail" alt="" title="boot_finnix_cd_20090406_03" /></a>
<a href='http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-2-installing-lirc-in-the-finnix-vm/boot_finnix_cd_20090406_04/' title='boot_finnix_cd_20090406_04'><img width="150" height="150" src="http://edwi.nl/og/uploads/2009/04/boot_finnix_cd_20090406_04-150x150.png" class="attachment-thumbnail" alt="" title="boot_finnix_cd_20090406_04" /></a>
<a href='http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-2-installing-lirc-in-the-finnix-vm/usb_receiver_attach_20090406_01/' title='usb_receiver_attach_20090406_01'><img width="150" height="150" src="http://edwi.nl/og/uploads/2009/04/usb_receiver_attach_20090406_01-150x150.png" class="attachment-thumbnail" alt="" title="usb_receiver_attach_20090406_01" /></a>
<a href='http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-2-installing-lirc-in-the-finnix-vm/close_up_finnix_vm_20090406_01/' title='close_up_finnix_vm_20090406_01'><img width="150" height="150" src="http://edwi.nl/og/uploads/2009/04/close_up_finnix_vm_20090406_01-150x150.png" class="attachment-thumbnail" alt="" title="close_up_finnix_vm_20090406_01" /></a>
<a href='http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-2-installing-lirc-in-the-finnix-vm/close_up_finnix_vm_20090406_02/' title='close_up_finnix_vm_20090406_02'><img width="150" height="150" src="http://edwi.nl/og/uploads/2009/04/close_up_finnix_vm_20090406_02-150x150.png" class="attachment-thumbnail" alt="" title="close_up_finnix_vm_20090406_02" /></a>
<a href='http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-2-installing-lirc-in-the-finnix-vm/close_up_finnix_vm_20090406_03/' title='close_up_finnix_vm_20090406_03'><img width="150" height="150" src="http://edwi.nl/og/uploads/2009/04/close_up_finnix_vm_20090406_03-150x150.png" class="attachment-thumbnail" alt="" title="close_up_finnix_vm_20090406_03" /></a>

]]></content:encoded>
			<wfw:commentRss>http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-2-installing-lirc-in-the-finnix-vm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MCE Remote on a Mac &#8211; Step 1: installing Finnix as a Parallels VM</title>
		<link>http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-1-installing-finnix-as-a-parallels-vm/</link>
		<comments>http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-1-installing-finnix-as-a-parallels-vm/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 16:01:32 +0000</pubDate>
		<dc:creator>edwin</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[finnix]]></category>
		<category><![CDATA[htpc]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[mce remote]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[parallels]]></category>
		<category><![CDATA[vm]]></category>

		<guid isPermaLink="false">http://edwi.nl/og/?p=16</guid>
		<description><![CDATA[This is part 1 in a series on using an MCE Remote Control with a Mac. See the:
- Main article
- Step 2: installing LIRC in the Finnix VM
- Step 3: configuring LIRC in OS X
Installation instructions
This part is about installing the Finnix Linux distribution so that it runs in a virtual machine (VM) on your [...]]]></description>
			<content:encoded><![CDATA[<p><img class="size-full wp-image-93 alignleft" style="border: 1px solid #dddddd; margin-bottom: 12px; margin-right: 20px;" title="mac-mce-120x120" src="http://edwi.nl/og/uploads/2009/04/mac-mce-120x120.png" alt="MCE Remote on a Mac" width="120" height="120" />This is part 1 in a series on using an MCE Remote Control with a Mac. See the:<br />
- <a href="http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-or-i-want-more-buttons/">Main article</a><br />
- <a href="http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-2-installing-lirc-in-the-finnix-vm/">Step 2: installing LIRC in the Finnix VM</a><br />
- <a href="http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-3-configuring-lirc-in-os-x/">Step 3: configuring LIRC in OS X</a></p>
<h3>Installation instructions</h3>
<p>This part is about installing the <a href="http://www.finnix.org/">Finnix</a> Linux distribution so that it runs in a virtual machine (VM) on your Mac. This instruction assumes you have a copy of <a href="http://www.parallels.com/">Parallels Desktop for Mac 4.0</a> installed (it should work fine with their 14 day evaluation version). Potentially a similar procedure can also be applied with <a href="http://www.vmware.com/products/fusion/">VMware Fusion</a>, or (if you want a free solution) with <a href="http://www.virtualbox.org/">VirtualBox</a>, but I have not tried it. Let me know if you succeed!</p>
<p>Now here are the instructions. Install Finnix in Parallels Desktop using the following 12 steps:</p>
<ol>
<li>Open the &#8220;File&#8221; menu for Parallels Desktop and choose the &#8220;New Virtual Machine&#8230;&#8221; option. A wizard will appear. Click &#8220;Continue&#8221; in the first screen.</li>
<li>Select the .iso image file you downloaded from the <a href="http://www.finnix.org/">Finnix</a> site.</li>
<li>Parallels cannot auto-detect the operating system type. Finnix is a Debian derivative, so let&#8217;s enter that.</li>
<li>Choose a &#8220;Custom&#8221; virtual machine type.</li>
<li>Leave the number of CPU&#8217;s to 1. Set the memory requirement to 512 MB, if it&#8217;s not already set to that value. Later on we&#8217;ll decrease this value much further (48 MB is enough), but for lirc installation a big ramdisk is needed.</li>
<li>We&#8217;ll need a new image for the hard disk.</li>
<li>A mere 1 gigabyte should be enough. Using the &#8220;Expanding disk&#8221; option saves even more space.</li>
<li>Use &#8220;Share Networking&#8221;. Later on networking can be confined to &#8220;Host-Only Networking&#8221;, but for now we need the connectivity to install software.</li>
<li>We do not want the VM to drain too much resources, so we optimize the performance for the Mac</li>
<li>Use any name you like. I use &#8220;Finnix IR&#8221;.</li>
<li>Click &#8220;Start&#8221; to boot the Finnix Live CD.</li>
<li>Choose the first line (x86) instead of the default (AMD64). You could boot in AMD64 mode just fine, but there are some problems with the lirc kernel modules in 64 bit mode.</li>
</ol>
<p>After a little while you&#8217;ll be presented with a booted up Finnix. Congratulations!</p>
<p>Read on for the screenshots and for installation on the virtual hard disk.<br />
<span id="more-16"></span></p>
<h3>Installing on the virtual hard disk</h3>
<p>First, let&#8217;s create a partition the disk and format the partition with the linux (ext2) filesystem.<br />
<code># sfdisk /dev/hda &lt;&lt; EOF<br />
&gt; 0,,L<br />
&gt; EOF<br />
# mke2fs /dev/hda1</code><br />
This instructs Finnix to create one big partition on the 1GB disk of the &#8216;L&#8217; (=Linux) type and then create an Ext2 filesystem on it.</p>
<p>Next step: mount the disk and copy the files from the virtual cd to the hard drive.<br />
<code># mount /dev/hda1<br />
# cp -R /cdrom/* /mnt/hda1</code></p>
<p>Finally we need to install a grub boot menu so that it can actually boot into Linux:<br />
<code># mkdir -o /mnt/hda1/boot/grub<br />
# cat > /mnt/hda1/boot/grub/menu.lst << EOF<br />
> timeout         5<br />
> title           Finnix<br />
> root            (hd0,0)<br />
> kernel          /isolinux/linux root=/dev/hda1 quiet<br />
> initrd          /isolinux/minirt<br />
> EOF<br />
# /usr/sbin/grub-install --root-directory=/mnt/hda1 /dev/hda</code></p>
<p>Now that&#8217;s all done, you could reboot from the local hard disk.</p>
<h3>Screenshots</h3>

<a href='http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-1-installing-finnix-as-a-parallels-vm/parallels_finnix_20090406_01/' title='parallels_finnix_20090406_01'><img width="150" height="150" src="http://edwi.nl/og/uploads/2009/04/parallels_finnix_20090406_01-150x150.png" class="attachment-thumbnail" alt="" title="parallels_finnix_20090406_01" /></a>
<a href='http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-1-installing-finnix-as-a-parallels-vm/parallels_finnix_20090406_02/' title='parallels_finnix_20090406_02'><img width="150" height="150" src="http://edwi.nl/og/uploads/2009/04/parallels_finnix_20090406_02-150x150.png" class="attachment-thumbnail" alt="" title="parallels_finnix_20090406_02" /></a>
<a href='http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-1-installing-finnix-as-a-parallels-vm/parallels_finnix_20090406_03/' title='parallels_finnix_20090406_03'><img width="150" height="150" src="http://edwi.nl/og/uploads/2009/04/parallels_finnix_20090406_03-150x150.png" class="attachment-thumbnail" alt="" title="parallels_finnix_20090406_03" /></a>
<a href='http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-1-installing-finnix-as-a-parallels-vm/parallels_finnix_20090406_04/' title='parallels_finnix_20090406_04'><img width="150" height="150" src="http://edwi.nl/og/uploads/2009/04/parallels_finnix_20090406_04-150x150.png" class="attachment-thumbnail" alt="" title="parallels_finnix_20090406_04" /></a>
<a href='http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-1-installing-finnix-as-a-parallels-vm/parallels_finnix_20090406_05/' title='parallels_finnix_20090406_05'><img width="150" height="150" src="http://edwi.nl/og/uploads/2009/04/parallels_finnix_20090406_05-150x150.png" class="attachment-thumbnail" alt="" title="parallels_finnix_20090406_05" /></a>
<a href='http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-1-installing-finnix-as-a-parallels-vm/parallels_finnix_20090406_06/' title='parallels_finnix_20090406_06'><img width="150" height="150" src="http://edwi.nl/og/uploads/2009/04/parallels_finnix_20090406_06-150x150.png" class="attachment-thumbnail" alt="" title="parallels_finnix_20090406_06" /></a>
<a href='http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-1-installing-finnix-as-a-parallels-vm/parallels_finnix_20090406_07/' title='parallels_finnix_20090406_07'><img width="150" height="150" src="http://edwi.nl/og/uploads/2009/04/parallels_finnix_20090406_07-150x150.png" class="attachment-thumbnail" alt="" title="parallels_finnix_20090406_07" /></a>
<a href='http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-1-installing-finnix-as-a-parallels-vm/parallels_finnix_20090406_08/' title='parallels_finnix_20090406_08'><img width="150" height="150" src="http://edwi.nl/og/uploads/2009/04/parallels_finnix_20090406_08-150x150.png" class="attachment-thumbnail" alt="" title="parallels_finnix_20090406_08" /></a>
<a href='http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-1-installing-finnix-as-a-parallels-vm/parallels_finnix_20090406_09/' title='parallels_finnix_20090406_09'><img width="150" height="150" src="http://edwi.nl/og/uploads/2009/04/parallels_finnix_20090406_09-150x150.png" class="attachment-thumbnail" alt="" title="parallels_finnix_20090406_09" /></a>
<a href='http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-1-installing-finnix-as-a-parallels-vm/parallels_finnix_20090406_10/' title='parallels_finnix_20090406_10'><img width="150" height="150" src="http://edwi.nl/og/uploads/2009/04/parallels_finnix_20090406_10-150x150.png" class="attachment-thumbnail" alt="" title="parallels_finnix_20090406_10" /></a>
<a href='http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-1-installing-finnix-as-a-parallels-vm/parallels_finnix_20090406_11/' title='parallels_finnix_20090406_11'><img width="150" height="150" src="http://edwi.nl/og/uploads/2009/04/parallels_finnix_20090406_11-150x150.png" class="attachment-thumbnail" alt="" title="parallels_finnix_20090406_11" /></a>
<a href='http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-1-installing-finnix-as-a-parallels-vm/parallels_finnix_20090406_12/' title='parallels_finnix_20090406_12'><img width="150" height="150" src="http://edwi.nl/og/uploads/2009/04/parallels_finnix_20090406_12-150x150.png" class="attachment-thumbnail" alt="" title="parallels_finnix_20090406_12" /></a>

]]></content:encoded>
			<wfw:commentRss>http://edwi.nl/og/2009/04/08/mce-remote-on-a-mac-step-1-installing-finnix-as-a-parallels-vm/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
