Transmission Plugin on FreeNAS 11.2
This is probably all obvious to any “real” FreeBSD people. And possibly to anyone who’s using a FreeNAS installation that hasn’t been slowly upgraded since 2013. But for better or for worse, I’m used to Linux these days and all of my habits around FreeNAS were cemented shortly after I installed my first one in 2013. So there were a few bumps bringing myself up to speed with current practice, and I’ve captured them here mostly so I can remember what I did and partly in hopes of making it more searchable.
The goal of this setup is to have a “torrents” fileshare that is accessible to everything on my LAN. When something I want to download is available by torrent, I can visit its web UI and kick off the download, then connect to the share and use it when it’s finished. This has a few benefits:
- I only have to punch bittorrent through the firewall for the one jail’d IP exposed on the NAS.
- Downloads are available on multiple machines.
- I don’t have to leave the client systems on for (sometimes very slow) downloads.
- I can easily keep seeding once I’m done.
Getting it set up this way was non-intuitive for me. I’m sure this was in no small part because my original setup of the transmission plugin had rotted across various FreeNAS updates, and my desire to grab a couple of Linux ISOs this week spurred an update.
Here are the steps I eventually needed, distilled to what I think is roughly minimal.
- Create a new user. Call it
transmission
. Note the user id and group that get assigned. - Create a new zfs dataset. Call it
torrent-share
. Use Windows-style ACLs on the share, as CIFS seems to be the best thing to use with most of the *nix and Windows machines on my network. - Create a new SMB share and turn it on. Make sure you can connect to it and write to it over the network. (
mount -tcifs -ousername=transmission //server/share mountpoint
on my linux workstation) - Install the transmission plugin. Accept the defaults.
- Stop the service immediately thereafter from the plugins screen.
- Go to the newly created jail and add your newly created share as a mount point.
- Open a new shell in the jail.
- Get the uid and gid of the owner of your new mount point (
ls -l /path/to/mount/point
) - Add a new user in the jail that matches those (
pw useradd -n transmissiond -u (user id) -d /nonexistent -s /usr/sbin/nologin
) - Edit /etc/group so the gid of that new user matches the gid of the mount point owner.
chown -R transmissiond:transmissiond (mountpoint) /usr/local/etc/transmission
sysrc transmission_user=transmissiond
sysrc transmission_group=transmissiond
- edit
/usr/local/etc/transmission/settings.json
so that eitherrpc_whitelist
contains your clients' IPs orrpc_whitelist-enabled
isfalse
. The latter is OK on my network. - change
transmission_download_dir
to reference the mount point of the share within the jail - start transmission and try out a download. When it finishes you should see it in the share.