RetroPie
RetroPie is a native operating system based on emulationstation, which houses a multitude of legacy gaming console emulators.
Installation
You can download the RetroPie image here. Once downloaded, you can install the image to your SDCard via dd in linux, for example:
$ gunzip -c /home/gr0x0rd/Downloads/retropie-4.1-rpi2_rpi3.img.gz | sudo dd of=/dev/sdg
Once the dump is complete, insert the SDCard into the PI and fire it up. Eventually you will arrive at the main RetroPie screen.
Configuration
RetroPie will ask you to configure and input device. The operating system is designed to work with a gamepad, so that configuration is recommended (if you are using a PS3 controller, connect it via USB). Hold down a button to start the configuration process. You can also configure your keyboard by holding a button for a few seconds. It would be advisable to use the corresponding arrows for left/right/up/down, enter for start, b for b and a for a.
A note on navigating through the RetroPie menus: on the GUI based screens, the "A" button is the same as "enter" or "ok". The "B" button is cancel. The "Start" button brings up the RetroPie menu which allows you to configure controllers, quit or what have you. To get to advanced features, you'll need to select the RetroPie option and press A. Choose "RetroPie Setup" and press A. The console menus that now appear need to be navigated with the analog stick as opposed to the directional pad, and the select button is now the "ok" button as opposed to the A button.
Services and Hostname
At the time of this writing, the ssh deamon is disabled by default. To activate it, navigate to "Raspi-config" and choose "Advanced options" (RetroPie 4.1 and older) or "Interfacing Options" (4.1 and newer). Note in this menu, things are a bit wonky- the left analog right and thumb seem to be the items that get you through these menus. Choose SSH and enable. To change the hostname, select option 2 in the same menu- note you will want to have your keyboard plugged in for this step. After changing the hostname, the system should reboot.
PS3 Controller
If you have a bluetooth PS3 controller, this sadly won't work using its wireless connection out-of-the-box. You will need to press start to access the main RetroPie menu, then choose "RetroPie setup". Choose "Manage Packages", then "Manage Driver Packages". Install the PS3 controller driver. When done, choose the configuration option and connect a USB cable from the controller to your RetroPie install, if you haven't already. Disconnect the USB cable and press the home button on the controller. It should now be working.
Kodi
Press A after selecting the RetroPie menu, then choose "RetroPie Setup" and press A. Choose "Manage Packages", then "Manage Optional Packages". Scroll down to Kodi using the analog stick and press the select button. Kodi will now be installed.
The retropie installer will create a symlink in the pi home folder for .kodi that references /opt/retropie/configs/ports/kodi . If you have an existing .kodi configuration, you can scp those files there:
$ scp -r * pi@your.retropie.ip.here:/opt/retropie/configs/ports/kodi/
Before launching kodi, you will need to connect your keyboard, as overwriting the default retropie files will prevent your game controller from working in kodi.
Roms over NFS
I can't even begin to explain the benefits of having your ROMS stored on an NFS (or other) share on your network. Your games and save files will always be backed up if your memory card fails or what have you. To accomplish this there are a few steps: first, configure the pi to wait for network at boot.
$ sudo raspi-config
Next, add your network share to the fstab, for example
$ sudo nano /etc/fstab
Add the following line:
192.168.78.100:/home/gr0x0rd/files/roms /home/pi/RetroPie/roms nfs rw,nolock 0 0
Reboot your RetroPie and you should have all of your games ready to go in emulationstation. Hooray!
Just a note on the above: if you install any ports or additional packages (such as Kodi), RetroPie stores these in the "ports" folder within the "roms" folder. So you may need to copy the ports folder from your RetroPie to your share or they will no longer show up.
Kodi on Startup
Depending on the audience it may be helpful to have the system boot right into Kodi. This will also avoid the need for having to use the controller.
Go into RetroPie setup and choose Configuration / Tools. Go into the autostart options, then select "Start Kodi at boot". Reboot your pi and you'll boot right into Kodi.