Linux -  Auto-start Kodi in Ubuntu : Questions about the "kodi" user creation
#1
Hi there,

I bought an Intel NUC N2820 (4GB RAM + 1 TB Hard-Drive) I want to turn into a HTPC.
Of course, I've chosen to use Kodi.

As OS, I've chosen Ubuntu 14.04 LTS.

I've chosen this full distribution instead of alternatives like OpenELEC or KodiBuntu for the following reasons:
- Even if the usage of the NUC will be primarly a media-center, I want also to be able to use it a desktop PC when I need.
- Because after few years, I'm back using Linux and this installation is a good exercise to refresh my Linux knowledge.

What I already did (and works Smile ):
- Install Ubuntu 14.04 LTS
- In /home, create a folder "Media" which will contain all the movies, music, ... I had to create this folder as root (since it's under /home which belongs to root) but I moved the ownership to my main user (the user created during Ubuntu installation).
- I've also created a group "nuc-media". This group has full rights on the folder "Media". All the users of the nuc will belong to the group "nuc-media". I did this in order that the folder "Media" is shared amongst all users of the HTPC.
- I installed Samba and shared the folder "Media" accrossed my local network so I can remotely add videos, movies, music, ... For security reasons, I exluded the possibility to log as a guest and defined a Samba password for my user.
- Install KODI.

Now, what I want to do is to configure the NUC so KODI starts automatically and only when loging out KODI, it's possible to login to the regular Ubuntu desktop (just as in KodiBuntu in fact).

I read a lot of documentation, forum, ... and understood that it can be managed via a lightdm and xsession.

But the pre-requisite for this, is to have a Kodi user defined. Hence my questions:

1) What are the privileges I should give to him ? From what I read, the following should be ok but I'd like to get confirmed that I don't miss anything:

Quote:useradd -m -G audio,cdrom,video,cdrw,usb,users,nuc-media -p encrypted_password kodi

Is the "-m" required ?

It would have been nice if the way KodiBuntu kodi user is created was documented.

2) For security purposes, I'd like that the kodi user can log on kodi-standalone without password but that the password is required if someone tries to log to Ubuntu using this user or if another user different than "kodi" (e.g. my personal user) tries to log in KODI desktop. Is it feasible ?

I'm thinking of doing the following:

In /etc/lightdm/lightdm.conf:

Quote:[SeatDefaults]
autologin-user=kodi
autologin-user-timeout=0
user-session=KODI
greeter-session=lightdm-gtk-greeter

And in /usr/share/xsessions/KODI.desktop

Quote:[Desktop Entry]
Name=KODI
Comment=Auto start of KODI with "kodi" user without password
Exec=kodi-standalone (or xbmc-standaone Huh)
TryExec=kodi-standalone (or xbmc-standaone Huh)
Type=Application

Should it be enough ?
Reply
#2
install openelec, any reason you need ubuntu?
Reply
#3
Hi, yes.

As I said, I want to be able to use it as a PC sometimes (thunderbird, web-browsing, LibreOffice, ...).

And also when Kodi will be correctly setup I want to install RetroArch + a front-end (probably EmulationStation) and define a specific xsession for it to use it standalone with autologin (with a specific defined user too).

If would just want OpenELEC, I'd not have invest in a NUC but rather in a Raspberry Pi.

But that's another topic.

I hope I'll get some answers to my initial questions... Big Grin
Reply
#4
Hi there,

I did some test.
I created a user called kodi in the users and groups utility.

I set him as a system user (without the rigts to install programs, ...).
I defined a password for him.

And with this, it seems to work.

In /etc/lightdm/lightdm.conf:

Quote:[SeatDefaults]
autologin-user=kodi
autologin-user-timeout=0
user-session=KODI
greeter-session=lightdm-gtk-greeter

In /usr/share/xsessions/KODI.desktop

Quote: [Desktop Entry]
Name=KODI
Comment=Auto start of KODI with "kodi" user without password
Exec=kodi-standalone
TryExec=kodi-standalone
Type=Application

So in short, creating a basic users with the default groups seem ok.
And the autologin only works for Kodi. When I exit Kodi and try to use Ubuntu, the password is requested.

I'll just add the kodi user to the group allowed to access my shared folder where the media will be stored.

I hope that this topic can help someone who will get the same concern.
Reply
#5
If you use kodibuntu,this is all set up for you.

or study the kodibuntu source on github.

Or install and study it in virtualbox.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
 
Thread Rating:
  • 0 Vote(s) - 0 Average



Logout Mark Read Team Forum Stats Members Help
Auto-start Kodi in Ubuntu : Questions about the "kodi" user creation00