NOTE: this document is complete, but needs polishing (I need to do a final run-through of the directions)..
The following guide is intermediate and is aimed towards individuals who want to look at the multimedia components in FreeNAS that will be present in 8.2.0 as plugins, but with a stable codebase until the official 8.2.0 release is done.
This writeup assumes the following:
1. You want to test out the BT, DLNA/uPnP, iTunes applications before the official plugins are released for 8.2.0.
2. You aren't afraid to go on to the command line/shell (use ee/vi, etc) to get things to work.
3. You can do basic troubleshooting to get things, or provide enough information in order to get things to work.
The examples in this email assume the following:
1. The username is "gcooper".
2. The path to the location where the media files is stored is housed somewhere on '/mnt/tank'.
The flow of the writeup is as follows:
* FAQs
* Bittorrent (Transmission)
- Copying over the Files
- Modifying the Sample File
- Enabling Transmission at Boot
- Controlling Transmission Remotely
* DLNA/uPnP (minidlna)
* iTunes (firefly)
* References
==========
FAQs
==========
* Q: Why isn't this stuff in the GUI yet?
* A: We're working on it and it'll be in 8.2.0+. Please be patient.
* Q: Why did you rewrite FreeNAS 8.x? FreeNAS 0.7 did this and more!
* A: Perhaps it was more featureful in this area, but it wasn't extensible. This is off-topic and not relevant.
* Q: Why are you using software A.B.C (ex. minidlna) instead of X.Y.Z (e.g. mediatomb, serviio)?
* A: This has been hashed over in several threads prior to this; as such I suggest that you search in the forums before asking this question. If you want to discuss importing a different piece of software and standardizing "the" defacto plugin on that software, please PM me with your request and a working procedure and/or end-to-end documentation on how to integrate it into FreeNAS using command line arguments and/or a set of configuration files. I'd like to avoid Serviio if at all possible though because it's Java based and Java requires X11 stuff in order to function (my goal is to remove all of the X11 components from FreeNAS eventually).
* Q: But mediatomb/transmission/etc already has a GUI? Why aren't you using that?
* A: That works for general purpose machines/users, but we want the software to cleanly tie into FreeNAS.
* Q: Why aren't you using Fuppes? It's in FreeNAS 0.7?
* A: The website's been dead for quite a while and it appears to be an inactive project. FreeNAS and some of the developers involved aren't interested in taking on any more projects at this time :).
==========
Bittorrent
==========
---------------------------------
Preconditions
---------------------------------
1. You need to create a user with a home directory on persistent storage (e.g. '/mnt/tank/home/gcooper').
---------------------------------
Copying Over the Files
---------------------------------
1. Login as the user that will be running transmission, e.g. "gcooper".
2. Issue the following commands to copy the file over the sample settings.json file, modifying according to your user's settings, and create some directories for Transmission:
Code:
mkdir -p "$HOME/.config/transmission-daemon"
mkdir -p "$HOME/transmission/incomplete"
mkdir -p "$HOME/transmission/complete"
cp /usr/local/etc/transmission/home/settings.json $HOME/.config/transmission-daemon/.
sed -e '' -i '' "s,/mnt/tank/home,`dirname $HOME`,g" \
-e 's,myuser,'`whoami`',g' $HOME/.config/transmission-daemon/settings.json
---------------------------------
The Sample File
---------------------------------
A sample settings.json file is present in $HOME/.config/transmission-daemon/settings.json ; some settings
that you might want to change are as follows:
peer-port : the port used for incoming BitTorrent requests. You probably want to change this and make sure to open up the firewall / NAT on your router/switch if needed to to your NAS box.
speed-limit-down : download speed limit
speed-limit-down-enabled : download speed limit toggle
speed-limit-up : upload speed limit
speed-limit-up-enabled : upload speed limit toggle
---------------------------------
Enabling Transmission at Boot
---------------------------------
Run the following commands as root:
Code:
mount -wu /
sed -i '' \
-e 's/\(transmission_enable="\)NO"/\1YES"/' \
-e 's/\(transmission_user="\)myuser/\1'`whoami`'\"/g' /etc/rc.conf
sed -i '' \
-e 's/\(transmission_enable="\)NO"/\1YES"/' \
-e 's/\(transmission_user="\)myuser/\1'`whoami`'\"/g' /conf/base/etc/rc.conf
mount -ru /
---------------------------------
Controlling Transmission Remotely
---------------------------------
Remote control is a really cool feature in transmission. You can login from authorized boxes while the daemon runs in the background grinding away on torrents
You can control (add torrents, monitor download stats, change settings, etc) the transmission daemon on your FreeNAS box by connecting via one of the clients noted here (look for Transmission-remote-*):
http://www.transmissionbt.com/resources/ . The author recommends "transmission-remote-dotnet" for Windows users.
The key to enabling the remote control feature is to change
to
in settings.json. The author suggests setting a value for
and changing
to something more meaningful.
---------------------------------
Testing Your Changes
---------------------------------
The best way to test your changes is to execute the following as root:
Code:
transmission-daemon -f
This will run transmission in the foreground so you can monitor progress when adding files to daemon.
Once you're satisfied with your results, enter in "Control-C" to exit from the daemon (this will potentially interrupt any torrent service being done at the time), and then enter in the following command as root:
Code:
service transmission start
and
Code:
service transmission status
to verify that the daemon is running. Congratulations -- you now have a working torrent client on FreeNAS!
==========
DLNA/uPnP
==========
---------------------------------
Preconditions
---------------------------------
1. You need to create a user with a home directory on persistent storage (e.g. '/mnt/tank/home/gcooper').
---------------------------------
Copying Over the Files
---------------------------------
1. Login as the user that will be housing the config files, e.g. "gcooper".
2. Issue the following commands to copy the file over the sample minidlna.conf file, modifying according to your user's settings, and create some directories for Minidlna:
Code:
mkdir -p "$HOME/var/db/minidlna"
mount -wu /
cp /conf/base/usr/local/etc/minidlna.conf $HOME/.
sed -i '' -e "s,/mnt/tank/home,`dirname $HOME`,g" \
-e "s/myuser/`whoami`/g" \
$HOME/minidlna.conf
---------------------------------
The Sample File
---------------------------------
A sample minidlna.conf file is present in $HOME/minidlna.conf ; some settings that you might want to change are as follows:
db_dir : directory where the minidlna media database will live.
media_dir : directory where media files can be grabbed from.
---------------------------------
Enabling minidlna at Boot
---------------------------------
Run the following commands as root:
Code:
mount -wu /
sed -i '' \
-e 's/\(minidlna_enable="\)NO"/\1YES"/' \
-e "s,\(minidlna_flags=.*\)/mnt/tank/home/myuser/\(.*\),\1$HOME\2,g" /etc/rc.conf
sed -i '' \
-e 's/\(minidlna_enable="\)NO"/\1YES"/' \
-e "s,\(minidlna_flags=.*\)/mnt/tank/home/myuser/\(.*\),\1$HOME\2,g" /conf/base/etc/rc.conf
mount -ru /
---------------------------------
Testing Your Changes
---------------------------------
The best way to test your changes is to execute the following as root:
Code:
mt-daapd -d -f $HOME/minidlna.conf
This will run firefly in the foreground so you can monitor progress when adding files to daemon.
Once you're satisfied with your results, enter in "Control-C" to exit from the daemon, and then enter in the following command as root:
Code:
service minidlna start
and
Code:
service minidlna status
to verify that the daemon is running. Congratulations -- you now have a working DLNA server running on FreeNAS!
==========
iTunes
==========
---------------------------------
Preconditions
---------------------------------
1. You need to create a user with a home directory on persistent storage (e.g. '/mnt/tank/home/gcooper').
---------------------------------
Copying Over the Files
---------------------------------
1. Login as the user that will be housing the config files, e.g. "gcooper".
2. Issue the following commands to copy the file over the sample mt-daapd.conf file, modifying according to your user's settings, and create some directories for Firefly:
Code:
mkdir -p "$HOME/var/db/mt-daapd"
chown daapd "$HOME/var/db/mt-daapd"
mount -wu /
cp /conf/base/usr/local/etc/mt-daapd.conf $HOME/.
sed -i '' -e "s,/mnt/tank/home,`dirname $HOME`,g" \
-e "s/myuser/`whoami`/g" \
$HOME/mt-daapd.conf
---------------------------------
The Sample File
---------------------------------
A sample mt-daapd.conf file is present in $HOME/mt-daapd.conf ; some settings that you might want to change are as follows:
admin_pw : administrator password.
db_parms : path for the where the iTunes/Firefly database should be.
mp3_dir : directory for where the mp3s, etc can be found.
servername : name of the iTunes share.
---------------------------------
Enabling mt-daapd at Boot
---------------------------------
Run the following commands as root:
Code:
mount -wu /
sed -i '' \
-e 's/\(mt_daapd_enable="\)NO"/\1YES"/' \
-e "s,\(mtdaapd_flags=.*\)/mnt/tank/home/myuser/\(.*\),\1$HOME\2,g" /etc/rc.conf
sed -i '' \
-e 's/\(mt_daapd_enable="\)NO"/\1YES"/' \
-e "s,\(mtdaapd_flags=.*\)/mnt/tank/home/myuser/\(.*\),\1$HOME\2,g" /conf/base/etc/rc.conf
mount -ru /
---------------------------------
Testing Your Changes
---------------------------------
The best way to test your changes is to execute the following as root:
Code:
mt-daapd -c $HOME/mt-daapd.conf -f
This will run firefly in the foreground so you can monitor progress when adding files to daemon.
Once you're satisfied with your results, enter in "Control-C" to exit from the daemon, and then enter in the following command as root:
Code:
service mt-daapd start
and
Code:
service mt-daapd status
to verify that the daemon is running. Congratulations -- you now have a working iTunes server running on FreeNAS!
==========
References
==========
---------------------------------
BitTorrent (Transmission)
---------------------------------
1. Editing config files in Transmission -
https://trac.transmissionbt.com/wiki/EditConfigFiles
---------------------------------
DLNA/uPNP (Minidlna)
---------------------------------
1.
http://forums.freenas.org/showthrea...dlna-on-the-freenas-nightlies-post-09-25-2011
---------------------------------
Daapd/iTunes (firefly)
---------------------------------
1.
http://forums.freenas.org/showthrea...efly-on-the-freenas-nightlies-post-09-25-2011