[Raspberry Pi] RetroPie Rom Extractor

Hi there, since a couple of weeks a few people suggest that I should offer roms from images that are available through my service: Berry2Pay. Well, that’s sounds good but instead of hosting those roms I want to let you know how you can extract and share roms from game images (including custom build based on: RetroPie, RecalBox, Batocera Linux and more) with everyone. I’ll start by telling you that roms from game images will work through all your devices and platforms, not only work under a Raspberry Pi or Berryboot, they will work too in any device that runs an emulator. Fun fact right?.

Now, extract roms from game images is really simple, in a few words, you just need to find the rom directory, copy/paste the roms you want, that’s all. So, the whole process will be:

  • Find a server (can be a VPS, I’ll explain why).
  • Download game images.
  • Find the rom directory.
  • Compress the rom directory.
  • Download the compressed rom file.

There are two options to do this: you can do it for free or you can pay for a VPS, why to pay for a VPS?, simple, those who want to do this for free, will require a high amount of free hard disk space in their local computer, and people who don’t have that high amount of free hard disk space, should take the VPS option.

Example: single RetroPie game images can be big size files as 128GB up to 256GB, these images can contain thousands of roms for several systems like: PlayStation, NES, SNES, Dreamcast and much more, if you want to use your local computer, you can download that image (be sure to have the require hard disk space) and just copy/paste roms, but what happen if someone want just the NES roms?. It doesn’t sound fair to download a 128GB image to get just a 2GB directory (NES).

To do this right, I recommend a VPS with KVM or XEN virtualization, in this way you can download game images without touching your local hard disk, extract the roms you want, compress them and download them. With a VPS you can actually extract and download only the roms you want, remove the ones that you don’t want and store them indefinitely and you can even build your own rom collection or rom packs, or better, you can build your own game images without upload any file from your local computer and that allows you to share roms and game images with everyone. Sounds good isn’t it?.

Ok, a VPS, there are thousands of providers out there, from big ones like: Digital Ocean, Vultr, and even Amazon AWS but for this case, you don’t need so much resources, you can use (if you already have one) or acquire a VPS from your favorite provider just be sure to have a large disk space.

Fortunately a good friend from Wishosting allow me to give a modest discount exclusively for this post, note that this post (nor my website) doesn’t have affiliate links so it’s a real deal. Why Wishosting? They offer low-budget VPS instances, don’t assume that low means slow, Wishosting is a reliable web hosting provider and they offer VPS instances with large hard disk space, that’s why I’ll recommend them in this post.

You can go to: wishosting.com and click “Classic VPS”, select the: “KVM HDD 500” plan and use this coupon: agoldcheidt. That coupon is only available for that plan. This VPS instance have:

From my point of view that: Unlimited CPU core, 500GB HDD, 2GB Ram and the Unmetered bandwidth are the perfect features to do things like extract roms from game images and all this for less than $5 month. Let’s get started, once you have a VPS instance ready (from Wishosting or not), I recommend to install Debian or Ubuntu, now login through SSH and update the VPS the OS by executing:

sudo apt update; sudo apt upgrade -y; sudo apt dist-upgrade -y; sudo autoremove -y

Once the OS is up-to-date, reboot it and login again.

The first thing to do is install apache, this will allow you to download roms and images through any web browser. Install apache by executing:

sudo apt-get install aria2 curl apache2 zip unrar p7zip p7zip-full -y

Once that is done, rename apache index HTML file by executing:

mv /var/www/html/index.html /var/www/html/index.backup_html

in that way you will see all files located in the default web directory. Now, you can download game images via HTTP or Magnet/Torrent with aria2.


aria2c -x 8 -s 8 HTTP-URL or aria2c TORRENT-URL

Real life examples:

aria2c -x 8 -s 8 'https://www.gamebuilds.com/retropie_mega_build_2019.zip'
aria2c 'https://www.gamebuilds.com/retropie_mega_build_2019.torrent'

Once you downloaded the game image, unzip it by executing:

unzip name-of-image.zip

now you will see the image file (.img), it’s time to delete the zip file by executing:

rm -f name-of-image.zip

Now mount the image in a loop device by executing:

losetup -f -P name-of-image.img
sudo mount /dev/loop0p2 /mnt

Search for the rom directory (also the BIOS one if you need it too) by executing:

find /mnt -type d -name "roms"; find /mnt -type d -name "BIOS"

Once you know where is the rom and the BIOS directories, compress them by executing:

7z a -tzip roms_from_vps.zip /mnt/rom_path/

Real life example:

7z a -tzip roms_pack_01.zip /mnt/home/pi/RetroPie/roms
7z a -tzip bios_pack_01.zip /mnt/home/pi/RetroPie/BIOS

Once that is done, you can unmount the loop device by executing:

sudo umount /mnt; sudo losetup -d /dev/loop0

Now it’s time to move the compressed rom and BIOS files to the default web directory, do that by executing:

mv roms*.zip bios*.zip /var/www/html

Now you must access to your web server by typing VPS instance’s IP address, if you don’t remember it, you can see it by executing:

curl ifconfig.me

Lastly, type the IP address in your web browser URL bar and now you will be able to download the rom and the BIOS compressed files. Once the download is completed, uncompress it and copy/paste all roms and BIOS you want.

With those simple steps you will be able to download custom builds and extract their roms from hundreds of custom game images based on: RetroPie, Recalbox, Batocera Linux and many more. This is just the basic and should be work in all VPS (KVM/XEN) instances.

However, let me know if you face any issue, I can assist you in all stages, from the VPS instance setup to the compression and download of the compressed rom and BIOS files. I’ll be glad to help and hear your ideas, requests and suggestions.

Wishosting Homepage

Want to know even more about it? Doubts? Leave a comment.

 864 total views,  1 views today

This is a honest review, as you can see there's no ads, affiliate links nor warez content on my blog. All reviews of servers, apps, devices and tools are original content generated by myself. There's not any commercial influence on my blog content from any company nor project developers. Contribute to ensure it stays that way

[Raspberry Pi] RetroPie Rom Extractor
5 1 vote
Article Rating
Notify of
Inline Feedbacks
View all comments
Scroll to top