How to mount nfs in libreelec rw?

  • Hello all!

    Ok I'm not 100% sure about this. But how exactly if you use the libreelec interface does it connect to NFS? What user does it connect as, or does it always try to connect to an NFS share as root?

    The reason I am asking is because I'm having a permissions problem with an NFS Share. The computer I have running libreelec is connected via ethernet to a second computer running an NFS share (courtesy of Openmediavault). Both computers can see each other over the network, I can see the files via NFS but for one problem - I only have read only access. The computer running openmediavault is a PC I use to back up onto and I was hoping to move across recorded on the machine running libreelec to the openmediavault machine. But no luck. Both PCs are just ordinary x86 boxes btw.

    If I try, I get the following error message (libreelec): "Failed to copy at least one file. Check the log for more information about this message. Operation was aborted".

    Digging a little deeper and finding where the libreelec log file is (in my case, $HOME/.kodi/tmp/kodi.log) I found this:

    Code
    00:55:40.970 T:139798548895488   ERROR: CNFSFile::Open: Unable to open file : '//b.txt' error : 'open call failed with "NFS: ACCESS denied. Required access rw-. Allowed access r--"'

    (b.txt is just a test file I tried to copy).

    So it looks as the reason why the file can't be copied is because of a permissions problem - rw is needed, but got r (read). That is intresting as on other computers I have rw access on that openmediavault computer, and I have it set up to be that way in libreelec -- NFS shares are mounted as rw in the openmediavault settings for example; shared folders also too have rw access. Am I correct in thinking when file manager in libreelec connects to NFS it does so as root - even when a profile setting is used (and that this could be causing the problem?).

    Only reason I bring up the issue of root is because from memory I think that write operations in openmediavault are blocked by default for security reasons. If libreelec was trying to write as root it wouldn't work.

    NB: The openmediavault PC is configured to be on IP address 192.168.1.x (to keep it away from wifi/internet devices, which are on a slightly different IP address; 192.168.0.x) . I simply used manual configuration as opposed to DHCP in libreelec for ethernet (also on 192.168.1.x) and in libreelec/filemanager used "add source" to add the NFS share.


    Thanks
    ljones

    Edited once, last by ljones (April 9, 2017 at 1:33 AM).

    • Official Post

    A few things:

    - Your file server (OMV) must be configured correctly for access
    - You can create file sources via Kodi's File manager, using the usual file protocols (SMB, NFS and others).
    - LibreELEC' system is read-only. All data/settings/etcera are stored via /storage and further.

    • Official Post

    Been there, seen that, got the T-Shirt. You need to make sure that the NFS settings in OMV are insecure (This is because Kodi accesses the resource as root and needs elevated permissions.)

    So it will look something like this (From memory - so it might not be precise)

    /my/nfs-export 192.168.0.2/24 (rw,all_squash,insecure)

  • Ok I have checked my openmediavault settings. They seem to be set to allow rw. My settings were originally "subtree_check,insecure,all_squash" but I tried changing them to "all_squash,insecure" but to no avail. In exact detail:

    NFS Shares:
    Privilege - Read/Write
    Extra options - insecure,all_squash

    If libreelec needs root/elevated permissions I guess I'm going to have to dig deeper in order to allow OMV to have permission to use root with regards to NFS shares.

    Update

    I've been poking around OMV a lot and tried to find an answer. This *might* be a possible answer, it seems to be doing something but I am not 100% sure on the settings (I can now get to the NFS shares in libreelec). It involves OMV's "ACL" settings in its shared folders settings.

    I've not used those before but I tried the following (Note: I could read/write to an nfs share before and never touched these settings just not as root!) - User accounts RW, Admin RW, root RW, users RW. Owner root RW,execute; Group users RW, execute; others RW,execute.

    Prehaps I should put up screengrabs just in case someone else is trying to do something like this?

    ljones

    Edited once, last by ljones (April 9, 2017 at 8:29 PM).