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.

  1. Create a new user. Call it transmission. Note the user id and group that get assigned.
  2. 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.
  3. 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)
  4. Install the transmission plugin. Accept the defaults.
  5. Stop the service immediately thereafter from the plugins screen.
  6. Go to the newly created jail and add your newly created share as a mount point.
  7. Open a new shell in the jail.
  8. Get the uid and gid of the owner of your new mount point (ls -l /path/to/mount/point)
  9. Add a new user in the jail that matches those (pw useradd -n transmissiond -u (user id) -d /nonexistent -s /usr/sbin/nologin)
  10. Edit /etc/group so the gid of that new user matches the gid of the mount point owner.
  11. chown -R transmissiond:transmissiond (mountpoint) /usr/local/etc/transmission
  12. sysrc transmission_user=transmissiond
  13. sysrc transmission_group=transmissiond
  14. edit /usr/local/etc/transmission/settings.json so that either rpc_whitelist contains your clients' IPs or rpc_whitelist-enabled is false. The latter is OK on my network.
  15. change transmission_download_dir to reference the mount point of the share within the jail
  16. start transmission and try out a download. When it finishes you should see it in the share.