How to specify a NFS share on the server as media source?

This is about OSMC/KODI on Linux (RaspberryPi4).

As the subject says, I have a Linux server on the LAN which has a NFS share for the video file store which KODI should display in Videos/Files.

So far I have used /etc/fstab to specify the NFS share and mount point (/mnt/servername) like this:

#Mount video share on ubuntuserv:
192.168.119.***:/home/bosse/www/VIDEOS /mnt/ubuntusrv nfs tcp,noexec,intr 0 0

and in the file .kodi/userdata/sources.xml I have referenced the mount point dir as the source and what it would be named in KODI:

    <video>
        <default pathversion="1"></default>
        <source>
            <name>VIDEOS Bosse</name>
            <path pathversion="1">/mnt/ubuntusrv/</path>
            <allowsharing>true</allowsharing>
        </source>
    </video>

But I want the mount of the source to be done by KODI when it starts and umount when it quits, so that when KODI is not running the mount is not present.

Is this possible at all?

I have googled and tried various hits concerning specifying the media shares to use but in principle everywhere I look it is all about samba… :frowning:

Where and how in KODI or its userdata files do I configure the media share on the server when it is an nfs share?

And also:
How do I control when in the boot process KODI starts running?
I would like to set a boot delay for KODI to start so that a VPN connection has time to be connected to the server where the video files reside.

I know the commands to start, stop and restart KODI from the command line (SSH) but where is it started on boot?

If you use autofs to make the mount instead of fstab it will mount on access and unmount automatically when not in use…

Thank you very much for that!
I did not know of autofs before but now I have tested it and it seems to work just fine, exactly what I need!
Added to both my OSMC notes and also to my general Linux-stuff notes for future reference.

It means that I don’t have to worry about timing on boot since the mount actually happens only when the user navigates into the server video files tree.
Perfect!
:slight_smile:

1 Like