Kodi Community Forum
How to have Kodi "see" an NFS source tunnelled over SSH? - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: OS independent / Other (https://forum.kodi.tv/forumdisplay.php?fid=228)
+---- Thread: How to have Kodi "see" an NFS source tunnelled over SSH? (/showthread.php?tid=353882)



How to have Kodi "see" an NFS source tunnelled over SSH? - scubbo - 2020-04-26

(Related question on superuser.com)

I have two Raspberries Pi on my local network - rasrho (which has port 22 forwarded to it from the router, so it can act as an SSH bastion host) and rasnu (which runs an NFSv4 server). Other devices on my local network can use the NFS shares on rasnu as Kodi sources with no issues.

I would like to make those shares available to authorized devices on different networks. I aim to do so by forwarding the relevant ports for NFS (which I believe to be 2049 and 111 for NFSv4) over an SSH tunnel.

I believed that the steps to do so would be:
  • Set rasnu's /etc/exports to the following (then run sudo exportfs -r to refresh):
Quote:/mnt/drive *(ro,sync,insecure,hide,no_root_squash,fsid=0,no_subtree_check)
/mnt/drive/media *(ro,sync,insecure,hide,no_root_squash,fsid=1,no_subtree_check)
  • Forward relevant ports from a proxy device on the remote network, and confirm it's accessible:
Quote:user@proxy_device:~ $ ls /mnt/NFSDirectory
[null]
user@proxy_device:~ $ sudo ssh -fN -L :2049:rasnu.local:2049 -L :111:rasnu.local:111 <user>@<public_IP_of_rasrho>
user@proxy_device:~ $ sudo mount -t nfs localhost:/media /mnt/NFSDirectory
user@proxy_device:~ $ ls /mnt/NFSDirectory
[listing of /mnt/drive/media from NFS Server]
  • Confirm that the NFS share tunnelled to proxy is accessible by another device on the same network as proxy_device:
Quote:user@remote_device:~ $ ls /mnt/NFSDirectory
[null]
user@remote_device:~ $ sudo mount -f nfs <local_address_of_proxy_device>:/media /mnt/NFSDirectory
user@remote_device:~ $ ls /mnt/NFSDirectory
[listing of /mnt/drive/media from NFS Server]
  • On remote_device, direct Kodi to use an NFS share from the IP Address of proxy_device, with path /media (or media, I'm not sure which)
However, this last step fails (for both /media and media), with a dialog box reading "The connection to the network location couldn't be established. This could be due to the network not being connected. Would you like to add it anyway?"

Are there other ports that I need to forward to make a remote proxy device "look like" a local NFS share?


RE: How to have Kodi "see" an NFS source tunnelled over SSH? - wsnipex - 2020-04-26

Kodi uses NFSv3 via libnfs. NFSv4 is not yet implemented in kodi(although libnfs does support it). I'd recommend to use OS level nfs mounts on your client devices and just add a "local source" to the mounted dir in kodi.


RE: How to have Kodi "see" an NFS source tunnelled over SSH? - scubbo - 2020-05-07

Got it - that's disappointing to hear, but at least I understand it now - thanks!

Unfortunately the client device are a  FireTV and a PS4, so an OS level mount would be pretty tricky to pull off. Good idea, though - I'll report back if I have any success.

Thanks again!