Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| store_games_on_a_nas [2022/01/28 05:03] – [Advanced] info for normies using locked down routers atari | store_games_on_a_nas [2024/01/29 20:17] (current) – instructions for mounting network-based /userdata folders that are dependent on an established VPN or Tailscale connection cs | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| Instead of using the internal storage or an external USB key/hard drive to store your userdata (games, saves, configuration, | Instead of using the internal storage or an external USB key/hard drive to store your userdata (games, saves, configuration, | ||
| - | Of course you can also use your NAS as a backup target for all of your userdata and games for desaster recovery of your Batocera system as described below, just in case of...well...you name it. | ||
| Recommended watching: [[https:// | Recommended watching: [[https:// | ||
| + | |||
| + | <WRAP center round important> | ||
| + | Batocera repeatedly checks for a network connection on boot, and if none is present then it will automatically fall back to using internal storage. It is not possible to switch the location of your userdata without rebooting. If using NAS on a device which has a switch to turn on or off Wi-Fi, keep this fact in mind, as turning off the Wi-Fi will effectively wipe the userdata folder from Batocera' | ||
| + | |||
| + | In general, if using Batocera on a portable device it's not recommended to use a local NAS for its storage anyway due to the instability of its Wi-Fi. [[: | ||
| + | </ | ||
| ===== Syntax ===== | ===== Syntax ===== | ||
| Line 17: | Line 22: | ||
| There are the pre-defined keywords you can use: | There are the pre-defined keywords you can use: | ||
| - | * For the whole user data directory, '' | + | |
| - | * For the roms directory, '' | + | ^ Keyword ^ Description ^ |
| - | * For the bios directory, '' | + | | '' |
| - | * For the saves directory, '' | + | | '' |
| - | * For custom menu background music, '' | + | | '' |
| - | * For custom bezels, '' | + | | '' |
| - | * For screenshots taken in game or with '' | + | | '' |
| - | * For themes, | + | | '' |
| - | * For cheats databases, | + | | '' |
| - | * For sounds, | + | | '' |
| - | | + | | '' |
| - | * For the boot splash, '' | + | | '' |
| + | | '' | ||
| + | | '' | ||
| You can add any combination of the above (except '' | You can add any combination of the above (except '' | ||
| Line 38: | Line 45: | ||
| ==== For Samba ==== | ==== For Samba ==== | ||
| - | '' | + | '' |
| Then add the @ symbol, the IP address/ | Then add the @ symbol, the IP address/ | ||
| - | '' | + | '' |
| ==== For NFS ==== | ==== For NFS ==== | ||
| Line 48: | Line 55: | ||
| '' | '' | ||
| - | Examples below. | + | Examples |
| <WRAP center round important> | <WRAP center round important> | ||
| Line 55: | Line 62: | ||
| ===== Samba/ | ===== Samba/ | ||
| + | |||
| Windows shares can use identification or a guest account to connect. | Windows shares can use identification or a guest account to connect. | ||
| Line 62: | Line 70: | ||
| < | < | ||
| - | | + | sharedevice=NETWORK |
| - | sharenetwork_smb1=SHARE@192.168.0.1: | + | sharenetwork_smb1=SHARE@192.168.0.1: |
| </ | </ | ||
| Line 69: | Line 77: | ||
| < | < | ||
| - | | + | sharedevice=NETWORK |
| - | sharenetwork_smb1=ROMS@192.168.0.1: | + | sharenetwork_smb1=ROMS@192.168.0.1: |
| </ | </ | ||
| === Only the ROMs directory on the NAS with CIFS authentication === | === Only the ROMs directory on the NAS with CIFS authentication === | ||
| + | |||
| + | <WRAP center round important> | ||
| + | Unless you really know what you're doing, it is ill-advised to set up the NAS with a username and password for your ROMs, saves and system folders. This can interfere with Batocera' | ||
| + | |||
| + | It is recommended however to use authentication for your NAS in general, it's possible to create an additional share that only shares the ROMs folder with guest access for example. | ||
| + | |||
| + | If your NAS was already using NTFS then this limitation is already in affect, thus it would be no different to using authentication anyway. | ||
| + | </ | ||
| < | < | ||
| - | | + | sharedevice=NETWORK |
| - | sharenetwork_smb1=ROMS@192.168.0.1: | + | sharenetwork_smb1=ROMS@192.168.0.1: |
| </ | </ | ||
| Line 83: | Line 99: | ||
| < | < | ||
| - | | + | sharedevice=NETWORK |
| - | sharenetwork_smb1=ROMS@192.168.0.1: | + | sharenetwork_smb1=ROMS@192.168.0.1: |
| - | sharenetwork_smb2=SAVES@192.168.0.1: | + | sharenetwork_smb2=SAVES@192.168.0.1: |
| - | sharenetwork_smb3=BIOS@192.168.0.1: | + | sharenetwork_smb3=BIOS@192.168.0.1: |
| </ | </ | ||
| Line 110: | Line 126: | ||
| < | < | ||
| - | | + | sharedevice=NETWORK |
| - | sharenetwork_nfs1=SHARE@192.168.0.1:/ | + | sharenetwork_nfs1=SHARE@192.168.0.1:/ |
| </ | </ | ||
| Line 117: | Line 133: | ||
| < | < | ||
| - | | + | sharedevice=NETWORK |
| - | sharenetwork_nfs1=ROMS@192.168.0.1:/ | + | sharenetwork_nfs1=ROMS@192.168.0.1:/ |
| </ | </ | ||
| Line 124: | Line 140: | ||
| < | < | ||
| - | | + | sharedevice=NETWORK |
| - | sharenetwork_nfs1=ROMS@192.168.0.1:/ | + | sharenetwork_nfs1=ROMS@192.168.0.1:/ |
| - | sharenetwork_nfs2=SAVES@192.168.0.1:/ | + | sharenetwork_nfs2=SAVES@192.168.0.1:/ |
| - | sharenetwork_nfs3=BIOS@192.168.0.1:/ | + | sharenetwork_nfs3=BIOS@192.168.0.1:/ |
| + | </ | ||
| + | |||
| + | ===== Mounting network shares behind a VPN or Tailscale network ===== | ||
| + | === Background === | ||
| + | Mounting a shared folder on a server that requires a VPN or Tailscale connection to be established first is troublesome due to the Batocera boot initialization process. While Batocera does provide [[: | ||
| + | |||
| + | __Basic boot process flow:__\\ | ||
| + | 1. / | ||
| + | 2. / | ||
| + | 3. / | ||
| + | 4. / | ||
| + | 5. / | ||
| + | |||
| + | From the above, we can see that the VPN/ | ||
| + | |||
| + | === Workaround === | ||
| + | There is a [[: | ||
| + | |||
| + | First, setup and test the VPN/ | ||
| + | |||
| + | The final result of my configuration looks something like the below. Note that in my example, I am using Tailscale and mounting NFS folders, although this should be adaptable for any combination of VPN/ | ||
| + | < | ||
| + | sharedevice=NETWORK | ||
| + | sharenetwork_cmd1=eval if [ ! -d /dev/net ]; then mkdir -p /dev/net; mknod / | ||
| + | sharenetwork_nfs1=ROMS@100.0.0.1:/ | ||
| + | sharenetwork_nfs2=SAVES@100.0.0.1:/ | ||
| + | sharenetwork_nfs3=BIOS@100.0.0.1:/ | ||
| </ | </ | ||
| Line 150: | Line 193: | ||
| Kodi can be used to see //and// access network shares. You may need [[# | Kodi can be used to see //and// access network shares. You may need [[# | ||
| - | {{: | + | {{: |
| From here, enter the network share name (and your username and password if you don't have guest/ | From here, enter the network share name (and your username and password if you don't have guest/ | ||
| - | {{: | + | {{: |
| <WRAP center round tip> | <WRAP center round tip> | ||
| In the case that you don't know the name of the networked device (or one isn't available because your router has hostnames disabled/a very strict firewall) it is still possible to discover the IP address of the networked device from here. | In the case that you don't know the name of the networked device (or one isn't available because your router has hostnames disabled/a very strict firewall) it is still possible to discover the IP address of the networked device from here. | ||
| - | Instead of going to **Add network location...**, | + | Instead of going to **Add network location...**, |
| </ | </ | ||
| Your share will be added to the list of browseable devices, navigate to it (in this example, '' | Your share will be added to the list of browseable devices, navigate to it (in this example, '' | ||
| - | {{: | + | {{: |
| - | Note down the file path stated at the bottom of the window, this is the path that should be used when configuring your NAS. eg. Kodi's path '' | + | Note down the file path stated at the bottom of the window, this is the path that should be used when configuring your NAS. eg. Kodi's path '' |
| < | < | ||
| Line 192: | Line 235: | ||
| === NFS and root permissions === | === NFS and root permissions === | ||
| - | Batocera has a unique '' | + | Batocera has a unique '' |
| - | You should check how the file permissions are declared on your NFS server, but a common way to make sure your file permissions are managed correctly is to map the file rights to the UID of the user that will access these files locally. Typically, if your NFS shares are defined in ''/ | + | |
| < | < | ||
| / | / | ||
| </ | </ | ||
| + | |||
| + | ===== Troubleshooting ===== | ||
| + | |||
| + | Logs for share mounting specifically can be found at ''/ | ||
store_games_on_a_nas.1643346209.txt.gz · Last modified: by atari