Building Linux Home Theater box


First Note: this build was not about “cheap”. This is all about “building my own”, “small” and “quiet”, “cheap” comes as a last criteria.

SilentPCReview gave me some really valuable information on how to get things together with this case. Most importantly – to get 120mm case fan. I experimented with 80mm and got temperatures inside the case dropping from ~80C down to ~60C which prompted me to go that extra mile and get 120mm fan – Noctua NF-S12B turned out to be one valuable addition – with varied settings 1200/900/600 RPM it allowed me to be the judge of what’s acceptable, and I ended up using 900RPM setting as it was much quieter than 1200RPM yet provided plenty of airflow. I ended up pointing it outward (i.e. sucking air out of the case vs sucking it in). Such positioning allows you to suck cool air directly towards CPU drawing hot air towards PSU fan and the Case Fan allowing for better temperature management as far as I can tell. Temperatures seem to be in comfortable ~50C zone so no unpleasant noise so far (well, we’ll wait for movies to warm things up).

My plan B includes underclocking CPU and GPU if temperatures get too high. Core i3 is more than enough for movie-watching/internet browsing so I’m not too worried about effects of underclocking.


Pre-building in VM

This one needs to be quiet and not to burn holes in SSD and be fairly minimalistic, so I’m building it from Fedora 16 Install DVD starting with “minimal” setup and building up to something I can accept. After building the box as a VM (with Spice graphics) – image of an SSD that we’re about to use, and installing base OS first tweak is to get rid of all unnecessary writes via noatime, and tmpfs:

# cat /etc/fstab
/dev/sda1  /                       ext4    discard,noatime,data=writeback        1 1
none /tmp tmpfs defaults 0 0

Now we need some packages for X Windows:

# yum groupinstall “X Window System” LXDE

That should give us nice base. However if you try to launch graphical interface:

# systemctl start

you get no fonts and lots of squares on the screen. I fixed that with a “hammer”:

# yum install xorg-x11-fonts\*
# yum install liberation\*

after that we can start up Xorg – no problem.

Now some apps and more convenience:

# rpm -Uvh
# rpm –import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux
# yum install flash-plugin
# yum install libdvdread libdvdnav lsdvd
# yum install mplayer mplayer-gui smplayer
# rpm -Uvh
# yum install libdvdcss
# yum install vlc
# yum install xine-lib xine-lib-extras xine-lib-extras-freeworld xine-ui xine-ui-skins gxine minitube
# yum install firefox

And all this goodness in 1.5G – not bad. We’ve got Flash, Firefox, XBMC, Mplayer, VLC and Xine – almost ready to bust some movies 🙂

All we need now is to boot into XBMC by default to avoid all the complexities of a “typical boot” on this over-simplified machine:

# useradd -m -g users -G audio,video -s /bin/bash xbmc
# passwd xbmc
# cat > /etc/lxdm/lxdm.conf

arg=/usr/bin/X -background vt1




Notes on above: we’ve created xbmc user, set his password. And made default action for lxdm to login xbmc user using xbmc-standalone shell. Almost there…
Now some graphical goodness for package management in case we need it:

# yum install yumex

After that VM can be shut down and we’re transfering our image over to CompactFlash card connected via CardReader:

homePC # virsh shutdown htpc
homePC # dd if=htpc.img of=/dev/sdf

Note that above is done from my “normal PC” rather than from within VM itself.

Tuning of the real thing

Now whenever I plug My CF-to-SATA kit into Zotac H-55 I’m getting system that hangs for a while, and then… doesn’t see new disk. Bummer. Fall-back – 4G USB stick.

now I’ve got USB stick ready and found out I’m missing NetworkManager, d’oh!

First thing that hit me – difference in size of CF and USB stick. F16 uses GPT, and bitterly complains about broken FS etc. etc. etc. so… fixing is possible only via parted:

htpc # parted
(parted) print all

after which it asks you whether you want to fix various issues and the answer is “yes”

# yum install NetworkManager NetworkManager-gtk NetworkManager-gnome

However after that I’ve got the unpleasant

$ nm-connection-editor

** (nm-connection-editor:10500): WARNING **: Icon nm-device-wired missing: Icon ‘nm-device-wired’ not present in theme

** (nm-connection-editor:10500): WARNING **: Failed to initialize the UI, exiting…

which was fixed by

# yum install gnome-icon-theme-legacy

but even then I’ve got:

** (nm-connection-editor:10500): WARNING **: Icon nm-device-wwan missing: Icon ‘nm-device-wwan’ not present in theme

I have resorted to a hack – symlinked some instances of nm-device-wired.png to nm-device-wwan.png and even that didn’t help!

# yum install lxde-icon-theme

while that made LXDE look less “rough” it didn’t fix the issue. Argh!
Final attempt was to install whatever pieces of NetworkManager missing:

# yum install NetworkManager-{openconnect,openvpn,openswan,pptp,vpnc}

and that has finally resolved the issues of missing icons, g’ah!

Things to do

  • add Autofs mounting of NAS shares with pictures/movies


One Comment

Add a Comment

Your email address will not be published. Required fields are marked *