Saturday, 29 June 2013

Installing and Running XBMC on the Raspberry Pi

One of the most exciting applications of the Raspberry Pi is to use it as a media centre connected to your TV so that you can watch videos, play music and view online content from the comfort of your sofa. There are a few different distributions available for this very purpose but in this post I'll look at how to install and run the popular XBMC software on the Raspberry Pi.

Luckily, most of the hard work has already been done - all you have to do is go to and download the appropriate image file and write it to a blank SD(HC) memory card.When you look at the download page on the Raspbmc web site there are various options available, but the recommended option (and I agree) is the one called "Network Image". Click on this option and you will download a file called "installer.img.gz" which is a compressed archive and is only about 16MB.

By now (like me) you've probably realised the many advantages of having a PC or laptop running a Linux distribution, so I'll assume you've downloaded the compressed image file on to your Linux system (I use Lubuntu running on a laptop and it has the advantage of having the same look and feel as the GUI on the Raspberry Pi).

Open File Manager and go to where you saved the downloaded file (mine was saved in folder "/home/tom/Downloads").

Double click on the file and this should open it in Archive Manager. This will show which files are contained in the compressed archive (in this case only one file called "installer.img").

Click on the "Extract" and when the "Extract" window opens, click on the "Extract" button on the bottom right corner of the window.

This will decompress the archive and extract the image file. If all goes well you should get confirmation that the process was sucessfull.

Click on "Quit" to close Archive Manager. You should now have the image file in the folder along with the compressed archive.

As you'll see later it's now a good idea to move (or copy) this image file into your home folder, which in my case is called "/home/tom" (because my username is "tom"). In any case, make a mental note of where the image file is saved on your Linux system. Now, open a terminal window and type "df" at the command line prompt and press Enter:

tom@mylaptop: ~ $ df_

This will display the various partitions on your hard drive. You should get results similar to what is shown in the following screenshot:

Now insert your (formatted) SD(HC) card into the card reader/writer slot on your Linux system (or into a USB card reader/writer like this one available from Cut Price Cables, and then plug the card reader/writer into a spare USB port on your system) and once again type "df" at the command line prompt and press Enter:

tom@mylaptop: ~ $ df_

This time the results should include an entry for your SD(HC) card (in my case it shows up as "/dev/sdb1"):

Now type "umount /dev/sdb1" (replacing "/dev/sdb1" with whatever your SD(HC) card is called) at the command line prompt and press Enter:

tom@mylaptop: ~ $ umount /dev/sdb1_

Now, once again, type "df" at the command line prompt and press Enter:

tom@mylaptop: ~ $ df_

The entry for your SD(HC) card should no longer be listed:

Now, type "ls" at the command line prompt and press Enter:

tom@mylaptop: ~ $ ls_

This will show all the files in your home folder. If you moved (or copied) the image file to your home folder, it should show up in the listing:

Now for the really important part! Type the following command at the command line prompt and press Enter:

tom@mylaptop: ~ $ sudo dd bs=4M if=installer.img of=/dev/sdb_

Please Note  - you must enter the name of your SD(HC) card without any numbers at the end - so in my case I entered "/dev/sdb" because my SD(HC) card name was "/dev/sdb1". You will then have to enter the password for your user account on your linux system.

Assuming you get a confirmation message like the one shown above, the image file should now be written on to your SD(HC) card.

Now, type "sudo sync" at the command line prompt and press Enter:

tom@mylaptop: ~ $ sudo sync_

Again you will be asked to enter your password, but after this command has been executed you can remove the SD(HC) card from your Linux system and insert it into your Raspberry Pi.

Connect keyboard, mouse, display screen and (most importantly) Ethernet cable (all of which are available from Cut Price Cables at a very competitive price) to your Raspberry Pi and then power it up. You'll see a lot of text scrolling up your screen followed by a blue screen and various welcome messages. Time to put the kettle on!

Eventually XBMC will install itself, update itself and launch on your Raspberry Pi......

No comments:

Post a Comment