MCE Remote on a Mac – Step 2: installing LIRC in the Finnix VM
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 ‘Parallels Desktop’ menu, select the ‘Preferences’ option
- On the ‘USB’ page, click the ‘+’-sign at the bottom and select the ‘eHome Infrared Transceiver’ to connect to the ‘Finnix IR’ virtual machine. [screenshot]
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:
- In the configuration for the Finnix VM, select the ‘Boot Order’ page and check the ‘Select boot device on startup’ option. [screenshot]
- Then go to the ‘CD/DVD-ROM 1′ page, check the ‘Connected’ option and make sure the .iso file is still selected. [screenshot]
- Boot the VM and press the ‘Esc’ key. Then select option ‘3′ to boot from the live CD. [screenshot]
- To prevent the VM from booting from the hard disk (the livecd finds the installation in the hard disk before it’s own), select the first option and press the ‘Tab’ key. Add ‘root=/dev/hdb’ to the line and press ‘Enter’. [screenshot]
To check if you have correctly booted from the Live CD instead of the hard disk, use the following command:
mount -l | grep ramdisk
If the result starts with /ramdisk/dev/hdb then you were succesful. On the other hand if the result starts with /ramdisk/dev/hda1 then try again!
Read on for the gory details of LIRC installation.
Installing LIRC and compiling the LIRC kernel modules
Some fiddling is required with the build names to get things right. This is because Finnix adds a ‘-finnix’ to the kernel version, and replaces the 486/686 with a x86. For example, Finnix 92.1 reports its kernel version as ‘2.6.26-1-x86-finnix’ while the corresponding Debian package with the correct headers needed for building kernel modules has version number ‘2.6.26-1-686′. 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):
# FINNIX=`uname -r`
# VERSION=`uname -r | sed s/-finnix/ | sed s/x86/686/`
# echo $FINNIX -- $VERSION
Let’s go and install some software:
# apt-get update
# apt-get install lirc lirc-modules-source linux-headers-$VERSION
# m-a prepare
Just press Enter on any questions.
Now here comes the fiddling: we need to trick Finnix to think the installed header files are actually from a Finnix kernel:
# echo \#define UTS_RELEASE \"$FINNIX\" > /usr/src/linux-headers-$VERSION/include/linux/utsrelease.h
# echo $FINNIX > /usr/src/linux-headers-$VERSION/include/config/kernel.release
# mv /usr/src/linux-headers-$VERSION /usr/src/linux-headers-$FINNIX
And now we can build the lirc modules:
# m-a a-b lirc
Next we’re going to install all relevant packages in an overlay directory which Finnix will load automatically on the next boot from the harddisk:
# mount /dev/hda1
# mkdir -p /mnt/hda1/FINNIX/overlay.d/lircoverlay
# cd /mnt/hda1/FINNIX/overlay.d/lircoverlay
# dpkg -X /usr/src/lirc-modules-*.deb .
# dpkg -X /var/cache/apt/archives/lirc_*.deb .
# dpkg -X /var/cache/apt/archives/liblirc*.deb .
# dpkg -X /var/cache/apt/archives/libasound*.deb .
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.
# cd /mnt/hda1/FINNIX/overlay.d/lircoverlay
# cp usr/share/doc/lirc/remotes/mceusb/lircd.conf.mceusb etc/lirc/lircd.conf
Finally create a startup script so the kernel modules are automatically loaded and lircd is automatically started:
# cd /mnt/hda1/FINNIX
# cat > /mnt/hda1/FINNIX/finnix.sh <
> #!/bin/bash
> depmod
> modprobe -f lirc_dev
> modprobe -f lirc_mceusb2
> lircd -d /dev/lirc0 -l
> EOF
Again here: if you have a different receiver then the eHome ‘new-style’ IR receiver, edit the line with ‘lirc_mceusb2′ on it and replace it with the correct driver for your IR receiver.
Finishing up
Now that all is installed, let’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.
- The VM does not need networking, so let’s confine it to ‘Host-Only Networking’ on the ‘Network Adapter 1′ page in the VM configuration. [screenshot]
- 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. [screenshot]
- When saving Parallels will give you a warning which can be ignored. [screenshot]







