Featured Post
The whole point in this post is to run your own VPN service, and allow you to connect remote devices to your home network.
To start off yo…
Showing posts with label flac.
Showing posts with label flac.
Firstly, I have to say I cannot take all the credit for this… I got a lot of information from , who in turn got it from NAS4Free wiki.
However, I did find some problems along the way, and as usual I want to keep it somewhere I can get easy access to in future – this blog. Please also note, this will solve any m4a and flac transcoding issues, and possibly other codecs.
The whole process relies on you setting up a jail in NAS4Free so that the changes are not lost on reboot (since this is an embedded guide).
Lets start of with configuring NAS4Free to complete this task:
SSH into your NAS4Free box using putty or similar. NOTE: Change all reference to /mnt/data to the mountpoint on your NAS where you are going to store the jail.
The base system has to be downloaded to make sure you get all
the necessary binaries, config files and scripts. To download it you can
just copy paste the following commands into the ssh shell.
The last command for fetching lib32 is not needed if you are running NAS4Free on an 32bit system. The following two commands extract the base system into the proto folder inside the jail.
NOTE: Obviously exchange EST for
your own time=zone. Next we will configure the mounts that the jail is
going to be able to access.
NOTE: Change DataDisk1 for the mounts that you have on the NAS
that you want to be accessible in the jail.
Copy into the fstab file the following lines:
/mnt/data/DataDisk1 /jail/proto/mnt/DataDisk1 nullfs rw 0 0
The drive is mounted read write for playlist, comments, ratings, podcast access from Subsonic.
The next part of the
configuration is to create the rc.conf file.
Copy into the rc.conf.local the following lines:
jail_enable=”YES” # enable jails YES|NO
jail_list=”proto” # name of the jails to start “proto www…”
jail_proto_rootdir=”/jail/proto” # path to our jail
jail_proto_hostname=”proto” # hostname
jail_proto_ip=”192.168.0.30″ # ip of the jail, replace with a ip in the same subsystem as your NAS
jail_proto_interface=”re0″ # Network Interface to use, replace with your NAS interface name
jail_proto_devfs_enable=”YES” # use devfs
jail_proto_mount_enable=”YES” # mount YES|NO
jail_proto_fstab=”/jail/conf/fstab.proto” # File with Filesystems to mount
Copy into jail_start the following lines:
#!/bin/tcsh -x
#mounting to /jail
mkdir /jail
mount_nullfs /mnt/data/jail /jail
# copy jail binaries to /usr, not needed if N4F is 454 or up
# because Daoyama include needed files, uncomment if you use low .454 version
# cp -r /jail/conf/root/ /
# link config files to /etc
ln -s /jail/conf/rc.conf.local /etc
#start all jails
/etc/rc.d/jail start
Make the start-up script executable with the following command:
And to make it run each time the NAS server is started, add the following via the webgui under System|Advanced|Command Scripts.
Command: /mnt/data/jail/conf/jail_start
Type: PostInit
Save and apply, and reboot your server. After a successful reboot check your new jail via SSH using the jls command, you should see something like this:
JID IP Address Hostname Path
1 192.168.1.201 proto /jail/proto
And that’s how you setup a FreeBSD jail on NAS4Free embedded.
Enter the jail with the following command (based on the output of example jls above we use 1):
The pkg_add command doesn’t function
properly inside the jail. To fix this you have to run the following
command NOTE: I am using a 64-bit install:
Now start installing the packages required by
Subsonic:
Now install libmp3lame so that ffmpeg can use it for transcoding:
Now compile and install your own ffmpeg with libmp3lame enabled, (remember –enable-libmp3lame during make config):
Create the folders and download/extract subsonic standalone.
Enter the following
command while you are still inside the jail to see if subsonic starts.
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.
To make it run each time the NAS server is started add via the webgui under: System|Advanced|Command Scripts.
Command: jexec 1 /var/subsonic/standalone/subsonic.sh
Type: PostInit
Save and apply, and reboot your server. After a successful reboot you can check your Subsonic install via http://Jail-IP:4040
If your Subsonic installation has problems with the audio (the java
install couldn’t see your audio dev) install
alsa-plugins via the following command:
ENJOY!
And if you want to access your new service on your android device, why not try out the official
(4/17/2013 Updated for Subsonic 4.8)
(5/10/2013 Updated based on fsbruva’s comments http://forums.nas4free.org/viewtopic.php?f=79&t=3166&p=19759#p19759)
Subscribe to:
Labels
Blog Archive
Links