Please help me to adjust settings for SMB connection OSMC to Windows

Please help me to adjust settings for SMB connection OSMC to Windows.

Here is what I have:

  1. A file /root/.smbcredentials containing

  2. Batch of commands issued:
    sudo chmod 0600 ~/.smbcredentials
    sudo mkdir /mnt/HDD
    sudo chown osmc:osmc /mnt/HDD

  3. Command for mount SMB share give the error
    mount.cifs // /mnt/HDD -o credentials=/root/.smbcredentials,uid=osmc,gid=osmc
    mount error(121): Remote I/O error
    Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)


I suggest having a read through of this guide as well:

I think you just need to add the vers= flag to fstab entry, Suggest try vers=3.0 or vers=2.1

Also why is the credential file in /root? May be better in /home/osmc

Thanks Tom.

I’m trying to connect to a share, located on Windows 7.
Please check what I do wrong.

  1. Checking that SBM1and SMB2 are enabled - OK.

PS C:\Users\administrator> Get-Item HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters | ForEach-Object {Get-ItemProperty $_.pspath}

PSPath                        : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters
PSParentPath                  : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer
PSChildName                   : Parameters
PSProvider                    : Microsoft.PowerShell.Core\Registry
ServiceDll                    : C:\Windows\system32\srvsvc.dll
ServiceDllUnloadOnStop        : 1
EnableAuthenticateUserSharing : 0
NullSessionPipes              : {}
autodisconnect                : 15
enableforcedlogoff            : 1
enablesecuritysignature       : 0
requiresecuritysignature      : 0
restrictnullsessaccess        : 1
Lmannounce                    : 0
Size                          : 1
AdjustedNullSessionPipes      : 3
DisableStrictNameChecking     : 1
SMB1                          : 1
SMB2                          : 1
Guid                          : {185, 184, 241, 211...}
  1. Checking permissions for share HDD - OK.


  1. As you recommended I moved credentials file to /home/osmc/ - OK.

root@Vero:/etc# ls -la /home/osmc/ |grep cred
-rw-------  1 root root   33 Jul  6 12:07 .smbcredentials
  1. /etc/fstab contained mount point (tried both versions 1.0 and 2.0) - OK.

root@Vero:/etc# cat /etc/fstab
#rootfs is not mounted in fstab as we do it via initramfs. Uncomment for remount (slower boot)
#/dev/vero-nand/root  /        ext4      defaults,noatime    0   0
//          /mnt/HDD cifs      x-systemd.automount,noauto,iocharset=utf8,credentials=/home/osmc/.smbcredentials,uid=osmc,gid=osmc,file_mode=0770,dir_mode=0770,vers=1.0   0   0
  1. Restarting mounting services - OK

root@Vero:/etc# mount -a
root@Vero:/etc# systemctl daemon-reload
root@Vero:/etc# systemctl restart
  1. Checking share availability - FAIL.

root@Vero:/etc# ls /mnt/HDD/
ls: cannot access '/mnt/HDD/': No such device

Well as starting points would first check availability of the share and the connection.
Install smbclient sudo apt-get install smbclient and then run smbclient -L -U <your user> and show us the output.

Ok… Only smb client located in the other package.

apt-get install smbclient

Oh, thanks a lot. It was may failure. When I was creating the user I forgot to remove “Require password change” option!

My (usual) mistake. Let me correct it in my post.

So it’s working now?

Yes, all goes great with SMB vers=2.1