Random Linux Geekery, issue 1: Migrating from Transmission to Transmission-Daemon on XBMCbuntu.

After using XBMC on top of an Ubuntu installation for a while, I’ve decided to rather reinstall everything using XBMCbuntu. As the name suggests, it’s basically the same thing, with the difference that this distribution is aimed at using XBMC as the only application on X session (= no GNOME on background), and strips off many packages that you’re most likely not going to use in a media center.

XBMC is indeed autonomous enough, and has pretty much everything you need from a media center, as well as some extras even. One of these is a very nice add-on that controls a running instance of Transmission remotely via RPC. The problem is that it’s not easy to get Transmission running locally. My solution is to use transmission-daemon, which is running on background with a very little consumption of memory.

I assume you know what Transmission is, but in short: it’s a very nice BitTorrent client. I’ve been using it for years and I loved it. The problem is that Transmission stores the data locally (in /home/user/.config/transmission/), while transmission-daemon uses something different (in my case /var/lib/transmission-daemon/info).

Another problem was that, when I wanted to troubleshoot this application, I realized it was not logging anywhere.

Long story short: this guide will show you what I did, and some of these points will probably help you with your own little struggle it working.

Step 1: Install transmission-daemon

This is fairly simple: once you’re on XBMC, switch to the console (Ctrl+Alt+F1), add the PPA of Transmission, update and install the package… but also I want to make sure that the daemon is not running, since we’ll need to reconfigure several things:

Step 2: Prepare your existing directory

Now, this really depends on whether you’ve decided to use the daemon only, or you actually want to be able to change your mind later on and revert to the normal Transmission. In my case it was something in the middle: I wanted to use the daemon only but, still, I didn’t want to go around and change all the directory references, and maybe I will go back to using the normal Transmission later on instead of a remote GUI.

If you want to go this way, there are three things you need to keep in mind:

  1. Transmission-daemon needs to read and write on those files with its own user and group called debian-transmission;
  2. Transmission-daemon overwrites the settings file (located under settings.json) when it’s closing;
  3. Since you need to set up a directory for the downloads, one for the incomplete downloads, and one where to watch for new .torrent files, even if you don’t actually enable all of them, it’s better to have them set up all together in the same directory;
  4. RPC must be enabled, otherwise this whole thing will be totally useless!

So, first of all let’s change user/group and then let’s make a backup of the file (which I will set as root just to ensure transmission-daemon won’t touch it by mistake, but that’s really up to you):

Next, do a sudo nano transmission/settings.json and verify the settings about directory locations and RPC:

Just a couple of notes:

  • rpc-enabled: pretty clear what’s this about, right?
  • rpc-bind-address: leave "" if you want it the RPC server to listen to all the interfaces, otherwise set the IP address of the specific interface;
  • rpc-authentication-required: you can either use this or white-listing, I think it’s a bit overkill to use both, unless you’re planning on controlling this from outside your LAN;
  • rpc-password: put it in plain-text, Transmission will re-hash it when saving the file;
  • rpc-whitelist: you can either leave "*.*.*.*" (all IP addresses) or you can set specific values with or without wildcards, for example: "192.168.0.*,,".

Step 3: Reconfigure the daemon

Now it’s time to make the daemon take the new settings. This was a bit of a tricky part because I couldn’t find that much documentation on it. Keep in mind that, on top of this, I’m also setting up a pretty verbose log (using the options –log-debug and –logfile).

So, let’s prepare the logfile and let’s edit the settings for the daemon:

Look for the line starting with CONFIG_DIR and OPTIONS, and set them like this:

Then just press Ctrl+X, Y, Enter, Enter.

Step 4: We’re ready!

Let’s restart the daemon and then let’s monitor the log file to see what happens:

If everything goes fine, you’ll see something like this:

Now you should be able to get back on XBMC and it should work:

Transmission on XBMC

Note something down here. Put some effort into it.