Kodi Community Forum

Full Version: [LINUX] HOW-TO InstallDedicated HTPC with Ubuntu Hardy (8.04) and XBMC Camelot (9.11)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This is a brief description how to set up a dedicated HTPC with the latest XBMC, but using Ubuntu 8.04 (Hardy) as underlying OS.

Tech note: why would one want not the latest 9.11 (Karmic), but an year-and-a-half-old release? Surely, Karmic boots faster and loads X faster; however, some hardware doesn't not like recent kernels. A prominent example are NVdidia motherboards with IDE disk drives, which are not stable with libata - with older versions of Ubuntu kernel where everything which could be a module was compiled as a module, it was not hard to drop the troublesome pata_amd modules and use amd74xx; however, since recent verisons Ubuntu builds libata into the kernel thus requiring a full kernel recompile, followed by manual NVidia video drivers install - a truly daunting task. In such cases, it is easier to use the good old 8.04, which is LTS and therefore many recent enhancements are available for it also. The slightly slower boot should not be a too big trade-off.

First, get the Ubuntu 8.04 minimal CD. It has the advantage that everything will be installed from the Internet, thus providing you directly with the latest versions of all system software (saving a lot of time to upgrade):

Code:
https://help.ubuntu.com/community/Installation/MinimalCD

Burn the disk and carry an installation. You should use "xbmc" as a username for XBMC. When asked what additional software to install, chose OpenSSH server. Complete the installation. Reboot, then log in remotely over SSH - this way you'll be able to copy/paste all commands, listed below.

Become a superuser - when asked, give again the password for user "xbmc":

Code:
sudo bash

Add required repositories. I assume you are comfortable with vim as an editor - if not, replace it here and below with "nano":

Code:
vim /etc/apt/sources.list

At the end of the file, copy these lines:

Code:
deb http://archive.ubuntu.com/ubuntu hardy-backports main universe multiverse restricted
deb-src http://archive.ubuntu.com/ubuntu hardy-backports main universe multiverse restricted

deb http://ppa.launchpad.net/nvidia-vdpau/ppa/ubuntu hardy main
deb-src http://ppa.launchpad.net/nvidia-vdpau/ppa/ubuntu hardy main

deb http://ppa.launchpad.net/team-xbmc/ppa/ubuntu hardy main
deb-src http://ppa.launchpad.net/team-xbmc/ppa/ubuntu hardy main

Obtain required keys:

Code:
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CEC06767 91E7EE5E

Get a list of all packages, available in the repositories:

Code:
apt-get update

There are few pieces of software which we shall need, but which are not listed as dependencies - therefore, we need to install them explicitly:

Code:
apt-get install hal usbmount pkg-config policykit

Grant required privileges to user "xbmc":

Code:
polkit-auth --user xbmc --grant org.freedesktop.hal.power-management.suspend
polkit-auth --user xbmc --grant org.freedesktop.hal.power-management.hibernate
polkit-auth --user xbmc --grant org.freedesktop.hal.power-management.reboot
polkit-auth --user xbmc --grant org.freedesktop.hal.power-management.shutdown
polkit-auth --user xbmc --grant org.freedesktop.hal.power-management.reboot-multiple-sessions
polkit-auth --user xbmc --grant org.freedesktop.hal.power-management.shutdown-multiple-sessions

Also, do a required change in dbus config file in order to shut down the HTPC from XBMC:

Code:
vim /etc/dbus-1/system.d/hal.conf

In the last section, just before the line "</busconfig>" add these lines:

Code:
<policy user="xbmc">
    <allow send_interface="org.freedesktop.Hal.Device.SystemPowerManagement"/>
    <allow send_interface="org.freedesktop.Hal.Device.VideoAdapterPM"/>
    <allow send_interface="org.freedesktop.Hal.Device.LaptopPanel"/>
    <allow send_interface="org.freedesktop.Hal.Device.Volume"/>
    <allow send_interface="org.freedesktop.Hal.Device.Volume.Crypto"/>
</policy>

A small addition to Policy Kit configuration

Code:
vim /etc/PolicyKit/PolicyKit.conf

edit the line "<match user=..." and add "|xbmc" after "root":

Code:
<match user="root|xbmc">

A small addition to power management:

Code:
vim /usr/share/PolicyKit/policy/org.freedesktop.hal.power-management.policy

on lines stating with "<allow_active..." replace "auth_admin" with "yes" so it looks like t his:

Code:
<allow_active>yes</allow_active>

Add "vfat" to the list of filesystems which should be automounted from USB drives:

Code:
vim /etc/usbmount/usbmount.conf

Next to ext2 and ext3 on the line, beginning with "FILESYSTEMS=..." add "vfat":

Code:
FILESYSTEMS="ext2 ext3 vfat"

Get the X server and the latest stable proprietary drivers:

Code:
apt-get install xorg
apt-get install nvidia-190-modaliases nvidia-glx-190 nvidia-settings-190

Let NVidia driver generate a proper config file, you may tweak it later to your taste:

Code:
nvidia-xconfig

Install audio subsystem:

Code:
apt-get install linux-sound-base alsa-base alsa-utils

Run the console mixer. Set the desired sliders, the press "Esc" to exit. Run the second command to save current settings:

Code:
alsamixer
alsactl store 0

Get the XBMC itself:

Code:
apt-get install xbmc xbmc-skin-* xbmc-eventclients-* xbmc-scripts-*

Set up auto-login:

Code:
vim /etc/event.d/tty1

Replace the last line (starting with "exec...") with this one:

Code:
exec /bin/login -f xbmc < /dev/tty1 > /dev/tty1 2>&1

Create a file to auto-run X upon login:

Code:
vim /home/xbmc/.bash_profile

Put inside these lines:

Code:
case "`tty`" in
/dev/tty1) clear && startx &>/dev/null;;
esac

Finally, when X comes up, let if fire XBMC:

Code:
vim /home/xbmc/.xsessionrc

Put inside this line:

Code:
exec xbmc --standalone

Install a fancy graphical boot:

Code:
sudo apt-get install usplash libusplash-dev usplash-theme-xbmc-*
sudo update-alternatives --config usplash-artwork.so

Set your resolution:

Code:
vim /etc/usplash.conf

For 720p TV, put these lines (for 1080p, make the numbers 1920 and 1080 respectively)

Code:
resx=1280
resy=720

Update the initial RAM disk with the graphical boot

Code:
update-initramfs -u

If you want to have CDs automatially mounted (needed only if you play MP3s or ripped DVDs off CD-R/DVD-Rs and want better control over them):

Code:
apt-get install autofs

You can then create mount point for the CD/DVD and a map file. Because the automounter takes over the mounting point, do not use "/media", but rather create a new directory "/media/automounter". In /home/xbmc create a symlink to /media/automounter/cdrom:

Code:
mkdir /media/automounter
ln -s /media/automounter/cdrom0 /home/xbmc/cdrom

Create a map file "/etc/auto.media" (you may want to add UDF) and link it in "/etc/auto.master"

Code:
vim /etc/auto.media

Put inside this line (assuming /dev/scd0 is your CD/DVD drive; if not, put proper device):

Code:
cdrom0 -fstype=iso9660,ro,nosuid,nodev :/dev/scd0

Finally, link this new file to the master file:

Code:
vim /etc/auto.master

Put this line inside:

Code:
/media/automounter /etc/auto.media

If you use a remote control, install LIRC, then configure it up to your taste (setting up LIRC is outside our scope here):

Code:
apt-get install lirc

If you use NFS (as I do sometimes), install the client part of it:

Code:
apt-get install nfs-common

If you want to use MIDI-based karaoke (.KAR files), you'll need to install a soundfont:

Code:
apt-get install fluid-soundfont-gm fluid-soundfont-gs
mkdir /usr/share/xbmc/system/players/paplayer/timidity
cd /usr/share/xbmc/system/players/paplayer/timidity
ln -s /usr/share/sounds/sf2/FluidR3_GM.sf2 soundfont.sf2

Well, that's it. Reboot and enjoy :-)

WWell,