XBMC server mode in unraid


Recommended Posts

so, i have been doing a lot of reading lately about running xbmc in a headless manner:

 

http://forum.xbmc.org/showthread.php?tid=132919&pid=1262063#pid1262063

 

http://lime-technology.com/forum/index.php?topic=11473.msg207577#msg207577

 

has anyone successfully gotten this to work on unraid?

i'd really like to get an xbmc headless plugin going for unraid so that sickbeard can have it update the library.

Link to comment
  • Replies 80
  • Created
  • Last Reply

Top Posters In This Topic

Okay, you posted while I was typing my reply, but I'll let it stand as is:

 

Indeed, it's not clear what you hope to achieve by running xbmc on the server.

 

I run OpenELEC media boxes - all the movies, the database, the thumbnails etc. are all stored on a shared central resource on the unRAID server - I even boot from unRAID via PXE (network) boot.

 

My OpenELEC boxes don't have any local storage - no drives, not even a flash drive.  If I perform a library update, the library is automatically updated for all boxes.  Sometimes I will perform a library update without turning a TV on, by running XBMC on a desktop computer.  If I stop watching a movie, part way through, on one box, I can go to another one and it will automatically continue from where I stopped on the first box.

 

My boxes are running the same hardware, so if I update the OpenELEC version on the server, all boxes are updated automatically.

 

So, the question, again, is: What are you trying to achieve - anything I cannot do?

Link to comment

So the only thing you hope to achieve is that the library will be updated without manual intervention?  I always run the library update by by hand but, as I say, I do this on any box, even a desktop computer.  Doesn't xbmc have an option to run the library update on a periodic basis and/or on system startup ... would this not be sufficient for your needs?

Link to comment

I know XBMC has an interval update but it won't work for my purposes. Manual update also takes too long. My last response I did via mobile so I didn't want to type that much. Let me elaborate.

 

I have my unraid server with sabnzbd, sickbeard, couchpotato, etc. I also have a raspberry pi running openelec, just the one for now. I have a centralized MySQL database for it also on the server. I've tried using auto scan library stuff for XBMC but it still will frequently update the library at the worst times or it will not be updated and I have to manually update and wait for it. Sickbeard does have an option to notify XBMC of an update when it completes a download but my HTPC isn't always on so nothing happens. Having a headless mini install of XBMC on my unraid will solve this and allow it to be updated instantly through sickbeard.

 

This is essentially the reason everyone that is looking into a headless mode wants it; to have a lite xbmc instance along-side MySQL solely for updates. I was thinking about trying to compile it and try this myself, but I wanted to see if anyone here has any experience doing so, particularly on unraid. Then if I can get that to work, maybe attempt a plugin.

Link to comment

So are you saying your only HTPC is a raspberry pi? If it is why would you ever bother to shut it off? It should only cost you $1.50 a year to run 24/7. Even if its not your only HTPC, just leave it running and use that to update your library. The additional CPU overhead of running XBMC on unraid will likely cost you the same or more per year in electricity costs as just leaving the raspberry pi running all the time.

Link to comment

What if you ran ESX and ran an XBMC virtual machine?

 

i could but that seems like alot of unnecessary extra work what im looking to achieve.

 

i am going through that really long thread and will try it out myself. what others have done which is build libxbmc.so and wrapped it with a small app to call a library scan. there are other unraid owners in that thread looking for the same thing as well. maybe some of them have tried it.

Link to comment

Having a headless library managing XBMC running on unRaid has its merits even if it is not a fit for everyone. I for one would like to keep up with your progress. If it goes well, maybe I can talk to the other devs about featuring it on the hompage.

 

lol, well, don't get too excited just yet. being only proficient in linux and especially in regards to slackware, there is a fair chance this could take a long while.

Link to comment

Very interested in you progress with this. I too would like my unraid box to update the mysql internally. Having media + database central but having to use an external source to update the database isn't as elegant as it should be.

 

Is it possible to build the xbmc server package on one unraid box will all the required packages to build. Then move that built package to another unraid box and install only the required packages to run the built package?

 

One of the main reasons I have considered to got to EXSi is due to being able to run xbmc server. But I would have to replace basically everything I own to do so. Which is a lot more money then I'm prepared spend, just to have xbmc update it self.

 

Currently have sickbeard/couchpotato setup to WOL my zbox preform the update and then zbox is set to go back to sleep in 15mins. All the other boxes just read the mysql database as they should. This setup actually works quite well. But I can completely understand the OP, as slower devices (hell even the zbozx with a USB) are slow to update the database and can also cause the UI to react slower. If you have one more powerful box then the rest then have that setup to do the updates as it have the least impact.

Link to comment
One of the main reasons I have considered to got to EXSi is due to being able to run xbmc server. But I would have to replace basically everything I own to do so. Which is a lot more money then I'm prepared spend, just to have xbmc update it self.
So run virtualbox inside of unraid and have your xbmc machine run as a virtualbox machine. No hardware changes needed, and with lainie's work on virtualbox, it's become pretty much a click and download proposition. I have a minecraft server vm, a mythbuntu vm, and a windows xp vm all running constantly, and several more vm's that I start on demand and suspend when I'm done with them.
Link to comment

Another advantage of running xbmc on unraid is for upnp.

 

There have been a lot of improvements in upnp support in xbmc lately. And it is expected to replace mysql in the near future. But with upnp, one master htpc has to be on for others to access to the library. I am not a fan of leaving an htpc on 24/7 with xbmc running as xbmc uses really high cpu utilization when it displays the menus (due to constant rendering of the menus in 60Hz). The headless xbmc does no such thing and has a very small footprint.

 

That approach would be more similar to plex, but with all the glory of xbmc

Link to comment
There have been a lot of improvements in upnp support in xbmc lately. And it is expected to replace mysql in the near future. But with upnp, one master htpc has to be on for others to access to the library.

 

I hadn't heard of these plans before.  If XBMC (and OpenELEC?) really do abandon SQL in favour of uPNP, I will be looking for a new solution.

Link to comment

well i'm getting close. i got everything built but the issue is i can't get it to run. if someone in the know could help me out id appreciate it. ive been following this guide:

 

http://forum.xbmc.org/showthread.php?tid=132919&pid=1262063#pid1262063

 

i skipped this part:

cd /etc/init.d
sudo wget https://dl.dropbox.com/u/20980813/xbmc-server
sudo chmod 744 xbmc-server
sudo update-rc.d xbmc-server defaults

 

because a) the command wasnt found in slackware and b) i think i only need it to start xbmc on start up, which i dont want to do anyway.

 

i then did:

sudo service xbmc-server start

 

but 'service' is also not available for slackware. i tried to start the xbmc-server init script manually but it uses the 'start-stop-daemon' to start xbmc which, surprise, is not available on slackware. so thats where i'm at. any ideas?

 

here is the relevant section of the init script:

 

DAEMON=/usr/local/sbin/xbmcserver/xbmc-server
DAEMON_OPTS=" --no-test --nolirc -p"

# script name
NAME=xbmc

# app name
DESC=XBMC

# user
RUN_AS=xbmc

# Path of the PID file
PID_FILE=/var/run/xbmc.pid

set -e

case "$1" in
  start)
        echo "Starting $DESC"

        start-stop-daemon --start -c $RUN_AS --background --pidfile $PID_FILE  --make-pidfile --exec $DAEMON -- $DAEMON_OPTS
        ;;

 

when i try to manually run:

 

/usr/local/sbin/xbmcserver/xbmc-server --no-test --nolirc -p"

 

i get:

bash-4.1# /opt/xbmc-server/xbmc-server --no-test --nolirc -p
XBMC Media Center 13.0-ALPHA4 Git:20130502-83ac119
Copyright (C) 2005-2011 Team XBMC - http://www.xbmc.org

Starting XBMC Server

ERROR: Unable to create application. Exiting

Link to comment

The first two bits you posted didn't work because those are commands for Debian/Ubuntu. You'd want to download the init script to /etc/rc.d/ and rename it to rc.xbmc-server. To start the service you'd just type "/etc/rc.d/rc.xbmc-server start" sudo isn't necessary since you're already root in the telnet session.

 

As for the XBMC crashing bit, look in the logs, wherever it creates them. See what it says happens when it crashes. You're probably missing some dependencies. The logs may tell you what are missing so you can load them.

Link to comment

The first two bits you posted didn't work because those are commands for Debian/Ubuntu. You'd want to download the init script to /etc/rc.d/ and rename it to rc.xbmc-server. To start the service you'd just type "/etc/rc.d/rc.xbmc-server start" sudo isn't necessary since you're already root in the telnet session.

 

As for the XBMC crashing bit, look in the logs, wherever it creates them. See what it says happens when it crashes. You're probably missing some dependencies. The logs may tell you what are missing so you can load them.

 

right, i know all that. the issue is the init script starts the service using start-stop-daemon, which is an ubuntu/debian command. so i made an assumption about how to start it without that command, based on the script, and i dont know if xbmc failing to start is because my assumption is wrong or something else like a dependency issue. i did look in the logs, although i only took a cursory glance. i didnt see anything but i will take a better look.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.