Post Detail

Build custom RetroPie on RaspberryPi running raspbian minmal.

/static/assets/images/blog-detail.jpg

Share

Build custom RetroPie on RaspberryPi running raspbian minmal

In this tutorial I will show you how to install RetroPie on RaspberryPi that is running Debian Raspbian (no desktop).

After you have booted into the command line and logged in using your credentials.

Create a new 'git' directory as we are going to be cloning RetroPie git repository from github.

mkdir git

Now change into 'git' directory

cd git

Before proceesing further let's make sure our Debian Linux installation is up-to-date.

sudo apt update && sudo apt distro-upgrade

Type the passowrd for your sudo (if asked).

(If asked) Type 'y' and press enter to continue.

Now we need to install necessary software in order to continue futher (assuming you don't already have these installed).

sudo apt install git dialog unzip xmlstarlet

Now let's clone RetroPie repository from github using the following command:

git clone --depth=1 https://github.com/RetroPie/Retropie-Setup.git

Now let's change directory to recently cloned directory.

cd Retropie-Setup/

We need to add the following line in retropie_packages.sh file, just under the __version line as shown:

__platform=rpi3

__version="4.5.17"

__platform=rpi3

 

[[ "$__debug" -eq 1 ]] && set -x

Now let's start the setup script to install the RetroPie and type in your sudo password (if asked)

sudo ./retropie_setup.sh

You should be prompted with the following notice:

Press 'enter' to select OK

Now you will see the following options:

Select 'Basic Install' to proceed.

Now select 'Yes' and press enter.

This will now start installing the RetroPie on your Raspberry Pi.

Once it is back to the setup screen just exit out.

 

Now let's setup samba as it makes it very simple to add ROMs. So we need to install samba first:

sudo apt-get install samba samba-common-bin

When prompted to use WINS DHCP select 'yes'.

Now let's go to:

cd /etc/samba/

Just to make sure samba service is running:

sudo systemctl status smbd

You should see the following:

smbd.service - Samba SMB Daemon

   Loaded: loaded (/lib/systemd/system/smbd.service; enabled; vendor preset: enabled)

   Active: active (running) since Sun 2020-03-15 18:09:00 GMT; 2min 55s ago

     Docs: man:smbd(8)

           man:samba(7)

           man:smb.conf(5)

 Main PID: 1261 (smbd)

   Status: "smbd: ready to serve connections..."

   Memory: 5.0M

   CGroup: /system.slice/smbd.service

           ├─1261 /usr/sbin/smbd --foreground --no-process-group

           ├─1263 /usr/sbin/smbd --foreground --no-process-group

           ├─1264 /usr/sbin/smbd --foreground --no-process-group

           └─1265 /usr/sbin/smbd --foreground --no-process-group

Just move the smb.conf file to something else as we are going to create a new file.

sudo mv smb.conf smb.conf.bk

Now let's edit the file and configure it:

sudo nano smb.conf

And add the following items in your file:

[global]

server string = Retropie Gaming Living Room

workgroup = MYWORKGROUP

security = user

map to guest = Bad User

name resolve order = bcast wins

include = /etc/samba/smbshared.conf

For server string you can put the description of your server

For workgroup you can put anythning or just put a workgroup if you have created one on your windows share.

Rest of the config will give you enter the samba share without the password. It is not recommended for public networks. But in this case we are creating the share for home use.

The last line is to include a file. In this file we will list our shares. The smb.conf contains all the global settings.

So let's create the smbshared.conf file:

sudo nano smbshared.conf

And this is how your file should look like:

[RetroPie-Living]

path = /home/rohaansch/RetroPie

force user = rohaansch

force group = rohaansch

create mask = 0664

directory mask = 0777

force directory mode = 0777

public = yes

writable = yes

The first line is just the name of your share. In my case I will be putting this RetroPie in Living room.

For path enter the path you want to be shared. Rest of the config is the user and user permissions. You can enter your username for your setup. This setup will allow anonymus access if you are using windows.

If all goes well we should be able to restart samba and we can add our ROMs.

sudo systemctl restart smbd

Just make sure if there are no errors in the service:

sudo systemctl status smbd

You should see some like this:

smbd.service - Samba SMB Daemon

   Loaded: loaded (/lib/systemd/system/smbd.service; enabled; vendor preset: enabled)

   Active: active (running) since Sun 2020-03-15 18:46:41 GMT; 1min 24s ago

     Docs: man:smbd(8)

           man:samba(7)

           man:smb.conf(5)

  Process: 1975 ExecStartPre=/usr/share/samba/update-apparmor-samba-profile (code=exited, status=0/SUCCESS)

 Main PID: 1976 (smbd)

   Status: "smbd: ready to serve connections..."

   Memory: 4.3M

   CGroup: /system.slice/smbd.service

           ├─1976 /usr/sbin/smbd --foreground --no-process-group

           ├─1978 /usr/sbin/smbd --foreground --no-process-group

           ├─1979 /usr/sbin/smbd --foreground --no-process-group

           └─1980 /usr/sbin/smbd --foreground --no-process-group

 

Mar 15 18:46:39 raspberrypi systemd[1]: Starting Samba SMB Daemon...

Mar 15 18:46:41 raspberrypi systemd[1]: Started Samba SMB Daemon.

Mar 15 18:46:41 raspberrypi smbd[1976]: [2020/03/15 18:46:41.261153,  0] ../lib/util/become_daemon.c:138(daemon_ready)

Mar 15 18:46:41 raspberrypi smbd[1976]:   daemon_ready: STATUS=daemon 'smbd' finished starting up and ready to serve connections

At this point you should be able to access your RetroPie share on your windows or mac computer.

Now we need to install a few packages to automate the process of logging in so that when you start the Raspberry Pi it automatically goes into RetroPie console.

We will install the login manager.

sudo apt install lightdm openbox

Next we need to make sure the system automatically logs on. To do that we will need to configure lightdm.

sudo nano /etc/lightdm/lightdm.conf

Your lightdm.conf file should look like this:

[SeatDefaults]

autologin-user=rohaansch

autologin-user-timeout=0

user-session=openbox

You need to have customize autologin-user as your user.

Now openbox should be able to launch RetroPie upon restart. We also need to confirue RetroPie to autostart using and it will start emulation station at the beginning. Let's go back to the directory where we cloned the RetroPie git repository and launch retropie_setup script:

sudo ./retropie_setup.sh

Go to configuration/tools:

Now select autostart.

And select start emulation station at boot.

Now select 'Ok' and 'Back' and 'Exit'.

One more thing before we restart is you need to add your username in sudoers in order for emulation station to allow you to restart without asking for password when you want to restart.

In order to do that just type:

EDITOR=nano sudo visudo

And just below the line where it says 'root' add:

root    ALL=(ALL:ALL) ALL

rohaansch ALL=(ALL) NOPASSWD: ALL

Put your username in your case.

But right now our user is now a member of sudo we need to remove sudo in order for emulation station not to ask for password when performing sudo operations.

~/git/Retropie-Setup $ groups

rohaansch adm dialout sudo audio video plugdev games users input netdev gpio i2c spi

You will need the following command to do that:

~/git/Retropie-Setup $ sudo gpasswd -d rohaansch sudo

Removing user rohaansch from group sudo

-d represent "delete".

To verify it we can again type goups command:

~/git/Retropie-Setup $ groups

rohaansch adm dialout sudo audio video plugdev games users input netdev gpio i2c spi

Now let's reboot and emulation station should automatically start up. You can also copy the ROMs in the respective folders from your windows PC or mac in order for those games to show up in emulation station.

In order to install video drivers:

sudo apt-get install ubuntu-drivers-common
sudo ubuntu-drivers autoinstall
Quick Links:

You may also like...