Why not use kodi directly? I tried Kodi on a "normal" Linux distro and it lagged like hell (speaking of latencies over 4 secs). So even if you could resolve the error,it still won't be good.
I currently use Raybuntu's Leia build with attached NAS HDD and private key SSH and it's fine.
If you only want a NAS Server I would recommend openmediavault(for example if you split the work between rock and RPI)
If you need the normal usability of Linux you could use docker inside Kodi,but I couldn't get that to work so far(but didn't try much yet tbh).
I currently use Raybuntu's Leia build with attached NAS HDD and private key SSH and it's fine.
If you only want a NAS Server I would recommend openmediavault(for example if you split the work between rock and RPI)
If you need the normal usability of Linux you could use docker inside Kodi,but I couldn't get that to work so far(but didn't try much yet tbh).