Launching XBMC from an Android remote on a dedicated Debian HTPC

I bought recently a HP microserver to upgrade from my previous server that was a Seagate Dockstar.

HP Proliant Microserver Seagate Dockstar

One of the goals I had in mind was to use the server not only as a NAS, webserver, etc… but also as a HTPC running XBMC (and as a gigabit switch and a 802.11N AP but more on that later). I was running Debian Squeeze for ARM on the Dockstar and went for Debian Wheezy (tesing for now) for the Proliant as it has a more recent kernel to build my AP, and XBMC Eden is available directly in Debian repositories. My idea is to set it up now and stay on Wheezy when it becomes stable so I have only minimal maintenance to do in the future.

My Microserver is plugged to my videoprojector (Acer K10 LED) by VGA. I have no other graphical application running on the microserver so I didn’t install a window manager and I’m launching XBMC with xinit.

XBMC works great on the Microserver. I’m using ALSA as my sound system and a FiiO E10 as my USB sound card. I have a mpd server running to be able to play music in my living room, controlled by an Android client Droid MPD Client (HD). XBMC or mpd are mutually exclusive in their usage of the sound card (maybe I could enhance that by tweaking ALSA settings or moving to some other audio management ?). This is the first rason why I want to be able to start or stop XBMC on demand.

Another reason is that XBMC being idle uses between 10 and 30% of CPU. My machine serves as a server 24/7 and as a HTPC around 1h per day on average (I don’t use it everyday).

I have no keyboard attached to the Microserver.

So what I did was install 2 applications to my Android smartphone:

Official XBMC Remote
Script Kitty

The XBMC remote is a very fine app to remote control your XBMC HTPC and it also can exit XBMC.

Script Kitty is an application that lets you run scripts on a server with SSH. It lets you create a simple launcher on your homescreen that directly connects to your server and runs a command on it. Perfect to launch XBMC without having to install anything more on the Microserver !

The result on my home screen looks like this:

[nggallery id=1]

To configure Script Kitty, you have to give it your SSH credentials and tell it some commands to execute. Then you go to your home screen and add a direct shortcut to the script you created.

Here is the script I run on the server:

/usr/bin/xinit /usr/bin/xbmc-standalone — :0

By default on Debian, you will not be able to use xinit from a SSH shell. This seems to be a security feature. In order to allow it, you need to run:

dpkg-reconfigure x11-common

And from the menu choose to grant anybody the right to start X.