From ArchWiki
Revision as of 16:13, 15 October 2012 by Modulation (talk | contribs) (Added note for power state actions withouch consolekit)
Jump to navigation Jump to search

XBMC (formerly "Xbox Media Center") is a free, open source (GPL) multimedia player that originally ran on the first-generation XBox, (not the newer Xbox 360), and now runs on computers running Linux, Mac OS X, Windows, and iOS. XBMC can be used to play/view the most popular video, audio, and picture formats, and many more lesser-known formats, including:

  • Video - DVD-Video, VCD/SVCD, MPEG-1/2/4, DivX, XviD, Matroska
  • Audio - MP3, AAC.
  • Picture - JPG, GIF, PNG.

These can all be played directly from a CD/DVD, or from the hard-drive. XBMC can also play multimedia from a computer over a local network (LAN), or play media streams directly from the Internet. For more information, see the XBMC FAQ.


Note: These instructions assume you have a working X installation. If you have not done this yet, please consult Beginners_Guide#Graphical_User_Interface.

The stable version of XBMC is available in the community repo:

# pacman -Syu xbmc

The SVN (testing) version of XBMC can be downloaded from the AUR (XBMC-git), e.g. using yaourt:

$ yaourt -Syua xbmc-git
Warning: This is not the recommended way of using XBMC, as svn versions are always on the bleeding edge of development and thus can break sometimes. If you want a stable media center experience, go with the stable releases.

Starting XBMC

First install D-Bus and add it to your DAEMONS Array if you have not already:

(... dbus ...)

Next, you'll probably want to get ConsoleKit up and running, if you have not already, and add the following line to your .xinitrc:

exec ck-launch-session xbmc-standalone

Make sure you add your user (or whatever user will run xmbc on your system) to at least groups audio, video, and storage.

$ for x in audio video storage; do sudo gpasswd -a $USER $x; done
Note: If you do not run Sudo, simply run the above command as root. You may also need to swap out $USER for another username if you are not logged in as the xbmc user.

Autostarting at Boot

Using the above method, xbmc should run every time you start your X server, so auto-starting at boot can be configured just like a Display Manager, with one important difference. If you choose to use the /etc/inittab method, you can skip loading a display manager altogether and autologin XBMC by default. To do this, change your default runlevel to 5 in /etc/inittab as usual:

## Only one of the following two lines can be uncommented!
# Boot to console
# Boot to X11

Note the comment (#) in front of id:3:initdefault: and not id:5:initdefault. Then, comment out all the default display manager lines at the end of the file:

# Example lines for starting a login manager
#x:5:respawn:/usr/bin/xdm -nodaemon
#x:5:respawn:/usr/sbin/gdm -nodaemon
#x:5:respawn:/usr/bin/kdm -nodaemon
#x:5:respawn:/usr/bin/slim >/dev/null 2>&1

Finally, add this line (toward the end of the file, near where the lines you just commented are):

x:5:wait:login -f <YOUR_XBMC_USERNAME> </dev/tty7 &>/dev/tty7
Warning: There is a security risk using this method. This bypasses login authentication and should only be used if you are sure you know what you are doing!

If you use systemd you can try this:

Description=Direct login to X

ExecStart=/sbin/mingetty --autologin <username> tty7 linux


Also you need install mingetty package.

Save your /etc/inittab changes and add the following to your .bash_profile:

[[ $(tty) = "/dev/tty7" ]] && exec startx </dev/null &>/dev/null

You may also add a .hushlogin to your home directory to further suppress login messages:

touch ~/.hushlogin

ConsoleKit Issues with Automatic Login via /etc/inittab

ConsoleKit is known to have problems registering a session as both local and active when logging in directly via the /etc/inittab method described above. If you would like to be able to shutdown and reboot your machine directly from XBMC while logging in via /etc/inittab, perform the autologin via mingetty (note: this method requires mingetty and upower to be installed). There are two steps involved:

  • 1. Comment out the line x:5:wait:login -f <YOUR_XBMC_USERNAME> </dev/tty7 &>/dev/tty7 from above and, in the consoles section of /etc/inittab, append the following:
c7:2345:wait:/sbin/mingetty --autologin <YOUR_XBMC_USERNAME> tty7 linux
  • 2. Then, in your XBMC user's ~/.bash_profile, include the following (in place of the .bash_profile line indicated above) (source: Arch forums):
[[ $(tty) = "/dev/tty7" ]] && exec xinit ~/.xinitrc -- /usr/bin/X -nolisten tcp vt08 &>/dev/null


Using a Remote

As XBMC is geared toward being a remote-controlled media center, if your computer has an IR receiver, you will probably want to set up a remote using LIRC. Once you are sure your remote is working properly (tested with $ irw), add lircd to your DAEMONS Array and you'll be ready to create an Lircmap.xml file for it.

Using your favorite text editor, you'll need to go in and create an XML file at ~/.xbmc/userdata/Lircmap.xml (note the capital 'L'). Lircmap.xml format is as follows:

  <remote device="devicename">
  • Device Name is whatever LIRC calls your remote. This is set using the Name directive in lircd.conf and can be viewed by running $ irw and pressing a few buttons on the remote. IRW will report the name of the button pressed and the name of the remote will appear on the end of the line.
  • XBMC_button is the name of the button as defined in keymap.xml.
  • LIRC_button is the name as defined in lircd.conf. If you automatically generated your lircd.conf using # irrecord, these are the names you selected for your button then. Refer back to LIRC for more information.
  • You may want to check out the very thorough Lircmap.xml page over at the XBMC Wiki for more help and information on this subject.

Fullscreen mode stretches XBMC accross multiple displays

If you have got a multi-monitor setup and don't want XBMC to stretch accross all screens, you can restrict the fullscreen mode to one display, by setting the environment variable SDL_VIDEO_FULLSCREEN_HEAD to the number of the desired target display. For example if you want XBMC to show up on display 0 you can add the following line to your Bashrc:



If you have problems with shutdown, suspend or hibernate within XBMC make sure your user is in the wheel group and also that the upower package is installed.

In case XBMC was configured to be started outside any session, you need to explicitely give the appropriate rights by creating a polkit rule. Create /var/lib/polkit-1/localauthority/50-local.d/xbmc.pkla with the following contents (assuming xbmc as user running xbmc):

[Actions for xbmc user]


  • XBMC Wiki: An excellent resource with much information about Arch Linux specifically (upon which the original version of this article was largely based).