|
|
Line 54: |
Line 54: |
| {{#lst:OpenELEC|intro}} | | {{#lst:OpenELEC|intro}} |
|
| |
|
| == Autostarting XBMC ==
| | == Installation from source == |
| | |
| There's several ways to start automatically XBMC:
| |
| * [[HOW-TO:Install_XBMC_for_Linux#Upstart_init_script|Upstart script xbmc.conf in /etc/init (short and sweet)]]
| |
| * [[HOW-TO:Install_XBMC_for_Linux#Modify_the_inittab|Modifying the inittab (log winded)]]
| |
| * [[HOW-TO:Install_XBMC_for_Linux#Add_a_new_init_script|Add a new init script]]
| |
| | |
| ===Upstart init script===
| |
| Create a '''<code>/etc/init/xbmc.conf</code>''' with following contents.
| |
| <source lang="xml">
| |
| # xbmc-upstart
| |
| # starts XBMC on startup by using xinit.
| |
| # by default runs as xbmc, to change edit below.
| |
| env USER=xbmc
| |
| | |
| description "XBMC-barebones-upstart-script"
| |
| author "Matt Filetto"
| |
| | |
| start on (filesystem and stopped udevtrigger)
| |
| stop on runlevel [016]
| |
| | |
| # tell upstart to respawn the process if abnormal exit
| |
| respawn
| |
| | |
| script
| |
| exec su -c "xinit /usr/bin/xbmc --standalone -- -nocursor :0" $USER
| |
| end script
| |
| </source><br />
| |
| | |
| {{note|<code> -- -nocursor</code> option '''kills all X cursor''' on XBMC startup and does not interfere with mouse use/operation}}
| |
| | |
| You may have to edit '''<code>/etc/X11/Xwrapper.config</code>''' and replace the last line that says:
| |
| | |
| <source lang="xml">
| |
| allowed_users=console
| |
| </source>
| |
| | |
| to
| |
| | |
| <source lang="xml">
| |
| allowed_users=anybody
| |
| </source><br />
| |
| | |
| XBMC will now auto-start on boot and restart/respawn if killed or crashed.
| |
| | |
| === Modify the inittab ===
| |
| | |
| This was tested on Arch Linux.
| |
| | |
| To automatically start xbmc on your system, do the following:
| |
| | |
| | |
| First you need to make some changes to <code>/etc/inittab</code>. Comment out (add a #) to this line:
| |
| | |
| <pre>
| |
| id:3:initdefault
| |
| </pre>
| |
| | |
| to
| |
| | |
| <pre>
| |
| #id:3:initdefault
| |
| </pre>
| |
| | |
| and uncomment
| |
| | |
| <pre>
| |
| id:5:initdefault
| |
| </pre>
| |
| | |
| Then add this line to the bottom:
| |
| | |
| <pre>
| |
| x:5:wait:login -f <YOUR_XBMC_USERNAME> </dev/tty7 &>/dev/tty7
| |
| </pre>
| |
| | |
| Using wait instead of respawn means that you can exit out of xbmc into the console.
| |
| | |
| | |
| | |
| *NOTE*: This is a security hole as it autologins a dedicated xbmc user without asking for a password!
| |
| | |
| | |
| Now that we have the user logged in we need it to auto start XBMC.
| |
| In <code>~/.xinitrc</code> add the following to the end of the file
| |
| (after removing/commenting any other exec lines that start a windowmanager):
| |
| | |
| <pre>
| |
| exec ck-launch-session xbmc
| |
| </pre>
| |
| | |
| | |
| Add this line to your <code>~/.bash_profile</code>
| |
| | |
| <pre>
| |
| [[ $(tty) = "/dev/tty7" ]] && exec startx </dev/null &>/dev/null
| |
| </pre>
| |
| | |
| | |
| And create a hushlogin file to suppress login messages.
| |
| | |
| <pre>
| |
| touch ~/.hushlogin
| |
| </pre>
| |
| | |
| | |
| Lastly, for the magic sauce that makes this work, add dbus to your daemons in <code>/etc/rc.conf</code>.
| |
| | |
| <pre>
| |
| DAEMONS=(... dbus ...)
| |
| </pre>
| |
| | |
| | |
| You're finished. Next time you reboot you should be greeted with XBMC.
| |
| | |
| === Add a new init script ===
| |
| | |
| This method works well under Debian. The current configuration is a HTPC running Debian Squeeze, with no window manager installed. The main goal here is to start an Xserver only for XBMC. It allows also to specify which user will start / own the XBMC process. This method will '''not work''' if you have a window manager installed (however, it should not be hard to modify the script to suit your needs)
| |
| | |
| *Create a new script under '''/etc/init.d/'''. Call it '''xbmc'''
| |
| *Change the rights, in order to allow it to be executable.
| |
| <pre># chmod a+x /etc/init.d/xbmc</pre>
| |
| *copy the code under in the file. Modify the variables to suit your configuration:
| |
| <pre>#! /bin/sh
| |
| | |
| ### BEGIN INIT INFO
| |
| # Provides: xbmc
| |
| # Required-Start: $all
| |
| # Required-Stop: $all
| |
| # Default-Start: 2 3 4 5
| |
| # Default-Stop: 0 1 6
| |
| # Short-Description: starts instance of XBMC
| |
| # Description: starts instance of XBMC using start-stop-daemon and xinit
| |
| ### END INIT INFO
| |
| | |
| ############### EDIT ME ##################
| |
| | |
| # path to xinit exec
| |
| DAEMON=/usr/bin/xinit
| |
| | |
| # startup args
| |
| DAEMON_OPTS=" /usr/local/bin/xbmc --standalone -- :0"
| |
| | |
| # script name
| |
| NAME=xbmc
| |
| | |
| # app name
| |
| DESC=XBMC
| |
| | |
| # user
| |
| RUN_AS=sterfield
| |
| | |
| # Path of the PID file
| |
| PID_FILE=/var/run/xbmc.pid
| |
| | |
| ############### END EDIT ME ##################
| |
| | |
| test -x $DAEMON || exit 0
| |
| | |
| 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
| |
| ;;
| |
| stop)
| |
| echo "Stopping $DESC"
| |
| start-stop-daemon --stop --pidfile $PID_FILE
| |
| ;;
| |
| | |
| restart|force-reload)
| |
| echo "Restarting $DESC"
| |
| start-stop-daemon --stop --pidfile $PID_FILE
| |
| sleep 5
| |
| start-stop-daemon --start -c $RUN_AS --background --pidfile $PID_FILE --make-pidfile --exec $DAEMON -- $DAEMON_OPTS
| |
| ;;
| |
| *)
| |
| N=/etc/init.d/$NAME
| |
| echo "Usage: $N {start|stop|restart|force-reload}" >&2
| |
| exit 1
| |
| ;;
| |
| esac
| |
| | |
| exit 0</pre>
| |
| *Test the script by trying to start / stop XBMC with it.
| |
| <pre># /etc/init.d/xbmc start
| |
| ........
| |
| # /etc/init.d/xbmc stop</pre>
| |
| *If all is ok, you can add the script to your configuration, by issuing a "update-rc.d"
| |
| <pre># update-rc.d xbmc defaults</pre>
| |
| *If XBMC does not start, you may need to allow X to start from non-consoles. Under Debian/Ubuntu, run:
| |
| <pre># dpkg-reconfigure x11-common</pre>
| |
| and choose "Anyone".
| |
| *You can now reboot the server, XBMC should be started just after the boot sequence.
| |
| | |
| ==Installation from source== | |
|
| |
|
| If distribution packages are not available, or you need a newer version, or specific features enabled, then you will most likely need to compile from source. While compiling from source does not differ very much between distributions (except for installation of build dependencies), a few different guides are available in this wiki. | | If distribution packages are not available, or you need a newer version, or specific features enabled, then you will most likely need to compile from source. While compiling from source does not differ very much between distributions (except for installation of build dependencies), a few different guides are available in this wiki. |
Line 260: |
Line 64: |
|
| |
|
| == See also == | | == See also == |
| * [[HOW-TO:Autostart XBMC for Linux]] | | *[[HOW-TO:Autostart XBMC for Linux]] |
|
| |
|
| {{gotham updated}} | | {{gotham updated}} |
These are instructions for people who already have a Linux-based OS set up. If you have not installed a Linux-based OS yet, you might wish to try out XBMCbuntu which will install both the OS and XBMC with an easy installer.
Official Team XBMC repositories
Ubuntu
- Simple Install Instructions
Note: Click here to find out how to use the terminal.
- Before you run these comands type "sudo echo" into the terminal and hit Enter.
- Then copy the area below up to sudo add...
- Go back to the terminal, hit the middle mouse button and when it prompts hit Enter.
- Copy the part after sudo add... and paste it to the terminal.
- If it askes you if you want to install enter y and hit Enter
sudo apt-get install python-software-properties pkg-config
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:team-xbmc/ppa
sudo apt-get update
sudo apt-get install xbmc
Team XBMC PPA
Frodo is available from Ubuntu 11.10 (Oneiric Ocelot) to 13.04 (Raring Ringtail), you can install from the team-xbmc PPA as follows or replace the ppa with the desired from above.
sudo apt-get install python-software-properties pkg-config
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:team-xbmc/ppa
sudo apt-get update
sudo apt-get install xbmc
XBMCbuntu
XBMCbuntu
Other repositories
Unofficial Linux binaries that are un/semi supported by Team XBMC. These use internal ffmpeg libraries rather than system ffmpeg or libav, which is recommended for XBMC.
Debian
http://balintreczey.hu/blog/xbmc-13-0-gotham-entered-debian/
OpenELEC
OpenELEC
Installation from source
If distribution packages are not available, or you need a newer version, or specific features enabled, then you will most likely need to compile from source. While compiling from source does not differ very much between distributions (except for installation of build dependencies), a few different guides are available in this wiki.
See also