Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HOWTO - Run some ROMs from network share (per emulator)
#1
I was struggling to find a way so I can have ROMs for some of the emulators on SD card and some of them in shared folder on a networked Windows PC. I saw a topic here on the forum about storing ROMs on USB stick but couldn't find info on how to run them from a shared folder so I searched the web and I did find several forums with various informations but at the and it was not so straightforward as I thought it would be - so I will write the instructions in case anyone wanted to do the same.

I will assume basic knowledge of configuring the network, SSH, FTP and using terminal so I will explain only the most important steps for achieving the goal. I was using Windows PC + Orange Pi PC with RetrOrangePi-3.0.1.Orangepipc image.

The first step I did was to share a folder named _net_share on the PC and giving the read/write permissions to user anyone. Then I checked if I can access the shared folder from another Windows PC in the network to make sure there won't be log-in prompt and everything was as expected. Then I did the same test directly from Orange Pi PC - I started the Desktop (START > APPS > DESKTOP) and clicked on Browse Network. I could see the network share but was suprised because I had to log in. I could log in as one of the defined Windows users so at that point I could create another user for the purpose of mounting the share but after a while I discovered I can use any username and any password to log in. The next step was to try to mount the shared folder from command prompt, without using of the desktop environment.

After some more investigation I found that I need to install cifs-utils to be able to mount the shared folder from terminal so I did:


Code:
sudo apt-get install cifs-utils

Now, I am not aware which mechanism is used by desktop environment to auto-mount the nework share but cifs-utils work well. I would, however, like to know how exactly is network share mounted by desktop environment. I thought it maybe uses smbfs but that package is not installed so it must be something else.

Nevertheless, upon installing the mentioned package I created a folder /home/pi/mnt/w_share and then mounted the network share using:

Code:
sudo mount -t cifs //xx.xx.xx.xx/_net_share -o uid=pi,gid=pi,username=ab,password=cd /home/pi/mnt/w_share/


where xx.xx.xx.xx is the IP address of my PC which is static (my Orange Pi PC BTW has static IP as well). uid and gid parts are important because without it the mount would be owned by root so Emulationstation wouldn't be able to write access gamelist.xml and other files and username&password are just some random strings - in case there isn't a prompt to log-in I believe these could be just left out.

After mounting the netwok share I tested if that worked:

Code:
cd winshare
ls

As I could see (and access) the shared files and folders the next step was to check if I can run ROMs from the shared location so I removed all ROMs from zxspectrum folder on SD card and resterted Emulationstation so ZX Spectrum emulator dissapeared from the list and then I edited /opt/retropie/configs/all/emulationstation/es_systems.cfg and replaced the line:

Code:
/home/pi/RetroPie/roms/zxspectrum

with:

Code:
/home/pi/mnt/w_share/roms/zxspectrum

and restarted the Emulationstation to see if ZX Spectrum emulator will show again on the list. The emulator showed and I could run the ROMs from the network share so the final step was to edit /opt/retropie/configs/all/autostart.sh to configure automatic mounting:


Code:
cd /opt/retropie/configs/all
nano autostart.sh

There isn't sudo because autostart.sh is owned by pi. After adding the line:

Code:
sudo mount -t cifs //xx.xx.xx.xx/_net_share -o uid=pi,gid=pi,username=ab,password=cd /home/pi/mnt/w_share/

at the top of the file (before calling the other .sh script) and restarting the system ZX Spectrum's ROMs were running from the network share and all other ROMs were running from SD card. That way the ROMs for older systems that don't take too much space can be on SD card and can be used even when outside of the network and as soon as Orange Pi PC is back to the network the other ROMs that do not fit on SD card can be used as well.

It would be nice to be able to run the ROMs for selected emulator from SD card and from the network share at the same time but I don't know that could be done. That way a few ROMs could be on SD card and the other would run from the network share.

I hope someone will find these instructions useful by adapting what I described to their own needs.
Chupo_cro
Reply
#2
Thank you for this.
About your question: in case you missed it, every rom folder has an usb subfolder which is actually a symbolic link to an usb mountpoint. You can create another link pointing to your network share. So, in, EmulationStation it will show up as a rom folder. From different sources.
Reply
#3
(05-09-2017, 01:14 AM)alexkidd Wrote: Thank you for this.
About your question: in case you missed it, every rom folder has an usb subfolder which is actually a symbolic link to an usb mountpoint. You can create another link pointing to your network share. So, in, EmulationStation it will show up as a rom folder. From different sources.

You are welcome :-)

Let me see if I understand correctly how these symbolic links work in the context of Emulationstation. As I understand there is a code which scans specific folder containing ROMs for the particular emulator (according to the path specified in /opt/retropie/configs/all/emulationstation/es_systems.cfg) and in addition it scans the folder pointed by the symbolic link? If my assumption is correct that means it is not possible to add one more symbolic link so the system could use both USB mount and share mount and the only option is to redefine the existing symbolic redirecting it to the network share instead to the USB mount point? In other words - if I understand correctly - there could be only one symbolic link per each ROMs folder?

There is now only one topic left that I would like to know about. I wonder what is used to mount the netork share when working from within the desktop environment. Because there wasn't cifs-utils package before I instaled it - meaning there is some other back-end package in the system which makes possible to mount network share. If there really is another package that can be used for the same purpose then it would be possible to mount network share even without installing cifs-utils?

I am BTW quite new to Linux and am still examining the basics but am used to work with various new environments because I work with microcontrollers.
Chupo_cro
Reply
#4
I cant confirm right now, but i believe you can create as much symbolic links as you need, they will all act as regular folders, as long as they're inside default folder (~/RetroPie/roms/PLATFORM).
Also, cifs-utils is not needed. You can use sshfs instead.

Try this:

Install SSHFS

sudo apt-get install sshfs

Create a mountpoint locally and mount your network share
mkdir ~/raspberry
sudo sshfs -o allow_other pi@192.168.100.9:/home/pi ~/raspberry
   
Create symbolic links inside rom folder
cd ~/RetroPie/roms/megadrive
ln -s ~/raspberry/megadrive/ rpi

Check links and roms
pi@RetrOrangePi:~/RetroPie/roms/megadrive$ ls -la
lrwxrwxrwx  1 pi pi   29 May  9 12:45 rpi -> /home/pi/raspberry/megadrive/

pi@RetrOrangePi:~/RetroPie/roms/megadrive$ cd rpi                                                            
pi@RetrOrangePi:~/RetroPie/roms/megadrive/rpi$ ls                                                            
Quack Shot Starring Donald Duck (JUE) (REV 01) [!].bin
Reply
#5
(05-09-2017, 12:00 PM)alexkidd Wrote: I cant confirm right now, but i believe you can create as much symbolic links as you need, they will all act as regular folders, as long as they're inside default folder (~/RetroPie/roms/PLATFORM).

I will try to see if that works.

(05-09-2017, 12:00 PM)alexkidd Wrote: Also, cifs-utils is not needed. You can use sshfs instead.

I have just checked:

Code:
pi@RetrOrangePi:~$ dpkg -s sshfs
dpkg-query: package 'sshfs' is not installed and no information is available

meaning that package is not instaled with the image but the desktop environment is still able to auto-mount the network share so there must be even another preinstaled package that can be used for mounting network shares!? The desktop environment must have been using something that could be invoked directly from the terminal.
Chupo_cro
Reply
#6
run htop and check for running processes
Reply
#7
(05-09-2017, 12:00 PM)alexkidd Wrote: I cant confirm right now, but i believe you can create as much symbolic links as you need, they will all act as regular folders, as long as they're inside default folder (~/RetroPie/roms/PLATFORM).

I created another symbolic link to the network share and it works. I thought the system will automatically scan the linked location and list the ROMs together with the ROMs in the original folder od SD card - but only now I see I have to go into the linked folder to browse the contents. The system in fact does automatically scan the linked folder because the displayed ROM count is correct. It would be nice to be able to enable presentation of all ROMs in just one list - regardless of their actual location. The names of ROMs that are inside folders linked through symbolic links might be displayed using a font color different than the default.

I prepended the symbolic link name with '!' so it shows at the top of the list.
Chupo_cro
Reply
#8
i think it's possible, but you would need to make symbolic links for the files , not the folder. I have just tried from SSH and it seems to work. At least, they are being listed in default roms folder.

Example:

cd ~/RetroPie/roms/megadrive
rm -rf usb <=== remove 'usb' symbolic link to avoid conflict
ln -s /media/usb/roms/megadrive/* . <=== (asterisk reads all roms in source location; dot creates links in current folder)
ls -la <=== you should see the full roms list
Reply
#9
That sounds great, thank you!! :-) I will later test if the files that system creates when launching/leaving ROMs (e.g. .srm files for PSX emulator) will work correctly with such a configuration.
Chupo_cro
Reply
#10
I did some tests after creating a symbolic link pointing to the network share:


Code:
ln -s /home/pi/mnt/w_share/roms/psx/ \!NETWORK


and that works well but the errors in the following format:


Code:
lvl10:    File path ""/home/pi/RetroPie/roms/psx/!NETWORK/ROM_name.bin"" is outside system path "/home/pi/RetroPie/roms/psx/"

can be seen for a moment after launching some game. However, it seems this 'error' is just a warning which does not affect the functionality.

I also moved the ROMs consisting of multiple files into their own folders to avoid multiple instances of the same game showing at the top level of the game list. The folder names must not contain the spaces. If there is a space in folder's name the following errors will occur:


Code:
lvl10:    Error finding/creating FileData for ""/home/pi/RetroPie/roms/psx/!NETWORK/folder_name/ROM_name.bin"", skipping.

and the .srm file will be missing.
Chupo_cro
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  HOWTO - Using DPad as analog control (N64 emulation) alexkidd 17 4,626 11-05-2017, 02:59 PM
Last Post: Samsonite
Question HOWTO - GPIO Controller ericktarzia 18 8,317 10-15-2017, 12:28 AM
Last Post: hessamghani
  HOWTO - Dreamcast reconfigure controls - Reicast alexkidd 7 5,447 10-07-2017, 04:49 PM
Last Post: Fulmore
  HOWTO - eMMC install script for Ropi Harryzimm 30 12,985 08-10-2017, 07:24 AM
Last Post: Lamerjack
  HOWTO - display from 3.5mm/RCA CVBS audio/video alexkidd 18 14,137 07-20-2017, 05:09 PM
Last Post: lesshiy
  HOWTO install C library for GPIO and Example Shutdown system with a GPIO button Spirax 1 1,043 06-19-2017, 11:34 AM
Last Post: alexkidd
  HOW TO - install Amiga emulator and run games? Vadim1972 1 652 06-18-2017, 06:47 PM
Last Post: alexkidd
  HOWTO upgrade system without crash it with sudo apt-get upgrade Spirax 1 1,128 06-08-2017, 10:24 AM
Last Post: alexkidd
  HOWTO - execute permissions in NTFS storage (useful to change ROMS folder) Sikotik 2 1,814 12-30-2016, 01:25 AM
Last Post: niabi
  HOWTO: Set time from RetroPie Menu Sikotik 0 1,338 12-19-2016, 02:09 AM
Last Post: Sikotik

Forum Jump:


Users browsing this thread: 1 Guest(s)