Transmission on AppleTV
This is a tutorial to install the superb Transmission bittorrent client, with its equally superb Clutch web interface, on an AppleTV with OS 2.3 (I also tested it on OS 2.3.1). It is based on many posts I've found on the internet and my personal experience. I apologise in advance for my English as I am not a native english speaker.
What you need
- The Transmission code. Due to AppleTV limitations, the last working release is 1.06. I will try harder to make newer releases work properly (it seems all it needs is a particular library, but then that in turn could have other requirements)
- The Clutch WebUI
- The MAMP Server. Warning: this download weighs about 130 MB
- A Mac with Tiger (10.4) or Leopard (10.5) OS, with XCode 2.5 or 3.0 installed (these are on your installation disks, or you can get the last releases from the Apple Developer Connection)
- An AppleTV :) with SSH enabled
Transmission building and installation
Uncompress the Transmission file. You should get a folder which contains a file named Transmission.xcodeproj: double-click on it, XCode should open. From the Overview drop-down menu on the window select transmission-daemon as active target. Press the Build and Go icon. Do the same selecting transmission-remote (verify in the lower-right corner of the window you get a "Succeded" message in both cases). Now, you should have a newly created folder in your Transmission folder named build. This folder should contain (you guessed it!) the builds, in a subfolder called Development: they are aptly named transmission-daemon and transmission-remote. Copy these two files on your AppleTV (using SSH or whatever else you want) in the /Users/frontrow directory. Be sure they have rwxr-xr-x permissions and belong to the frontrow user and the frontrow group, if you're in doubt just use these two commands:
sudo chmod 755 transmission-* sudo chown frontrow:frontrow transmission-*
Copy the MAMP folder (it's in the .dmg file you downloaded) on your AppleTV in the /Users/frontrow directory. Give the command
sudo ln -s /Users/frontrow/MAMP /Applications/MAMP/
If you want to save hard disk space on your AppleTV, there are several things you can delete from this folder (for example, everything related to php4, SQLite and mysql). If you want to be on the safe side, don't worry.
Uncompress the Clutch file. In the folder you get, locate the file socket.txt in the subfolder data of the subfolder remote, open it, delete what's inside and insert the row
Save the file and copy the contents of the Clutch folder (not the folder itself) on your AppleTV in the /Users/frontrow/MAMP/htdocs directory. Give the command
sudo chmod -R 775 /Users/frontrow/MAMP
Test everything is working
Open two SSH sessions to your AppleTV. On the first one, give the command
You should get something like this:
Transmission 1.06 (5129) started Bound socket 7 to port 51413 Port Mapping: opened port 51413 to listen for incoming peer connections
On the second one, give the command
Now, using your browser, go to http://yourappletvipaddress:8888. If everything is alright you should get the Clutch interface, try downloading your first torrent. It should go to the /Users/frontrow directory. You can use the transmission-remote program (transmission-remote -h gives the help) or the Clutch interface itself to set your preferences, including the download directory. When you've had enough, use Ctrl-C to stop transmission-daemon.
Make it automatic
To start Transmission and its interface when you boot your AppleTV (so it keeps working even after power failures) you should create two documents in the /System/Library/LaunchDaemons directory. Here are the necessary commands:
sudo nano /System/Library/LaunchDaemons/apache.plist
This one creates a new file called apache.plist in the appropriate directory. Paste these rows inside:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Debug</key> <true/> <key>GroupName</key> <string>frontrow</string> <key>Label</key> <string>org.apache.httpd</string> <key>OnDemand</key> <false/> <key>ProgramArguments</key> <array> <string>/Users/frontrow/MAMP/bin/startApache.sh</string> </array> <key>RunAtLoad</key> <true/> <key>ServiceDescription</key> <string>apache</string> <key>UserName</key> <string>frontrow</string> <key>WorkingDirectory</key> <string>/Users/frontrow/MAMP/</string> </dict> </plist>
Press Ctrl-O to save the file and then Ctrl-X to exit. Repeat for the second file:
sudo nano /System/Library/LaunchDaemons/transmission.plist
This is the text to paste inside:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Debug</key> <true/> <key>GroupName</key> <string>frontrow</string> <key>Label</key> <string>org.m0k.transmission</string> <key>OnDemand</key> <false/> <key>ProgramArguments</key> <array> <string>/Users/frontrow/transmission-daemon</string> </array> <key>RunAtLoad</key> <true/> <key>ServiceDescription</key> <string>transmission</string> <key>UserName</key> <string>frontrow</string> <key>WorkingDirectory</key> <string>/Users/frontrow/Library/Application Support/Transmission</string> </dict> </plist>
Reboot your AppleTV and test if everything is working correctly.