Subsonic install in FreeBSD jail
This post is a continuation of the “FreeBSD jail on embedded Nas4Free install” post, which covered how to setup a FreeBSD jail on an Nas4Free embedded install. This post is going to cover setting up Subsonic standalone server inside the jail.
Subsonic is a piece of software i can recommend to anybody running a NAS server since with it you can use your NAS also as a media jukebox.
SSH to the NAS
After you logged on to the NAS, check that the jail is up and running using the “jls” command.The output should look something like this:
JID IP Address Hostname Path
1 192.168.1.201 plugins.domain.local /jail/plugins
Obviously the output on you NAS might differ from this one when it comes to the IP/Hostname and Path. Now lets enter the jail with the following command:
- jexec 1 csh
Install Subsonic required packages
One thing i’ve noticed is that the pkg_add command doesn’t function properly inside the jail. To fix this you have to run the following command:
- setenv PACKAGESITE ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-stable/Latest/
Once that is done we can start installing the packages required by Subsonic. You can basically just copy paste the following commands.
- pkg_add -v -r xtrans
- pkg_add -v -r xproto
- pkg_add -v -r xextproto
- pkg_add -v -r javavmwrapper
- pkg_add -v -r http://denieru.no-ip.org/filecache/subext/lame.tbz
- pkg_add -v -r flac
- pkg_add -v -r ffmpeg
- pkg_add -v -r openjdk7
Create folders and unpack Subsonic
Now its time to create the folders and download/extract subsonic standalone.
- mkdir /var/subsonic
- mkdir /var/subsonic/transcode
- mkdir /var/subsonic/standalone
- cp /usr/local/bin/lame /var/subsonic/transcode/
- cp /usr/local/bin/flac /var/subsonic/transcode/
- cp /usr/local/bin/ffmpeg /var/subsonic/transcode/
- cd /tmp/
- fetch http://heanet.dl.sourceforge.net/project/subsonic/subsonic/4.7/subsonic-4.7-standalone.tar.gz
- cd /var/subsonic/standalone
- tar xvzf /tmp/subsonic-4.7-standalone.tar.gz
- chmod 777 *.*
If there were no errors during the install enter the following command while you are still inside the jail to see if subsonic starts.
- sh /var/subsonic/standalone/subsonic.sh
If subsonic started as it should you can connect to it via the browser at the following adress: Jail-IP:4040, default username is admin, and password admin.
The finishing touches
And to make it run each time the Nas server is started we add it via the webgui under: System|Advanced|Command Scripts.
Command: jexec 1 /var/subsonic/standalone/subsonic.sh
Save and apply, and reboot your server. After a successful reboot you can check your Subsonic install via http://Jail-IP:4040
My Subsonic install had problems with the audio, the java install couldn’t see my audio dev. To solve this problem i installed alsa-plugins via the following command:
- pkg_add -v -r alsa-plugins
Enjoy your new Subsonic server!