2008-06-05, 20:58
For those of you who want to run XBMC so it autoloads without a desktop manager here's a simple solution. I did this on Ubuntu hardy heron using the gnome login so slight modifications might be necessary to get it going on a different setup.
I used gksudo and nautilus to do this all from the gui because my linux is really rusty and I've found it works really nicely. For those that don't know how to do this. You might have to install gksu first. Then hit Alt-F2 and type gksudo nautilus then enter your password. This will run nautilus as root allowing you to do all of this.
Step 1: Create Load script:
This is only necessary if you want to use projectM. Create a new file in /usr/bin/ named loadxbmc (right click and select Create Document / New File). Then open it and paste in the following code:
Save it and close it. Then set the file as executable (right click / select Properties / select the Permissions tab / click the Allow executing file as program check box)
Step 2: Create Session type:
Go to /usr/share/xsessions/ I just copied the GNOME launcher here and renamed it to XBMC. The I right clicked and selected properties. Then on the launcher tab I changed the Command field to: /usr/bin/loadxbmc and the Comment field to This session logs you into XBMC.
Step 3: Create a new account.
Go to System / Administration / Users and Groups. Hit the unlock button and enter your password. Now hit Add User. Enter in a user name I used xbmc and a real name I used XBMC then enter a password. If you want click on user privileges and set them how you choose. When your done click OK and then Close.
Step 4: Login to the new xbmc account and configure
Now login to xbmc and set xbmc to run fullscreen. Then go to System / Administration / Login Window click the Security tab. Check enable automatic login and choose the xbmc account. Then click Close.
Step 5: Logout and set the session type for xbmc.
Logout and from the login screen set the session type for the xbmc account to XBMC and login when it asks tell it to make it the default session.
Now when you turn the macine on it will boot into X and autologin to the xbmc account which is running xbmc instead of gnome. When you shutdown XBMC you mare taken out to the login screen where you can login as another user or change the session type for the xbmc account for maintenance. Now if only xbmc had two different shutdowns one to exit the program which would be a logoff and one to shutdown the machine then the box could function as just a media center with no need to use a mouse or keyboard, and still have a fully working gnome setup available when you want it.
I used gksudo and nautilus to do this all from the gui because my linux is really rusty and I've found it works really nicely. For those that don't know how to do this. You might have to install gksu first. Then hit Alt-F2 and type gksudo nautilus then enter your password. This will run nautilus as root allowing you to do all of this.
Step 1: Create Load script:
This is only necessary if you want to use projectM. Create a new file in /usr/bin/ named loadxbmc (right click and select Create Document / New File). Then open it and paste in the following code:
Code:
export XBMC_HOME=/usr/share/xbmc
xbmc
Step 2: Create Session type:
Go to /usr/share/xsessions/ I just copied the GNOME launcher here and renamed it to XBMC. The I right clicked and selected properties. Then on the launcher tab I changed the Command field to: /usr/bin/loadxbmc and the Comment field to This session logs you into XBMC.
Step 3: Create a new account.
Go to System / Administration / Users and Groups. Hit the unlock button and enter your password. Now hit Add User. Enter in a user name I used xbmc and a real name I used XBMC then enter a password. If you want click on user privileges and set them how you choose. When your done click OK and then Close.
Step 4: Login to the new xbmc account and configure
Now login to xbmc and set xbmc to run fullscreen. Then go to System / Administration / Login Window click the Security tab. Check enable automatic login and choose the xbmc account. Then click Close.
Step 5: Logout and set the session type for xbmc.
Logout and from the login screen set the session type for the xbmc account to XBMC and login when it asks tell it to make it the default session.
Now when you turn the macine on it will boot into X and autologin to the xbmc account which is running xbmc instead of gnome. When you shutdown XBMC you mare taken out to the login screen where you can login as another user or change the session type for the xbmc account for maintenance. Now if only xbmc had two different shutdowns one to exit the program which would be a logoff and one to shutdown the machine then the box could function as just a media center with no need to use a mouse or keyboard, and still have a fully working gnome setup available when you want it.