Running a headless raspbmc media server on Raspberry PI

I’ve been banging my head with this for a few days now and finally got it to work, so I thought I’d share, as documentation about it is quite sparse.

The idea was to use my Raspberry PI as a headless media server. Headless as I don’t have a TV, so I’d use it mainly for listening to music.

Step 1: Install raspbmc on my Raspberry. That went smoothly.
Step 2: Connect the external HDs where my music is stored to the Raspberry PI. These get mounted automatically under /media/ with raspbmc.
Step 3: Edit ~/.xbmc/userdata/sources.xml to add my music library:

       <default pathversion="1"></default>
        <default pathversion="1"></default>
        <default pathversion="1"></default>
            <path pathversion="1">/media//MYBOOK/Music</path>
        <default pathversion="1"></default>
         <default pathversion="1"></default>

All looks fine and dandy, do a service xbmc restart and … NOTHING! All the googling did not help much either, as the documentation only describes how to add a source from the XBMC UI, which I didn’t have any access to.

A lot of swearing occured…

I then found this thread on the xbmc forums: Ok, so it seems I can edit the database files directly!! Gooooood, I like that! Let’s go:

sqlite MyMusic32.db
insert into path('idPath', 'strPath', 'strHash') values (1, '/media/MYBOOK/Music', null);

So far so good, now how do I get the damn thing to scan for media???

JSON-RPC Api to the rescue!

A quick later (for those without an inbuilt URL Decoder {"jsonrpc": "2.0", "method": "AudioLibrary.Scan", "id": "1"}) , and my Raspberry is happily scanning my music files! Yeehaw, I deserve a beer for that!

One thought on “Running a headless raspbmc media server on Raspberry PI

  1. I may be the only person in the world trying to do exactly this. I’m trying to make Volumio work for me but I’m not thrilled with it at the moment. I’m keeping an open mind about it. My output is to go to a HiFiBerry DAC and I’m not sure if RaspBMC supports it yet, Volumio does. OTOH, I’m having a hell of a time getting the SAMBA/CIFS share on another Pi to get recognized under Volumio and I miss being able to RDP into GUI and instead having to SSH in to the system. I’m sure I’ll be a better person for it.

    Anyway, nice post, I may end up looking at doing exactly this in the near future.



Leave a Reply

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