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
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:
sudo add-apt-repository ppa:transmissionbt/ppa sudo apt-get update sudo apt-get install transmission-daemon sudo service transmission-daemon stop
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:
- Transmission-daemon needs to read and write on those files with its own user and group called debian-transmission;
- Transmission-daemon overwrites the settings file (located under
settings.json) when it’s closing;
- 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;
- 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):
cd /home/user/.config/ chown -R debian-transmission:debian-transmission transmission cp transmission/settings.json transmission/settings.json-backup chown root:root transmission/settings.json-backup
Next, do a
sudo nano transmission/settings.json and verify the settings about directory locations and RPC:
"download-dir": "/home/user/Downloads", "incomplete-dir": "/home/user/Downloads/Incomplete", "incomplete-dir-enabled": "false", "open-dialog-dir": "/home/user/Downloads", "recent-download-dir-1": "/home/user/Downloads", "watch-dir": "/home/user/Downloads", "watch-dir-enabled": "false", "rpc-enabled": true, "rpc-bind-address": "0.0.0.0", "rpc-port": 9091, "rpc-url": "/transmission/", "rpc-authentication-required": true, "rpc-username": "yourusername", "rpc-password": "yourpassword", "rpc-whitelist": "*.*.*.*", "rpc-whitelist-enabled": true,
Just a couple of notes:
rpc-enabled: pretty clear what’s this about, right?
"0.0.0.0"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:
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:
sudo touch /var/log/transmission.log sudo chown debian-transmission:debian-transmission /var/log/transmission.log sudo chmod 644 /var/log/transmission.log sudo nano /etc/default/transmission-daemon
Look for the line starting with
OPTIONS, and set them like this:
CONFIG_DIR="/home/user/.config/transmission" OPTIONS="--config-dir $CONFIG_DIR --log-debug --logfile /var/log/transmission.log"
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:
sudo service transmission-daemon start tail -F /var/log/transmission.log
If everything goes fine, you’ll see something like this:
[01:50:49.880] Transmission 2.82 (14160) started (session.c:738) [01:50:49.880] Cache Maximum cache size set to 4.00 MiB (256 blocks) (cache.c:264) [01:50:49.880] RPC Server Adding address to whitelist: *.*.*.* (rpc-server.c:828) [01:50:49.880] RPC Server Serving RPC and Web requests on port 127.0.0.1:9091/transmission/ (rpc-server.c:1035) [01:50:49.880] RPC Server Whitelist enabled (rpc-server.c:1039) [01:50:49.880] RPC Server Password required (rpc-server.c:1004)
Now you should be able to get back on XBMC and it should work: