If you are using multiple instances of XBMC throughout your house one thing you’ll definitely want to consider is setting up a shared MySQL database that can be used to retain data about the media you have. A good example of this is saving the status of where you left off in a video. If all of your XBMC instances don’t share a centralized data system you won’t be able to stop a video in one room and pick up where you left off in another. A MySQL database gives each XBMC a way to share that data.




You can even step beyond just sharing a database and share other files as well. This can include thumbnails of the media you have in your library, add-on configurations, media sources, and more. When all of this is set up it will almost be like having a centralized XBMC server.

Setup a Shared MySQL Database:

Xbmc sql

On your centralized server you’ll want to install and configure MySQL which will vary based on OS. Here is a general overview of what you need to do:

  1. Install and start MySQL (note that there is a link to skip registering for an account on the download page)
  2. Open the Terminal (on a Mac) or the MySQL Command Line Client (on Windows) and run the following commands:
    1. CREATE USER ‘xbmc’ IDENTIFIED BY ‘xbmc';
    2. CREATE database xbmc_video; (This is no longer needed)
    3. CREATE database xbmc_music; (This is no longer needed)
    4. GRANT ALL ON *.* TO ‘xbmc';

Now we need to configure the XBMC clients to connect to the new MySQL database. On each of the clients navigate to the following directory:

  • Mac: ~/Library/Application Support/XBMC/userdata/
  • Windows: %appdata%\XBMC\userdata\

If you don’t see a file named advancedsettings.xml go ahead and create it, but if it does exist just open it up. You’ll need to add the following lines to it:

<videodatabase>
<host>192.168.1.10</host>
<name>xbmc_video</name>
<port>3306</port>
<user>xbmc</user>
<pass>xbmc</pass>
</videodatabase>

<musicdatabase>
<type>mysql</type>
<host>192.168.1.10</host>
<name>xbmc_music</name>
<port>3306</port>
<user>xbmc</user>
<pass>xbmc</pass>
</musicdatabase>

All you have to do is update the <host> IP address to point to the computer running your MySQL instance, restart XBMC, and it should start using the databases you created.  If you’re still having troubles you can head on over to the XBMC Wiki to take a look at some of their OS-specific tips.

Share Settings and Add-on Configuration Files:

XBMC also has what they refer to as a special protocol that will let you configure local files to be shared among multiple instances thanks to path substitution. What that means is that you can tell XBMC to redirect any requests to specific files/folders to a remote location on another computer.

Below you can see I’m redirecting all kinds of locations including thumbnails used for movies/TV shows, playlists, addon configuration data, all of my media sources, and more.

To get started on each of the clients navigate to the following directory:

  • Mac: ~/Library/Application Support/XBMC/userdata/
  • Windows: %appdata%\XBMC\userdata\

If you don’t see a file named advancedsettings.xml go ahead and create it, but if it does exist just open it up. You’ll then want to add the lines below and update the “to” node of each substitution to match how your system is set up. The “smb” refers to the Samba protocol I’m using to connect to the share, the “192.168.1.10” is the IP address of the computer hosting the files, and the “XBMC” is the share name on that server.

<pathsubstitution>
<substitute>
<from>special://masterprofile/Thumbnails/</from>
<to>smb://192.168.1.10/XBMC/Thumbnails/</to>
</substitute>

<substitute>
<from>special://masterprofile/playlists/</from>
<to>smb://192.168.1.10/XBMC/Settings/playlists/</to>
</substitute>

<substitute>
<from>special://masterprofile/addon_data/</from>
<to>smb://192.168.1.10/XBMC/Settings/addon_data/</to>
</substitute>

<substitute>
<from>special://masterprofile/sources.xml</from>
<to>smb://192.168.1.10/XBMC/Settings/sources.xml</to>
</substitute>

<substitute>
<from>special://masterprofile/mediasources.xml</from>
<to>smb://192.168.1.10/XBMC/Settings/mediasources.xml</to>
</substitute>

<substitute>
<from>special://masterprofile/RssFeeds.xml</from>
<to>smb://192.168.1.10/XBMC/Settings/RssFeeds.xml</to>
</substitute>

<substitute>
<from>special://masterprofile/favourites.xml</from>
<to>smb://192.168.1.10/XBMC/Settings/favourites.xml</to>
</substitute>

<substitute>
<from>special://masterprofile/profiles.xml</from>
<to>smb://192.168.1.10/XBMC/Settings/profiles.xml</to>
</substitute>
</pathsubstitution>

Once you have this all in place just restart XBMC for the changes to take effect, and you should see it start using those locations for storing the files.

CyberNet’s XBMC Guides: