• 1(current)
  • 2
  • 3
  • 4
  • 5
  • 7
Linux HOW-TO make XBMC for Linux auto start on Ubuntu
#1
Thumbs Up 
I built a media centre PC specifically to run XBMC on Linux. I'm using the PPA's on Hardy Heron (8.04). Since this box is only going to run XBMC, I thought I'd get it to power up, log in and fire up XBMC automatically.

Keep in mind that these steps are for Ubuntu. Other distro's may differ.

Login as the user who installed XBMC. I find it easier to do all this from my laptop, ssh'd in to the XBMC box.

Using your favourite editor, create a file in your home directory called .xinitrc that contains the following:
Code:
#!/bin/bash
exec /usr/bin/xbmc --standalone

Make .xinitrc executable:
Code:
chmod +x .xinitrc

Edit your .bashrc and add the following as the last line:
Code:
startx

Install rcconf:
Code:
sudo apt-get install rcconf

Run rcconf and turn off gdm:
Code:
sudo rcconf

Install mingetty:
Code:
sudo apt-get install mingetty

Edit /etc/events.d/tty1:
Code:
sudo vi /etc/events.d/tty1

Change the line:
Code:
exec /sbin/getty 38400 tty1
to read:
Code:
exec /sbin/mingetty --autologin uname tty1
where uname is the user who installed XBMC.

Reboot to test.

With this setup, you're not loading gdm or gnome. You're not loading a window manager. The load will be lighter and the boot process will be faster.

Please let me know if there are any questions! Thanks to AlTheKiller for some pointers.
Reply
#2
great howto. this would be great in the wiki. ask pike for ninja status if you'd like to contribute it and you need write access.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#3
Reply
#4
Forgive me for being a linux noob, but where should the first file you create (.xinitrc) be located?
Reply
#5
The .xinitrc file should be in your home directory. I'll clarify that...
Reply
#6
Anyone know what to check to find out why I lose my sound when I set XBMC to autostart? The sound works if i go back to gdm.
Reply
#7
Try renaming your .xinitrc to off.xinitrc (mv .xinitrc off.xinitrc). Reboot the system. You should wind up in a terminal logged in as your XBMC user. Run alsamixer and see if all the sound points are turned on.

To restore XBMC startup, mv off.xinitrc .xinitrc and reboot again.
Reply
#8
My Ubuntu auto logs me in (mythbuntu). This is the default file that starts MythTV. Easy to change it to start XBMC..

~/.config/autostart/mythtv.desktop
Code:
[Desktop Entry]
Name=MythTV Frontend
Comment=A frontend for all content on a mythtv-backend
GenericName=MythTV Viewer
Exec=mythfrontend --service
Type=Application
Encoding=UTF-8
Icon=/usr/share/mythtv/themes/blue/myth_tv_logo.png
Categories=GNOME;Application;AudioVideo;Audio;Video
X-AppInstall-Package=mythtv
Reply
#9
Hi there
Great Howto, thats exactly how i solved this problem, before there was this howto.

But what happens if you press the Off Button on the remote or shuts it down via menu?
Here it quits xbmc but stays in X?!

Anyone knows a solution for that?

THX
Chaos
Reply
#10
MrCerulean Wrote:Try renaming your .xinitrc to off.xinitrc (mv .xinitrc off.xinitrc). Reboot the system. You should wind up in a terminal logged in as your XBMC user. Run alsamixer and see if all the sound points are turned on.

To restore XBMC startup, mv off.xinitrc .xinitrc and reboot again.

Thanks, I booted to terminal and found out that my user 'xbmc' was not a member of the 'audio' group.

I did: sudo adduser xbmc audio

Restarted and everything works as advertised.
Reply
#11
Covert: Yes, but the point to the howto is starting XBMC without gdm or a window manager or a desktop environment--in other words, the minimum required X setup.
Reply
#12
Thanks for the clarification. I've been hoping someone would post an easy way to do this. Works like a charm!
Reply
#13
MrCerulean. I only scanned over our post and completely missed the fact it does not use a manager. Are you able to edit the title for clarification ?
Reply
#14
Thumbs Up 
Who is this for: If you run Ubuntu that boots into Xorg and you want xbmc to auto start every time. This should work for most Ubuntu desktop installs. This is the most basics of howto's and should be new user friendly.

Note: If you auto login then you will not need to do anything but turn the system on. Very WAF.

Step 1. Get into a terminal. Either by ssh (log in as needed) or selecting Application->Accessories->Terminal from the menu.

Step 2. Change to your home directory.
Code:
cd ~

Step 3. Now change to the auto start directory for this user.
Code:
cd .config/autostart
Output should look like this
[email]user@computer:~/.conf[/email]ig/autostart$

Step 4. Launch a text editor to edit xbmc.desktop
Code:
nano xbmc.desktop

Steop 5. Copy and paste the following into the xbmc.desktop file and save.
Change the Exec command as needed. ~ means your home directory. So ~/.xbmc is the same as /home/yourusername/.xbmc
Code:
[Desktop Entry]
Encoding=UTF-8
Version=Beta2
Type=Application
Name=Launch XBMC on startup
Comment=XBMC will run every time this user logs in.
Exec=~/.xbmc/xbmc.bin
StartupNotify=false
Terminal=false
Hidden=false

Note: shift-ins for paste

Done.
Reply
#15
Or just go to session, and make a new entry. Browse to the binary. And it will start when you login or have autologin

--
/t
Reply
  • 1(current)
  • 2
  • 3
  • 4
  • 5
  • 7

Logout Mark Read Team Forum Stats Members Help
HOW-TO make XBMC for Linux auto start on Ubuntu5