[HOWTO] Install Serviio in Freenas 8.0.x

Status
Not open for further replies.

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
[Micah@freenas] /> pkg_add -v -r javawrapper

Your problem is you have the package name spelled wrong, it should be: javavmwrapper

I'll bet if you get that fixed the rest will work too.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
I haven't paid much attention to this before, but looking back and getting caught up I think this whole setup would work a LOT smoother if it was setup in a Jail. Then you wouldn't need to worry about remapping /var, reloading packages, compiling ports, and stuff disappearing when you reboot. I'm working on finishing up another HowTo with @mwoods98 on setting up Streambaby in a Jail. After we get that done I'll try and write up HowTo setup Serviio in a Jail and maybe even post links for a preconfigured Jail you can just download and change the settings to match your setup (the IP, volume name, etc.).

Once you understand how Jails work and how easy they are to setup, you'll be creating or adding apps to an existing Jail for everything you want to add to FreeNAS.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
This is another HUGE advantage of Jails, not unintentionally filling up your flash drive. I'm working on the HowTo.

@pontiacgta2002

One of these two commands below should let you mount partitions on your flash drive using Ubuntu. You have to make sure you have the right partition/name to make it work, FreeBSD partitions are named/setup different than dos/Fat partitions. There are 2 partitions that are about 940MB, one is the previous installation before an upgrade, and the other is the current boot partition. Try looking for the Jave JRE package you downloaded and remove that if its still on there, not sure what else to suggest removing. The other option is to copy the freenas-v1.db from /data, reflash your drive, and copy that file back to /data and reboot, that will restore your settings. The trick will be getting it back in /data, which will mean mounting it in Ubuntu again after you reflash.

Here are the mount commands, you'll need to change the device names of course, and make the directory /media/usbDrive.

sudo mount -r -t ufs -o ufstype=44bsd /dev/sdf1 /media/usbDrive/

sudo mount -r -t ufs -o ufstype=ufs2 /dev/sdf1 /media/usbDrive/

Hope that helps.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
What a bloody f'in mess! I don't know how any of you managed to get serviio working! I'm not anywhere near a noob and based on what I picked out of this thread I'm amazed I got it to work!

@Ltworf13, you have my sympathy!

Anyway, I just finally got this working in a Jail, but I did so many different things that I need to look back on my notes and try to recreate it again before I can share the details. I can say there are a lot of shortcuts and improvements to look forward to. This isn't something I plan to use personally, but I really thought the benefits of setting this up & running it in a jail would be something worth sharing. Stay tuned for the HowTo. Once you have this setup in a jail, it will be a breeze to upgrade FreeNAS and not have to worry about setting this up again. You'll just have to backup 3 files and restore them after you upgrade FreeNAS and you'll be ready to go again.

Please don't take my complaining about setting this up the wrong way. This thread still had most of the important details and it wouldn't have been any easier without all the stuff you guys figured out!
 

bgonev

Cadet
Joined
Oct 18, 2011
Messages
6
Empty folders on Sony Bravia

After successful installation of serviio, when I'm accessing serviio server from my Sony Bravia TV, I can see only emty folders i.e. Video -> Serviio -> Folders -> <There are no items to display>.

I have FreeNAS-8.0.2-RELEASE-amd64 (8288), and I've used this tutorial to install Serviio. Also on freenas i have about 250 GB mixed content of MP3, AVI, JPG files.

What am I doing wrong ? Is there any configuration file of Serviio where should I state which directories on freenas are media content cariers ?
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
What am I doing wrong ? Is there any configuration file of Serviio where should I state which directories on freenas are media content cariers ?

Look at the Serviio FAQ, you need to install the Serviio console program and configure it from there. There's a windows client, download the package and only install the console, then edit the file ServiioService.exe.vmoptions in the folder where the console.exe is stored and add the option -Dserviio.remoteHost=Server-IP-Address.

Serviio FAQ

EDIT: Maybe I'm missing something also, still not finding video after configuring in console.

EDIT-2: Ok, figured out that Window Media Player doesn't work with Serviio. Got XBMC and set it up on my laptop to test Serviio and it works great.
 

bgonev

Cadet
Joined
Oct 18, 2011
Messages
6
Thanks, I already corrected my self - found that client connection is needed in order to configure Serviio :) - lazy me. Now everything working great - watching a movie at the moment on my Sony Bravia :). I need to make it to auto-run on reboot but that will be on tomorow task list, Thanks again for great guide !
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
I just posted the HowTo for installing Serviio in a Jail, here's the link:

HOWTO-Install-Serviio-in-a-FreeBSD-Jail-on-FreeNAS-8.0.x

I went thru it several times from scratch to test it, but that doesn't mean I didn't miss something. Please post questions here in this thread to keep the discussion in one place. The IP address you assign to the jail will be the one you use to access serviio, and it should be different from your FreeNAS IP. You can install other apps in here also without worrying about filling up your flash drive. Media files should be placed /mnt/tank/_Media, but if you want to change that, you'll also need to update /conf/base/fstab.serviio. Don't try to test serviio by using Windows Media Player because WMP isn't compatible. Also, as mentioned above in post #48, you'll need to install the Serviio Console to configure Serviio. Before upgrading FreeNAS, backup these files:

  • /conf/base/etc/rc.conf
    [*]/conf/base/etc/sysctl.conf
    [*]/conf/base/etc/fstab.serviio

If I think of anything else, I'll update this post so the details are in one place.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
@protosd

I only have the one freenas on this stick as it was a new install. the file is 163 kb does that sound right?

YES

I have a usb drive that i can load freenas back onto and go from there. If i wanted to try mounting the full usb stick onto another freenas system how would I mount the usb stick? is that possible?

Yes, you can do that. Boot from the working FreeNAS, plug in the drive you want to examine and do 'gpart show'. This will list all of your partitions on all of your drives. If you're looking at the console when you plug in the drive you want to examine, the device name for that drive should show up. Use that to find your flash drive in the list from 'gpart show' and then you can find the partition names it contains, for example da0s1 or da0s2 or da1s1...

Then you need to make a mount point (some folder like /mnt/temp), then you would mount /dev/da0s1 /mnt/temp, changing the da0s1 to the partition you want to mount. If you get the wrong one, then do 'umount /mnt/temp' and try again.

Im not sure how this got full in the first place. i pointed everything to be written to a place on the data drives.

If you were trying to install a package, that would have done it. My advice is once you get things restored, try out the Jail method of Serviio and with a jail you won't have to worry about filling up your flash drive by mistake unless my directions are completely bad or you miss a step or something.
 

editmode

Cadet
Joined
Oct 10, 2011
Messages
3
First off, thanks to protosd for the great tutorial.

Was able to get Serviio installed using the jail method. Can confirm everything is running, can connect to the Serviio console and the server shows up on the TV fine. Only problem is that no video files are showing up. All files are placed in the _MEDIA directory, and present in the usr/local/serviio-0.6.0.1/MEDIA directory as well. Is there a step I missed?
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Thanks for the feedback Editmode. I don't think you missed anything, I had that problem too. If there are a lot of media files it can be slow, but I had to mess around with the console, AND I was trying with Windows Media Player at first and then realized WMP wasn't supported. Then I tried XBMC, which you'll also need to configure to activate UPnP mode before it will find Serviio. I'm trying to remember the path I put in the Serviio console to get it to work, I think it was /usr/local/serviio-0.6.0.1/MEDIA Is that the path you added in the console?
Hope that helps
 

editmode

Cadet
Joined
Oct 10, 2011
Messages
3
Changing the path to /usr/local/serviio-0.6.0.1/MEDIA did the trick, had it set to /mnt/tank/_MEDIA before. Thanks again for the help, much appreciated.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
You're welcome. The other path is OUTSIDE the jail, so if you drop videos in there they will show up INSIDE the jail in /usr/local/serviio-0.6.0.1/MEDIA. That's what the fstab.serviio file does, sets up a link to a folder inside a jail so they can share stuff but still be isolated.

I'm glad you got it working, thanks again for the feedback.
 

parks853

Dabbler
Joined
Jul 26, 2011
Messages
36
I downloaded the pre-built 64 bit jail and followed the serviio jail how to and seem to have something configured wrong (either inside or outside the jail). My dvd player will temporarily show serviio but then it disappears. I can't find serviio upnp in XBMC at all. It seems using the console from a windows computer works. I can't see any errors in the logs. I'm not sure if I should be able to launch serviio-console.sh manually but that created some java errors. If I login to the jail I can do a 'ps' and it shows java and serviio as processes. I'll list some of my configuration files to see if anyone can help me troubleshoot this.

I changed all the files listed in the how to with my proper ip address and network adapter (i use the same pool name 'tank'). I'm not sure what resolv.conf should be - is it the DNS and gateway from my router (I didn't have it set in the gui so did that)?

I did have to create /mnt/tank/_MEDIA manually.

files from the jail:

etc/resolv.conf
Code:
search local
nameserver 10.0.1.1


/usr/local/serviio-0.6.0.1 is admin:admin 755

etc/hosts
Code:
::1                     localhost localhost.my.domain
#127.0.0.1              localhost localhost.my.domain
127.0.0.1               localhost
#
# Imaginary network.
#10.0.0.2               myname.my.domain myname
#10.0.0.3               myfriend.my.domain myfriend
#
# According to RFC 1918, you can use the following IP networks for
# private nets which will never be connected to the Internet:
#
#       10.0.0.0        -   10.255.255.255
#       172.16.0.0      -   172.31.255.255
#       192.168.0.0     -   192.168.255.255
#
# In case you want to be able to connect to the Internet, you need
# real official assigned numbers.  Do not try to invent your own network
# numbers but instead get one from your network provider (if any) or
# from your regional registry (ARIN, APNIC, LACNIC, RIPE NCC, or AfriNIC.)
#
10.0.1.150      serviio serviio.freenas.local


Outside the jail:

/conf/base/etc/rc.conf and /etc (should these files be the same in the jail?)
Code:
hostname="freenas"
sshd_enable="YES"

sendmail_enable="NONE"  # Run the sendmail inbound daemon (YES/NO).

dumpdev="NO"            # Device to crashdump to (device name, AUTO, or NO).
background_fsck="NO"

harvest_interrupt="NO"  # Entropy device harvests interrupt randomness
harvest_ethernet="NO"   # Entropy device harvests ethernet randomness
harvest_p_to_p="NO"     # Entropy device harvests point-to-point randomness

synchronous_dhclient="YES"      # Start dhclient directly on configured

ntpd_enable="YES"
ntpd_sync_on_start="YES"

# open-vm-tools
vmware_guest_vmblock_enable="YES"
vmware_guest_vmhgfs_enable="YES"
vmware_guest_vmmemctl_enable="YES"
vmware_guest_vmxnet_enable="YES"
vmware_guestd_enable="YES"

# Silence syslogd about missing files
syslogd_flags="-s -C"

collectd_enable="YES"

fusefs_enable="YES"

devfs_system_ruleset="usbrules"
lighttpd_enable=YES
#
jail_enable="YES"
jail_set_hostname_allow="YES"
#
jail_list="serviio"
jail_serviio_hostname="serviio"
jail_serviio_ip="10.0.1.150"
jail_serviio_interface="re0"
jail_serviio_rootdir="/mnt/tank/Serviio_Jail/Serviio_root"
jail_serviio_devfs_enable="YES"
jail_serviio_mount_enable="YES"
jail_serviio_fstab="/etc/fstab.serviio"
#jail_serviio_exec_afterstart="" (will start a command inside jail after booting)


/conf/base/etc/sysctl.conf and /etc (should these files be the same in the jail?)
Code:
kern.metadelay=3
kern.dirdelay=4
kern.filedelay=5
kern.coredump=0
#
security.jail.param.cpuset.id=0
security.jail.param.host.hostid=0
security.jail.param.host.hostuuid=64
security.jail.param.host.domainname=256
security.jail.param.host.hostname=256
security.jail.param.children.max=0
security.jail.param.children.cur=0
security.jail.param.enforce_statfs=0
security.jail.param.securelevel=0
security.jail.param.path=1024
security.jail.param.name=256
security.jail.param.parent=0
security.jail.param.jid=0
security.jail.enforce_statfs=2
security.jail.mount_allowed=1
security.jail.chflags_allowed=1
security.jail.allow_raw_sockets=1
security.jail.sysvipc_allowed=0
security.jail.socket_unixiproute_only=1
security.jail.set_hostname_allowed=1
security.jail.jail_max_af_ips=255
security.jail.jailed=0


/conf/base/etc/fstab.serviio and /etc (should these files be the same in the jail?)
Code:
#JAIL
/mnt/tank/_MEDIA  /mnt/tank/Serviio_Jail/Serviio_root/usr/local/serviio-0.6.0.1/MEDIA   nullfs rw 0 0


/etc/hosts
Code:
::1                     localhost localhost.my.domain freenas freenas.local
127.0.0.1               localhost localhost.my.domain freenas freenas.local
#
# Imaginary network.
#10.0.0.2               myname.my.domain myname
#10.0.0.3               myfriend.my.domain myfriend
#
# According to RFC 1918, you can use the following IP networks for
# private nets which will never be connected to the Internet:
#
#       10.0.0.0        -   10.255.255.255
#       172.16.0.0      -   172.31.255.255
#       192.168.0.0     -   192.168.255.255
#
# In case you want to be able to connect to the Internet, you need
# real official assigned numbers.  Do not try to invent your own network
# numbers but instead get one from your network provider (if any) or
# from your regional registry (ARIN, APNIC, LACNIC, RIPE NCC, or AfriNIC.)
#
127.0.0.1       freenas.local


Does it look like any of my settings are incorrect? Let me know if there is any other data that needs to be seen.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Hi Parks,

Thanks for listing your config files, that saves a lot of questions/time. I don't see anything off the top of my head that looks incorrect. The serviio console can't be run inside the jail, you need to download the windows version and run it there, point it to your jail IP, and then as mentioned in the previous post, set your library path to /usr/local/serviio-0.6.0.1/MEDIA

The other thing with XBMC is that you need to enable UPnP in the setup to get it to find Serviio, it might take a minute or so to scan for it. My guess is that once you run the console and configure the media path it will work for you.
 

parks853

Dabbler
Joined
Jul 26, 2011
Messages
36
Hi Parks,

Thanks for listing your config files, that saves a lot of questions/time. I don't see anything off the top of my head that looks incorrect. The serviio console can't be run inside the jail, you need to download the windows version and run it there, point it to your jail IP, and then as mentioned in the previous post, set your library path to /usr/local/serviio-0.6.0.1/MEDIA

The other thing with XBMC is that you need to enable UPnP in the setup to get it to find Serviio, it might take a minute or so to scan for it. My guess is that once you run the console and configure the media path it will work for you.

I added that path to serviio console in windows. I forced a library update with the console, then looked in the serviio.log and saw the library updates. So I think it is mainly correct. I enabled uPnP in XBMC and never did see it listed.

It is frustrating because it seems to be it is setup correctly as well.

Thanks for your help, nice to have some second eyes.

**EDIT - Does anyone know how to enable debug logging?
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Hi Parks,

Did you figure it out yet? If so, do you have any feedback that might help other users?

You *might* be able to enable debugging by editing (Inside the jail of course) /usr/local/serviio-0.6.0.1/bin/serviio.sh and adding '-DEBUG' to either the OPTIONS or the line that starts serviio, but I'm not sure if that is correct or not.
 

parks853

Dabbler
Joined
Jul 26, 2011
Messages
36
Hi Parks,

Did you figure it out yet? If so, do you have any feedback that might help other users?

You *might* be able to enable debugging by editing (Inside the jail of course) /usr/local/serviio-0.6.0.1/bin/serviio.sh and adding '-DEBUG' to either the OPTIONS or the line that starts serviio, but I'm not sure if that is correct or not.


It is still not working. I'm most likely just going to start over, I've tried everything I know to try. I noticed in the console log that I get these errors:

Error retrieving library update status: communication Error (1001) - Connection refused: connect
Error retrieving library update status: communication Error (1001) - No route to host: connect.

So probably goes the same for XBMC, it can't connect for some reason. I'm not sure if it is a firewall issue or some configuration with the NAS and/or jail.

If I ever figure it out I'll post what I did.
 

parks853

Dabbler
Joined
Jul 26, 2011
Messages
36
according to your help guide /usr/local/serviio-0.6.0.1 should be owner:group admin:admin. When I log into the jail I have it set to admin:admin, but when I'm outside the jail it says the owner is guest. Is that a problem? I don't even has a admin account outside of the jail.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Nope, it's not a problem. It just matters to the processes inside the jail so they have the right permission to execute/write stuff etc.

according to your help guide /usr/local/serviio-0.6.0.1 should be owner:group admin:admin. When I log into the jail I have it set to admin:admin, but when I'm outside the jail it says the owner is guest. Is that a problem? I don't even has a admin account outside of the jail.
 
Status
Not open for further replies.
Top