Windows shares

  • New to LE, but been using Raspbmc/OSMC for years :-}
    I thought I'd have a look at LE and bumped into a couple of issues.

    On OSMC I mount my media, which is on a Windows box, by editing /etc/fstab to automount the various shares.
    I have several different media libraries which use different shared MySQL databases on the same Windows box.
    The reason for the multiple databases is for different users [profiles] with different media.
    [e.g I keep the Opera etc. separate from movies/TV].

    So - the issue. In the MySQL databases, paths are of the form /media/sharename/dir1/dir2 .....
    This works because of the automounting mentioned above.
    This clearly won't work on LE as I can currently only access the shares via smb://server/share/.....

    Is there a way for a user-defined script to be run on startup?

    Secondary question - in /etc/fstab I had entries of this form:
    //http://192.168.xx.yyy/XBMC /media/zbmc cifs credentials=/.smb/.agb noserverino,file_mode=0777,dir_mode=0777,sec=ntlmv200

    I haven't managed to get the equivalent manual mount commands to work.

    Any help/advice appreciated.
    [hr]
    Oops, forgot version info [although I think this is probably a generic problem].

    LibreELEC:~ # uname -a
    Linux LibreELEC 4.7.5 #1 SMP Mon Sep 26 22:01:39 BST 2016 armv7l GNU/Linux
    LibreELEC:~ # vcgencmd version
    Sep 21 2016 13:17:10
    Copyright (c) 2012 Broadcom
    version 2eaf52cc53435b5ce67253af1487f9a4f9f96e2d (clean) (release)
    LibreELEC:~ # lsb_release
    LibreELEC (Milhouse) - Version: devel-20160926214646-#0926-ge726b1a [Build #0926]

    Edited once, last by agb (September 27, 2016 at 5:01 PM).

  • Q1 Make an advancedsettings.xml file and stick a path substitution (have a look in the kodi wiki for details and examples).

    Q2. No idea.

    I'm not clear why you need multiple mysql databases (or why you need to mount for that matter) - it sounds like smart playlists would be an easier way to separate content.

    Edited once, last by trogggy (September 27, 2016 at 5:28 PM).


  • Q1 Make an advancedsettings.xml file and stick a path substitution (have a look in the kodi wiki for details and examples).

    Q2. No idea.

    I'm not clear why you need multiple mysql databases (or why you need to mount for that matter) - it sounds like smart playlists would be an easier way to separate content.

    The separate libraries/databases are mainly to keep the number of entries manageable and maintain separate watched status.
    I use path substitution for other purposes, don't want to use smb:// paths in the databease, assuming the substitution
    could be made to work.
    I use smart playlists in the various profiles to subset the content via menus in the skin.
    Automounting avoids issues when switching profiles, as learned from bitter experience.
    I may have to use the technique of tweaking the squashfs as described here squashfs howto - make changes the read-only filesystem in OpenELEC - andreierdei
    if there's no other way to get the shares automounted.

    Thanks anyway.

  • One thing: Using the /etc/fstab file is not the best solution as it will be overwritten with any upgrade (or downgrade) of LibreELEC. Either use autostart.sh with manual mount commands, or edit the smb.cnf file in /storage/.config (from the top of my head).


  • One thing: Using the /etc/fstab file is not the best solution as it will be overwritten with any upgrade (or downgrade) of LibreELEC. Either use autostart.sh with manual mount commands, or edit the smb.cnf file in /storage/.config (from the top of my head).

    Aha! I'll have to investigate autostart.sh, thanks.
    Still having trouble mounting a share manually, so will have to resolve that.
    I'm aware that /etc/fstab will get zapped, hence the reference to squashfs howto - make changes the read-only filesystem in OpenELEC - andreierdei
    in my last post.
    Can't find /storage/.config/smb.cnf - there's only a samba.conf.sample in there.
    Thanks anyway.
    [hr]
    Found the answer here:
    LibreELEC
    I'll set up some system.d services.
    Thanks all.

    Edited once, last by agb (September 27, 2016 at 6:37 PM).

  • Is there a problem with enabling samba and setting the shares with file manager? Samba is already activated on Windows, You just need to set the folder sharing, I am not paranoid I set them to "share with everyone". IIRC, it is even easier after you do all of the MYSQL stuff, that is more complicated than I want to be.

    No complicated linux editing involved.

    The samba.conf is in /storage/.config it will be used instead of the smb.conf that is read only. The hosts.conf and lircd.conf go there too. Edit and rename the sample to "samba.conf".

    Edited once, last by donbrew (September 28, 2016 at 6:19 PM).

  • Likewise, I have already enable "share with everyone" for a folder in a windows 10 PC and another windows 10 pc can access all the files in that folder. However, the LE set-top box can access the PC upto a point it will ask for Name and Password.
    Both the PCs need not to do this as the share setting was set as not requiring password.

    On the other hand, both PCs can access the folders in the LE set-top box without the need for password.

    Would appreciate some help to tweak the samba config file of the LE system to omit the need for password.

    Edited once, last by edragon (September 29, 2016 at 12:13 PM).

  • Check your settings in windows 10. The last update I had switched all my machines to using homegroups - which I have always avoided - and needing passwords to access shares.

  • It is linux samba that requires a password, just use the user login for the W10 machine then choose remember. You may want to create a user on windows, depending on your level of paranoia/expertise; I just use one account as admin.


  • It is linux samba that requires a password, just use the user login for the W10 machine then choose remember. You may want to create a user on windows, depending on your level of paranoia/expertise; I just use one account as admin.

    Somehow, it do not work with the Window user password. However, Media Player as a UPnP network device do work to share media files from the PC but need to use playlists to share the files.
    I have found a better solution using the Universal Media Server in the PC to share files to the LE set top box which can easily see all media files.

    Now, both way traffic, PC access LE and vice versa is smooth and nice. No need authentication by password. :D

    Edited once, last by edragon (September 29, 2016 at 4:06 PM).

  • donbrew
    The reason I want to mount the shares outside of kodi is that I want them available across all profiles.
    *And* I want the pathnames for media to be of the form /media/share/etc/etc not smb://server/share/etc/etc.
    I appreciate that this may be a non-standard/unusual requirement :-} but it *is* my requirement.

    I use the same media and MySql dbs on OSMC.
    I have things working this way on OSMC and I would like LE to work the same way :-}

    Using systemd services I have got it all working now.
    The only fly in the ointment is that sometimes the mounts fail. I am fairly sure that this is because the Pi
    hasn't got the correct time from ntp yet, but I work around it by rerunning the mounts from a script.


  • Check your settings in windows 10. The last update I had switched all my machines to using homegroups - which I have always avoided - and needing passwords to access shares.

    Thanks for the suggestion but after upgrading windows 10 lately, homegroup is in a mess, cannot join and cannot make a new one yet.

  • It has been said that LE does not need NTP it gets the time from your LAN. I think that actually works, but I added the NTP to mine anyway. Maybe if all are getting the time from the LAN they would all be exactly the same, alternate is to enable "wait for network before starting Kodi" then the time will be set to network time when Kodi starts.

  • donbrew
    Not sure what you mean by 'gets the time from your LAN' :-}
    It gets it from an NTP server *somewhere* - be it your router, or in my case, the NTP servers specified by my DHCP server.

    I already have the 'wait for network' setting set, but the problem I am seeing is that the time doesn't get sync'd until a while after kodi starts, which is after the systemd mount services have already failed, as the Pi's time seems to be set from the kernel build time, as milhouse has explained some where.

    It isn't a showstopper, as I just SSH in and and rerun the mounts - this is OK on my 'development' Pi but would not be OK on the 'family' Pi :-}

  • Your network keeps the time automatically, just like your telephone. If you also use NTP there is a possibility that the 2 will not agree, like network lag etc. Every LAN has a built in clock or packets would never sync. What I remember milhouse explainng is the time comes from the network.

    Basically, if your device is connected to a network it already has a time server or the network could not function. Just like your landline telephone or cellphone. You do still need to tell Kodi your time zone, since the clocks are based on GMT, but the milliseconds are what count :P (literally) .

    If you have 2 clocks it is likely that they do not show exactly the same time, for one reason or another.

  • donbrew
    I don't think that's quite how it works, but no point arguing about it :-}
    For the purpose of this discussion, the problem is that the Pi doesn't set its clock to the correct time before the network mounts are attempted.
    I've started another thread about Time synchronisation.