RetroPi on my OSMC install

Something that I thought would be a fun edition to my media center would be to add an install of RetroPie so that I can turn it into a games console.

This will add another element of fun to my PI and will give it even more value.

There is a great post on how to install RetroPie here.


However, there is a problem with this.  When I tried it last time, it kept on crashing and failing to complete the build properly.

I figured out the problem, that is that OSMC has the swapfile turned off by default.  The script builds RetroPie from source code, which takes alot of RAM.  This means that eventually the PI runs out of RAM and the whole thing falls over.

To solve this problem, you need to activate the swap file on your PI.

For an OSMC install there’s a quick way that’s good enough to get the swap file going

sudo touch /enable_swap
sudo reboot

For other flavors of linux you can do the following.

here’s how to do it.

dd if=/dev/zero of=/path/to/swapfile bs=1M count=1024 # For 1GB swap file
mkswap /path/to/swapfile
swapon /path/to/swapfile

for my PI, I decided to put the swap file on my WD Passport. So the commands I’m using are

dd if=/dev/zero of=/tmp/swapfile bs=1M count=1024 # For 1GB swap file
mkswap /tmp/swapfile
swapon /tmp/swapfile

to test that this worked enter free -h

you should see an output like this…

              total        used        free      shared  buff/cache   available
Mem:           746M        129M         39M        9.7M        577M        551M
Swap:          1.0G          0B        1.0G

once I completed the RetroPie install, there is no need to have the swap file anymore so I turned it off again using the command

swapoff -a

Leave a Reply

Your email address will not be published. Required fields are marked *