FreeNAS Media Server with PlexMediaServer and Mythtv

Status
Not open for further replies.

mysticpete

Contributor
Joined
Nov 2, 2013
Messages
148
these experiences maybe coming from using 9.3.0 as the base now which was not the original base for the blog, however I did upgrade without a problem.

This post is probably not relevant now as others have perfected getting mythtv to work also.
 

nello

Patron
Joined
Dec 30, 2012
Messages
351

nello

Patron
Joined
Dec 30, 2012
Messages
351
This post is probably not relevant now as others have perfected getting mythtv to work also.

Yours was/is the best tutorial I could find for installing MythTV on FreeNAS.

Do you have a link to a tutorial tailored to FreeNAS 9.3?
 
Last edited:

nello

Patron
Joined
Dec 30, 2012
Messages
351
I'm trying to install MythWeb following these instructions:

https://github.com/MythTV/mythweb/blob/master/INSTALL

Which web server I should use:
  • Apache
  • Lighttpd
  • Nginx
More specifically, is one of these part of the base installation of a Jail? Can I use something that's already installed, or do I have to install my own?



UPDATE 5-Mar-2015

Apparently, no web server is installed in the Jail's base system. I installed Apache since that seems to be what most people are using with mythweb. But just to push the envelope, I installed the latest versions of Apache, MySQL, and PHP:
Code:
root@mythtv:/ # pkg upgrade
root@mythtv:/ # pkg install apache24 mysql56-server php56



Well, I think that'll work. But I actually followed these instructions for building a web server in a Jail:
Code:
root@mythtv:/ # portsnap fetch update
root@mythtv:/ # cd /usr/ports/www/apache24/
root@mythtv:/ # usr/ports/www/apache24 # make install clean
root@mythtv:/ # usr/ports/www/apache24 # cd /usr/ports/databases/mysql56-server/
root@mythtv:/ # usr/ports/databases/mysql56-server # make install clean
root@mythtv:/ # usr/ports/databases/mysql56-server # cd /usr/ports/lang/php56
root@mythtv:/ # usr/ports/lang/php56 # make install clean
root@mythtv:/ # usr/ports/lang/php56 # cd /usr/ports/lang/php56-extensions
root@mythtv:/ # usr/ports/lang/php56-extensions # make install clean
root@mythtv:/ # usr/ports/lang/php56-extensions # cd /usr/ports/www/mod_php56
root@mythtv:/ # usr/ports/www/mod_php56 # make install clean





UPDATE 8-Mar-2015

I've spent over a week trying to get mythweb working.

My problem was that the mythweb.php produced a nearly blank page. The path for several links contain skin_url and skin_urlimg reflecting the names (not values) of respective PHP definitions. Based on this MythTV closed bug report, I realized that there's nothing in this tutorial that actually starts myth's backend service!

The fix is:
Code:
root@mythtv:/ # service mythbackend start
 
Last edited:

nello

Patron
Joined
Dec 30, 2012
Messages
351
root@mythtest:/ # cd /usr/ports/audio/lame && make install clean


I'm starting over (again) with a fresh Jail and was reminded to document this minor gottcha:
Code:
root@mythtv:/ # cd /usr/ports/audio/lame && make install clean
===> lame-3.99.5_2 pkg(8) must be version 1.3.8 or greater, but you have 1.3.7.
You must upgrade the ports-mgmt/pkg port first.
*** [install] Error code 1

Stop in /usr/ports/audio/lame.
root@mythtv:/usr/ports/audio/lame #



The fix is:
Code:
root@mythtv:/ # pkg upgrade


 
Last edited:

mysticpete

Contributor
Joined
Nov 2, 2013
Messages
148
I never did a specific for 9.3 sorry. Myth web is a bit of a bugger to get working, I would agree on that for sure!
 

nello

Patron
Joined
Dec 30, 2012
Messages
351
A word about pkg-ng commands

Now let's get started....

This discussion about pkg-ng vs pkg_add vs pkg add, etc. is a bit confusing for noobs (like me).

Apparently it is relevant only to pre-9.3 FreeNAS installations and as time goes on this will be a declining audience.

You might want to consider adding a note saying that the section can be skipped for installations later than 9.3. Even better would be a note to users of pre-9.3 installations to read this material at the end of your tutorial.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Technically, since the old pkg system repos haven't been updated in 8+ months the *only* system that is valid to discuss on any system is pkg-ng.
 

nello

Patron
Joined
Dec 30, 2012
Messages
351
Technically, since the old pkg system repos haven't been updated in 8+ months the *only* system that is valid to discuss on any system is pkg-ng.

Let me put it this way: In the entire tutorial, pkg-ng is never used. Consequently, I don't understand the need for these several paragraphs of text that discuss it.

I'm just saying that I don't understand it. I'm looking forward to understanding it. Please enlighten me.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
In short, the old pkg repos were abandoned in aug 2014. So anyone wanting to install stuff with pkg should instead use the pkg-ng.

There is a lot that is hidden in the details of what I just said above, so you'll need to do your own research. The guide looks to use pkg-ng. Stuff like this guide can't always be cookbooked. So you may have to understand all the stuff that the guide says to do and actually verify that it works properly with the current packages.
 

mysticpete

Contributor
Joined
Nov 2, 2013
Messages
148
Guys, Come ON! I have no intention of keeping this up to date, like Cyberjock said above I have tried to incorporate the latest commands set BUT some of this stuff is not as simple as a pkg add or may have not have been generally available at the time or now even, YOU just have to do your own research if it does not work first time now, I'm happy for you to update this page with your findings.....

..... But I would suggest that if you have a totally new way of installing this successfully then I would suggest writing up your own post.

I have only upgraded to 9.3 and never did a clean install, so I don't know what is different now, only that it was all still working when I upgraded to FreeNas 9.3.x
 

Allan_Guy

Dabbler
Joined
Feb 20, 2015
Messages
19
I seem to always get stuck with SSH tunneling. So, I started from scratch just trying to get this working first before MythTv or any other installs

FreeNAS-9.3-STABLE-201412090314
Code:
Create Jail called MythTvJail 192.168.1.3
pkg install sshd
service sshd start #So it creates a /etc/rc.conf file
echo 'sshd_enable="YES"' >> /etc/rc.conf
echo 'ListenAddress 192.168.1.3' >> /etc/ssh/sshd_config
echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config
echo 'PasswordAuthentication yes' >> /etc/ssh/sshd_config
echo 'X11Forwarding yes' >> /etc/ssh/sshd_config
echo 'X11UseLocalhost no' >> /etc/ssh/sshd_config
echo 'Port 22' >> /etc/ssh/sshd_config
/usr/bin/ssh-keygen -A #So it generates missing keys
service sshd restart #Service Starts
with ee /etc/rc.conf #verified changes are there
with ee /etc/ssh/sshd_config #verified changes are there



Xming running in background - Windows 7 Enterprise

Putty Configuration:
Session Host Name 192.168.1.3 & Port 22
Connection/SSH Check enable compression
Connection/SSH/X11 Check Enable X11 forwarding & x display location localhost:0 & Protocol MIT-Magic-Cookie-1

Press Open
login as root
Using keyboard-interactive authentication.
Password for root@MythTvJail: #enter my root password
Access denied

Am I missing something? Why can't I login as root?

Also, I notice that if I follow the detailed instructions http://mysticpete.blogspot.com.au/2014/03/create-media-server-hosting-freenas.html
Note: I ran pkg update & pkg upgrade to get lame to install. When you run pkg install mysql55-server it removes stuff you just installed earlier. One example is the /usr/local/share/mythtv/database/mc.sql
If you rerun pkg install mythtv, the mc.sql is back, then rerun the pkg install mysql55-server and poof it is gone again. :)

Installed packages to be REMOVED:
mythtv-0.27.0.20140121_6
qt4-mysql-plugin-4.8.6
py27-MySQLdb-1.2.3_4
p5-DBD-mysql-4.031
mysql56-client-5.6.23

New packages to be INSTALLED:
mysql55-client: 5.5.42
mysql55-server: 5.5.42

The Probable Fix - Because the bundled client was mysql56, I tired
pkg install mysql56-server and that worked without removing items...

Now I'm stuck on
root@MythTvJail:/ # mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql
ERROR 1406 (22001) at line 32211: Data too long for column 'Abbreviation' at row 1
Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.
root@MythTvJail:/ #
I'm off to bed, tomorrow is another day! Thanks in advance on any help...
 

nello

Patron
Joined
Dec 30, 2012
Messages
351
By default the mythbackend runs as root. However, after following this tutorial, my user job is running as mythtv. Perhaps I did something to cause this inconsistency, but I don't know what it was.

In any case, unless both mythbackend and user jobs run under the same user, there are ownership/permission problems with any user job script that tries to modify the recordings, e.g., delete it.

My solution was to edit /usr/local/etc/rc.d/mythbackend to change mythbackend to run as mythtv.


UPDATE 2015.06.04

After changing the mythbackend user to mythtv, the daily mythfilldatabase run did not update my schedule and there were no obvious errors in the log. Apparently, the problem was that mythtv did not have access to overwrite /tmp/mythtv_ddp_data. The solution was to delete /tmp/mythtv_ddp_data and run mythfilldatabase manually from the mythtv user. Thereafter, the updates ran correctly.

For details, see: the topic mythfilldatabase not updating? on the MythTV troubleshooting forum.
 
Last edited:

avalon60

Guru
Joined
Jan 15, 2014
Messages
597
I have been following this guide and have now got an errors from the cmd line I have been copying and pasting into mythtv shell.

This is the error:
root@mythtv:~ # sh -Y root@192.168.0.7 /usr/local/bin/mythtv-setup
Illegal option -Y

What went wrong here, as the ip address I used is the mythtv IP address given by FreeNAS

Also here:
With the Xming server started, open the PuTTY session you saved and login (with the user you created earlier) to the myth server.

I have installed both Putty and Xming on my laptop which is connected to my local network by cable
Where or how do I login to the myth server
 
Last edited:

nello

Patron
Joined
Dec 30, 2012
Messages
351
I have been following this guide and have now got an errors from the cmd line I have been copying and pasting into mythtv shell.

This is the 2nd error:
root@mythtv:~ # sh -Y root@192.168.0.7 /usr/local/bin/mythtv-setup
Illegal option -Y

What went wrong here, as the ip address I used is the mythtv IP address given by FreeNAS

Looks like you are running this command from the myth root on your FreeNAS server.

This command is supposed to be run from a X-Windows client on you PC or Mac.

See https://forums.freenas.org/index.ph...diaserver-and-mythtv.19131/page-2#post-181455

If you are using a Mac, see also: https://forums.freenas.org/index.ph...diaserver-and-mythtv.19131/page-2#post-181044
 

avalon60

Guru
Joined
Jan 15, 2014
Messages
597
Thanks but how or where do I enter the said cmds on theXming server.
I have just opend X Launch, and do I have to set any parameters there.

Ok, I managed to get a X Window up with the ip address I set for mythtv, but now I cannot login as root.
 
Last edited:

nello

Patron
Joined
Dec 30, 2012
Messages
351

B34N

Dabbler
Joined
Jul 6, 2014
Messages
32
I hate to bring back an old thread but I've been unable to locate anything newer on MythTV in a jail. Did any of you get Myth running nicely on 9.3 in a jail? I'm looking to move my very old MythTV install from a separate box to a jail in FreeNAS.

If you have some good starting points, it might be good to start a new thread so that others can benefit as well.
Since my orignal post I did find and start the instructions at http://gavowen.ninja/?p=102 It's still a work in progress. I seemed to get through the steps./ I'm not sure it I should put in the jails IP address or a loopback address for the backend server. I also don't have MythWeb setup to be sure it's running nor do I know how to get mythtv backend to run automatically in the jail
 
Last edited:
Status
Not open for further replies.
Top