[Ubuntu] Separate XBMC session at boot
#1
I am trying to have my HTPC boot into XBMC automatically, while also having a display manager active in a separate session (LightDM for example).

This way, turning the HTPC on is enough to be XBMC-ready. But I want to be able to do Ctrl+Alt+F10 (or whatever), login, and do dekstop stuff.

You can choose an XBMC session during login, no problem. You can make it auto-start by editing /etc/lightdm/lightdm.conf into something like:
Code:
[SeatDefaults]
autologin-user=xbmc
autologin-user-timeout=0
user-session=xbmc
greeter-session=unity-greeter

But how do I simultaneously launch that second session or desktop manager?

I have searched my 'behind' off for the proper way to do this, and after missing my lunch and hating google for not being what it used to be, I learned that it was relatively easy in inittab using pts respawns. There has been much much much much much much much much much much much much much much much much much much much discussion about the topic. But ofcourse, for Ubuntu, inittab is replaced by upstart.

I couldn't find anything relevant on google and I read through the lot of the rc.x (upstart) files. Even the /etc/X11/Xsession scripts, but I cannot find out how to do this trick.

Ofcourse, we all know this startx -- :1 stuff that was kind of nerdish cool back when, but having xbmc launch autoexec.cfg to launch a shellscript to launch a new Xsession is ugly and unacceptable, if possible at all.

Is there a clean and proper way to just have them two sessions?
Try Xubuntu. It's the new Ubuntu.
Reply
#2
Hi,

I am just working on the same problem using ubuntu 11.10 and wanting alt+f8 to have an autologin xbmc session.

Here is what i found so far (not mine doesnt work yet, but I beleive that is due to the fact that no xbmc seesion has been created yet.. Currently trying to find out how to do that)

Ubuntu 11.10 uses LightDM as a session manager not gdm3. Therefore you will have to edit the /etc/lightdm/lightdm.conf file.

Any setting that you will make in [seats] will override the default.

[LightDM]
seats=Seat:0 Seat:1 <-- two guis
...
[Seat:0] <-- first one
user-session=ubuntu
autologin-user=
(unity, etc)
[Seat:1] <-- second one
autologin-user=
user-session=xbmc


while for unity, you will continue to use the unity greeter, xbmc supposedly work with lightdm-gtk-greeter.

Maybe that helps you in your endevour.
Reply
#3
wow - old post
Reply
#4
No.. no no no, not old. Not even a month. I am happy that I finally got a reply notification! Big Grin

I will test it when I have the chance. Please keep me posted if you got it working or encounter additional problems!
Try Xubuntu. It's the new Ubuntu.
Reply
#5
Wow, that went smoothly. I thought I had to fight hours of random problems, but it.. just works. Thanks for pointing me in the right direction!

You might want to change the session caps though, if you look at xsession filenames. I assume they are case sensitive just like the rest of Linux.

This is my lightdm.conf. It will start XBMC and have normal LightDM under F8.

Small detail, I would like to hide the user mc from Seat1, but only from Seat1, so users.conf is not an option.

Code:
[LightDM]
seats=Seat:0 Seat:1

[SeatDefaults]
greeter-session=unity-greeter
user-session=GNOME
xserver-allow-tcp=true

[Seat:0]
# Media Center - focussed on boot
vt=7
autologin-user=mc
autologin-user-timeout=0
user-session=XBMC
# Make XBMC start on exit - there is no escape, ever.
greeter-hide-users=true
allow-guest=false
xserver-allow-tcp=false

[Seat:1]
# Optional login on Ctrl+Alt+F8
vt=8

[XDMCPServer]
enabled=true
xdmcp-port=177
Try Xubuntu. It's the new Ubuntu.
Reply
#6
Wait.. if XBMC is in the first session, playback does not work.
On playback, XBMC exits and restarts. Whaat?
Try Xubuntu. It's the new Ubuntu.
Reply
#7
I'm very interested in this little project you have going on here. What I'm trying to do is start up my computer and it load straight into XBMC within 11.10 with the option of being able to exit out of XBMC or otherwise logout and end up at the login screen so I can log into my normal desktop account.

What you're working at here would be the perfect solution for me. However, no matter what I do, I can't get XBMC to launch on its own once the xbmc user account is logged into. My computer boots up and logs right into my xbmc user account, but the XBMC application never launches despite the little settings and files I've edited from a handful of tutorials.

If you can walk me through what you did to get where you are I would be thrilled to duplicate your settings and see if playback on my machine doesn't work, either. If you don't have that sort of time or patience then I can wait for help in the thread I posted about my issues and see if I can mirror your setup and maybe I can still let you know if I'm having playback issues.

Regardless, I'm excited to see if this method works out.
Reply
#8
I'd be happy to help you out, but like I said in the post above you, there is still this 'little' problem where xbmc starts but playback fails for some reason using this method. Maybe it's the build, maybe hardware specific. Maybe no problem for you. But if I get your xbmc start going, maybe you can help figure out that 'little' problem.

I'll get back to you, need to finish something first.
Try Xubuntu. It's the new Ubuntu.
Reply
#9
check the xbmc.log. Seems you are running unity(compiz) on seat1, which possibly blocks opengl.
Maybe try unity-2d
Reply
#10
@twalbaum: Sorry about that, something came up.

I've rethought the steps and actually it's so straightforward that I don't really see what problems you have. So let me just explain the steps.

1. Every desktop environment comes with it's own session in /usr/share/xsessions/. Those are .desktop files so you can only see the file names in a terminal.

Ubuntu comes with Ubuntu and Ubuntu-2d (which are Unity). You get additional xsessions when you install for example Gnome or XFCE. You also get an xsession for XBMC when you install a recent version of for example XBMC Eden beta. Make sure your version of XBMC came with its own xsession.

2. You can choose a default xsession in your Desktop Manager (LightDM by Ubuntu default) by clicking the little gear on the top-right of your user name and see the available xsessions. Here's mine:

Image

Make sure the XBMC xsession is available.

3. Change /etc/lightdm/lightdm.conf to reflect the login behavior you wish. In your specific case, you seem to not want a separate xsession at all. You just want xbmc to auto-start, and go back to LightDM on quit. That's easier, you don't need any seats at all.

My guess is this would work for you:

/etc/lightdm/lightdm.conf
Code:
[SeatDefaults]
# Default greeter for LightDM
greeter-session=unity-greeter
# Use your Media Center user name here!
autologin-user=mc
# Login immediately - I THINK you need to have a passwordless login. I do.
autologin-user-timeout=0
# Use the XBMC.desktop xsession to start xbmc-standalone
user-session=XBMC
# Display user list on quit
greeter-hide-users=false
That's all, so don't use any of the other [Blah] stuff.

The last xsession is always remembered on next login, so I suggest you make a separate user for desktop work, because:
1) You don't have to change your session from XBMC to e.g. Gnome all the time.
2) You can password-protect you non-mediacenter user for privacy purposes.



@wsnipex: It doesn't matter wether I am running XBMC on Seat0 or Seat1. I have seen it work before. Something updated that broke support for video playback. It is probably XBMC itself, because XBMC runs without a window manager and Compiz does not handle XBMC. See /usr/share/xsessions/XBMC.desktop and man xbmc-standalone.

Either way, here is my crashlog (xbmc crash and reboot on video playback):
http://pastebin.com/3qZR6vJz
Try Xubuntu. It's the new Ubuntu.
Reply
#11
thats not what I said. I meant, try to get rid of compiz on the seat that does not run xbmc. I didn't actually try it myself, but I imagine that compiz is blocking openGL.
Reply
#12
Although I don't have compiz installed as such, XFCE does have 'Compositing' enabled in desktop settings. I disabled it (making the desktop slower and uglier) and retried, but the behavior does not change.

On playback, XBMC quits, The X screen shows (black screen with black/white X mouse cursor), and XBMC restarts.
Try Xubuntu. It's the new Ubuntu.
Reply
#13
Question 
Redsandro Wrote:Although I don't have compiz installed as such, XFCE does have 'Compositing' enabled in desktop settings. I disabled it (making the desktop slower and uglier) and retried, but the behavior does not change.

On playback, XBMC quits, The X screen shows (black screen with black/white X mouse cursor), and XBMC restarts.

Have you figured anything else out for this? I've been wondering about the possibility of using the vt's like this for a while and just happened to stumble upon your thread.
Reply
#14
andematt Wrote:Have you figured anything else out for this? I've been wondering about the possibility of using the vt's like this for a while and just happened to stumble upon your thread.

Got it working:
Code:
[SeatDefaults]
greeter-session=unity-greeter
user-session=ubuntu-2d

[Seat:0]
autologin-user=matt
autologin-user-timeout=0
user-session=XBMC
greeter-hide-users=true
allow-guest=false

[Seat:1]
autologin-user=desk
autologin-user-timeout=0
user-session=ubuntu-2d
greeter-session=unity-greeter

I tested quite a few videos and they all play without "killing" xbmc. F7 is xbmc and F8 is a unity desktop I'm happy with the results.

Check out the example lightdm.conf here:
/usr/share/doc/lightdm

it doesn't mention:
Code:
[LightDM]
[i][b]seats=Seat:0 Seat:1[/b][/i]
or
Code:
[Seat:0]
[i][b]vt=7[/b][/i]

I don't plan to use XDMCPServer either so I left that out as well.

There shouldn't be any need for user and greeter session defs in Seat:1 I just haven't cleaned that up yet.
Reply
#15
seats= is optional for having more seat configs without using them, and vt= is the used 'terminal' (F#) behind which the desktop is shown, which actually defaults to F7 so you can omit it, but you would need it if for example you'd want xbmc to run at F10.

Aaaanyway, I made the modifications you suggested so I can check out if XBMC runs videos after the next boot. However, all differences seem to be irrelevant to how XBMC runs so I would hypothesize that there's a totally different reason for your XBMC playing video in the separate session and mine does not.

What XBMC version/ppa do you use?
Try Xubuntu. It's the new Ubuntu.
Reply

Logout Mark Read Team Forum Stats Members Help
[Ubuntu] Separate XBMC session at boot1