Linux HOW TO: Minimal Ubuntu 16.04 with Kodi, Steam & EmulationStation - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111) +---- Forum: Linux (https://forum.kodi.tv/forumdisplay.php?fid=52) +---- Thread: Linux HOW TO: Minimal Ubuntu 16.04 with Kodi, Steam & EmulationStation (/showthread.php?tid=282593) |
HOW TO: Minimal Ubuntu 16.04 with Kodi, Steam & EmulationStation - solbero - 2016-07-19 Update: New guide I have written a new guide which uses Lutris for game managment. This setup gives a more seamless experience launching games from Kodi. It supports Steam, GOG, Itch.io, emulators and several more game sources. You can find the new guide on GitHub. ----- Introduction This HOW TO will explain how I set up my HTPC running Kodi, Steam and EmulationStation on a minimal Ubuntu 16.04 install. The HOW TO will cover the specific topics of gluing Kodi, Steam and EmulationStation into a coherent media center solution. Therefore, this HOW TO will not cover configuration of Kodi, Steam nor EmulationStation. However, I will link to other guides that cover these topics where they are relevant. The HOW TO assumes that you have a basic understanding of terminal commands and SSH. If these two words do not carry any meaning to you, read these two articles: Connecting via SSH to your server and Common SSH commands. If anything seems unclear in this guide, if any commands are wrong, or if you have any advice on how any of the steps can be done better, please don’t hesitate to make a reply. Updates 30.11.2016 – Fixed typoes. Thanks Rokys. 29.08.2016 – Removed adding USER to the ‘audio’ group in 3.1. See this post for more info. 18.08.2016 – Added sed command to to 7.5. 03.08.2016 – Added to 8.2 how to change splash screen. 1. MinimalCD install of Ubuntu 16.04 1.1 Create a bootable USB drive Download the Ubuntu 16.04 MinimalCD ISO image for your architecture (most likely 64-bit). Create a bootable USB drive with the image. There are many programs available which could be used to create a bootable USB drive, but one that is cross-platform is UNetBootIn, you can also have a look at the Ubuntu documentation if you are unsure how to do it. Boot your HTPC from the USB drive. Make sure that it is connected to the Internet with a cable, as the MinimalCD image downloads all its packages during installation. 1.2 Installation Installation is straight forward, but it looks intimidating since it is not in a fancy GUI. However, if you are unsure consult this guide or follow Step 1.3 from this thread. IMPORTANT: There are a few options, explained underneath, that are specific to this installation.
Finish the installation, remove the USB drive and reboot. You should be greeted by the login screen for your ADMIN user. 2. SSH 2.1. Connect to the HTPC using SSH For Linux and OSX, connect to your HTPC using SSH from a terminal instance. Replace [ADMIN] with the username for ADMIN and [HOSTNAME] is the HTPC’s hostname selected during install. Code: ssh [ADMIN]@[HOSTNAME] If you are connecting through a computer running Windows, download PuTTY and follow this guide. You should be prompted to trust the connection, then enter your ADMIN password when prompted. 3. Creating a user with limited priviledges 3.1. Creating a user Kodi and its associated programs will be run by a user with limited privileges. The reason is security. The user which will be running programs will have no password and will login automatically. Therefore the user should be as restricted as possible. You can assign this user any username you like, but make a note of it. The user created in the following steps will be referred to as USER. Create a user with password disabled. Replace [USER] with you preferred username. Code: sudo adduser --disabled-password --gecos "" [USER] Assign the necessary privileges to the user. Code: sudo usermod -a -G cdrom,video,plugdev,users,dialout,dip,input,netdev [USER] 4. Installing programs 4.1. Adding program PPAs Ubuntu 16.04 ships with Kodi, Steam, RetroArch and Dolphin available in its repositories. However, by adding third party PPAs, it is possible to get the latest stable version of the programs. All of the following commands are issued through SSH as the ADMIN user. First, add the Kodi Stable PPA. Code: sudo apt-add-repository ppa:team-xbmc/ppa Then, add the RetroArch PPA. Code: sudo apt-add-repository ppa:libretro/stable Add the EmulationStation PPA. Code: sudo apt-add-repository ppa:emulationstation/ppa And finally, the Dolphin PPA. Code: sudo apt-add-repository ppa:dolphin-emu/ppa Now, get the latest package lists and install the programs. Code: sudo apt-get update Also, at this point, it is a good idea to check for any general updates to Ubuntu 16.04. Code: sudo apt-get upgrade && sudo apt-get dist-upgrade 5. Install Openbox and a kodi-openbox Xsession 5.1. Install Openbox To be able to run external programs (such as Steam), you need to run Kodi on top of a window manager in a Xsession. Fist you need to install Openbox. Code: sudo apt-get install openbox 5.2. Install Kodi-Openbox Xsession There are several guides on this forum and the web in general that explains how to set up an Xsession for Kodi to run in. These solutions usually involves a lot of scripting. The easiest solution I have found is to download kodi-openbox created by the GitHub user lufinkey. This is a collection of scripts that includes an Openbox Xsession that runs Kodi and a script that will launch external programs and manage their windows. To install kodi-openbox Xsession, download the latest .zip file from the GitHub master branch. The file is named “openbox-kodi-master.zip” by the below code. Code: wget -O openbox-kodi-master.zip https://github.com/lufinkey/kodi-openbox/archive/master.zip Extract the .zip file. Code: unzip openbox-master.zip If you get a prompt telling you are missing the package unzip, install it. Code: sudo apt-get install unzip Move into the extracted directory, create a .deb package from the extracted content and install the .deb. Code: cd kodi-openbox-master 6. Auto login and Xsession 6.1. Enable auto login in LightDM When the HTPC is powered on it should automatically log in USER into the kodi-openbox Xsession. To accomplish this you need to configure LightDM, Xubuntu’s login manager. Open up the LightDM configuration file. The file will be created automatically if it doesn’t exist. Code: sudo nano /etc/lightdm/lightdm.conf Paste in the following configuration. Make sure that you replace [USER] with your USER’s username. Remember that you need to use CTRL+SHIFT+V to paste in a terminal instance. Code: [Seat:*] Save the file by pressing CTRL+X and then press ENTER. 6.2 Log into the kodi-openbox Xsession First, you need to reboot the HTPC to make all the changes you have made has an effect. Code: sudo reboot Congratulations, if everything went well, you should now have launched Kodi in the Openbox Xsession. 7. Add menu items for Steam and EmulationStation to Aeon Nox 7.1. Using SSH as USER Connect to your HTPC again through SSH. You should be logged in as ADMIN, but for the next steps you need to change to USER. You need to change users since the files downloaded and configured by ADMIN are not accessible to USER, and because you will place and configure files in USER’s Home directory which is not accessible to ADMIN. Change user in SSH. Replace [USER] with USER’s username. Code: sudo su - [USER] 7.2. Install the Aeon Nox skin I am using the Aeon Nox skin in this HOW TO. The home menu of this skin is easy to customize, which is needed to add menu items for Steam and EmulationStation. How to install this skin is explained well on the Kodi Wiki. 7.3. Download and install Advanced Launcher Download Advanced Launcher from Angelscry’s GitHub repo. To do so, issue the following command through SSH: Code: wget -O advanced-launcher-master.zip https://github.com/angelscry/plugin.program.advanced.launcher/archive/master.zip Angelscry has discontinued the add-on, but it is the best way I have found on launching external applications in Kodi. If you know of a different add-on or solution that acomplishes this task in a more graceful way, please let me know. In Kodi, add the Advanced Launcher add-on. How to install an add-on from a .zip is explained on the Kodi Wiki. The .zip is located in the Home folder and is named advanced-launcher-master.zip. 7.4. Configure Advanced Launcher Navigate to your program add-ons in the Aeon Nox skin. It is located on the Home Screen under the title Apps. To add a launcher for Steam do the following:
Create a launcher for EmulationStation:
7.5. Edit favorites.xml There is a bug in Advanced Launcher/Kodi that launches a favorite with Kodi’s PlayMedia function instead of the RunPlugin function. To fix this you need to edit the favourites.xml manually. Open the favourites.xml (make sure you are USER): Code: nano ~/.kodi/userdata/favorites.xml Replace PlayMedia with RunPlugin for the favorites Steam and Emulation. If your favourites.xml doesn’t contain any other favorites, it is possible to replace PlayMedia with RunPplugin automatically with the sed command. Code: sed -i -e 's/PlayMedia/RunPlugin/g' ~/.kodi/userdata/favorites.xml 7.6. Add Home Menu items to Aeon Nox To add Steam to the Home screen items to Aeon Nox, follow these steps:
8. Miscellaneous 8.1 Remove grey Openbox background To remove the default, grey Openbox background that appears when you launch external applications and replace it with a nice black one, do the following: Install hsetroot (remember to be logged in as ADMIN) Code: sudo apt-get install hsetroot Switch to USER Code: sudo su - [USER] Copy the default Openbox configuration files to USER’s Home directory Code: cp -R /etc/xdg/openbox ~/.config/ Open autostart with nano Code: nano ~/.config/openbox/autostart Paste in the following at the end of the file: Code: # Set a background color Restart and you are done. 8.2 Add Kodi splash screen If you want to get rid of the Xubuntu splash screen, it is possible to change it to a Kodi one. teeedubb on this forum has made/adapted a Kodi splash screen for Ubuntu 16.04. Download the .deb as ADMIN Code: wget https://dl.dropboxusercontent.com/u/22410524/xbmc/plymouth-theme/plymouth-theme-kodi-logo.deb Install the .deb Code: sudo dpkg -i plymouth-theme-kodi-logo.deb RE: HOW TO: Minimal Ubuntu 16.04 with Kodi, Steam & EmulationStation - andrew52 - 2016-07-19 Thanks for this. I am in the middle of trying to set something up. However, what I am trying to do is a bit different. I have two SSDs. One for Windows 7 and the second SSD for Kodi running under Ubuntu. I have a third 1 TB HD for data including media which is formatted in NTFS. Ubuntu recognized the data drive. However, I don't know how to get Kodi to communicate with it...that is I am not using a networked server....I want to connect to a drive in the same PC. If you know how to do that it would be very helpful. Thanks RE: HOW TO: Minimal Ubuntu 16.04 with Kodi, Steam & EmulationStation - DaVu - 2016-07-21 log in at Ubuntu (I guess it's a complete dual boot system) and show us the output of Code: mount and Code: cat /etc/fstab If the drive is correctly mounted it's easy to access it via its mountpoint, which will be shown either in the fstab or from the "mount" command. By adding the source, you will need to specify a path to its mountpoint. If a HDD is mounted it's not shown as a "drive" like you know it from windows. Under Linux everything is a "file" and drives are mounted to folders. Mostly under /media/.... but let's see what those commands say. RE: HOW TO: Minimal Ubuntu 16.04 with Kodi, Steam & EmulationStation - andrew52 - 2016-07-30 I have the screen shots of the above two commands. However, I suspect the drive is mounted because as you can see from the third screen shot, the icon of the e: (data) drive, can be seen on the left hand panel. I opened it up and it is the data drive. The problem is being able to access the drive in Kodi. I do not see it there. I created the kodi Upload folder for movies etc. that I get from using kodi. Please forgive me...I really know very little about Ubuntu...have never used it...just using it to create duel boot system to separate kodi from windows. I do not know how to insert images...here are links though to the images: http://imageshack.com/a/img924/8053/h0P6Gc.png http://imageshack.com/a/img923/6960/LBrxiN.png http://imageshack.com/a/img923/107/WWQghP.png RE: HOW TO: Minimal Ubuntu 16.04 with Kodi, Steam & EmulationStation - 188pilas - 2016-08-03 I ran into some issues starting steam...received the below error: Code: X Error of failed request: BadValue (integer parameter out of range for operation) I found instructions from this site which indicates to do the below: Code: sudo su - [USER] Code: cd $HOME/.steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu after i received the above I ran: Code: DISPLAY=:0 steam and all seems to be fine... nice guide..thanks! RE: HOW TO: Minimal Ubuntu 16.04 with Kodi, Steam & EmulationStation - solbero - 2016-08-04 188pilas, are you using a Nvidia graphics card? I have not experienced a similar issue, but I think the reason is that I‘m using Intel‘s Integrated Graphics. I glanced over the link to AskUbuntu you posted, and your error seems to be caused by the graphics driver. Could you see if following this answer solves the issue. Removing Steam‘s bounded libraries as you have done is a hackish workaround, and it could limit performance. You can do so by quitting Kodi, which should take you to LightDM. Log in as ADMIN, and then follow the steps in the linked post. HOW TO: Minimal Ubuntu 16.04 with Kodi, Steam & EmulationStation - 188pilas - 2016-08-04 (2016-08-04, 00:17)solbero Wrote: 188pilas, are you using a Nvidia graphics card? I have not experienced a similar issue, but I think the reason is that I‘m using Intel‘s Integrated Graphics. I am running an nVidia graphics card on host PC and on client PC I am using an Intel nuc D34010WYK. Sent from my iPhone RE: HOW TO: Minimal Ubuntu 16.04 with Kodi, Steam & EmulationStation - solbero - 2016-08-04 (2016-08-04, 00:54)188pilas Wrote: I am running an nVidia graphics card on host PC and on client PC I am using an Intel nuc D34010WYK. I see, so you are streaming to your HTPC from another machine. I don‘t have any experience with Steam streaming, but as long as the fix you supplied works for you, great! RE: HOW TO: Minimal Ubuntu 16.04 with Kodi, Steam & EmulationStation - geckow - 2016-08-05 Thank you very much for your tutorial, everything works well (just had some crashes with latest Kodi build) ! I am just wondering why do you use Minimal Xubuntu desktop, isn't Lubuntu minimal installation lighter ? (it also already includes openbox) After some tests, it seems to work a bit better with Lubuntu (less ressources consumption), I'll report my experiences when I will have time ! RE: HOW TO: Minimal Ubuntu 16.04 with Kodi, Steam & EmulationStation - cobolus - 2016-08-07 thanks for the great tutorial RE: HOW TO: Minimal Ubuntu 16.04 with Kodi, Steam & EmulationStation - cobolus - 2016-08-07 it happens on my machine that the system is already running before the network is brought up completly and so PleXMBC cannot connect. How can I change it so that the network is brought up first and then Kodi is started ? RE: HOW TO: Minimal Ubuntu 16.04 with Kodi, Steam & EmulationStation - fritsch - 2016-08-07 Use the forum search: lightdm wait for network RE: HOW TO: Minimal Ubuntu 16.04 with Kodi, Steam & EmulationStation - solbero - 2016-08-07 (2016-08-05, 19:17)geckow Wrote: Thank you very much for your tutorial, everything works well (just had some crashes with latest Kodi build) ! I am just wondering why do you use Minimal Xubuntu desktop, isn't Lubuntu minimal installation lighter ? (it also already includes openbox) I’m glad that you enjoyed the guide. I considered using Lubuntu Minimal Desktop. However, my reasons for choosing Xubuntu Minimal Desktop are:
For a setup like this, where you boot directly into Kodi, the desktop environment that is installed doesn’t really matter—you never boot in to it, you boot into Openbox instead. However, the other choices in the MinimalCD installation such as Unity or Gnome would bundle a bunch of processes that would begin at startup and slow everything down (notice that they do not have a minimal version). That‘s why you‘d want the minimal desktops. They are just the minimal needed. As such, Lubuntu Minimal Desktop is as a good a choice as Xubuntu Minimal Desktop. In Lubuntu, you wouldn’t have to install Openbox as you point out, but you might have to install some other programs which are included in Xubuntu Minimal Desktop. Both work for this kind of setup, so choose the one you like. TL;DR: Both Xubuntu Minimal Desktop and Lubuntu Minimal Deskop work for this kind of setup. RE: HOW TO: Minimal Ubuntu 16.04 with Kodi, Steam & EmulationStation - DJBenson - 2016-08-08 Thanks for the guide, I've followed it and have everything working but on the occasions that Kodi crashes, how does one automatically restart Kodi? From what I can gather, Kodi is running within LightDM/Openbox so the only way to get Kodi back up is to restart LightDM - but that's beyond the capabilities of my wife if I'm not at home. When I used a systemd service for Kodi, it would automatically restart on crash, but now I've moved to the LightDM/Openbox method of launching Kodi, I have no idea how to automatically respawn Kodi (or relaunch LightDM) if/when Kodi crashes. EDIT: I actually managed to work this out myself using a mixture of the kodi-openbox-session binary and the kodi.system systemd script. If you want Kodi to automatically restart on crash, you will need to; Code: Remove (or comment out) the following from /etc/lightdm/lightdm.conf Disable the lightdm service Code: sudo systemctl disable lightdm Create a new systemd file for kodi Code: sudo nano /etc/systemd/system/kodi.system and enter the following code; Code: [Unit] Be sure to check the inline comments in the service file above as some options are optional depending upon your setup (i.e. the mysql.service is only relevant IF you are using mysql for kodi AND both kodi and mysql are installed on the same physical machine) Enable the new kodi service Code: sudo systemctl enable kodi.service Reboot. Now Kodi will launch (using openbox) via systemd and will relaunch if it crashes. RE: HOW TO: Minimal Ubuntu 16.04 with Kodi, Steam & EmulationStation - defaultdotxbe - 2016-08-08 Thanks for the guide, I've always used KodiBuntu before, but I like this better. Now I just need to figure out es_systems.cfg lol |