SMB Windows 11 accessing shares on Vero 4k+

Hi,

Ok, not an unusual subject know, but I get this every few months, and wonder if there’s a known solution that is evading me, because all I end up doing is reinstalling OSMC and setting everything up again; I just don’t want to face that again and again :stuck_out_tongue:

I have two HDDs attached by USB to the Vero4k+. I copy files from Windows to those HDDs via the shares on Vero4k+. After working fine for months on end, Windows[explorer] suddenly forgets how to use the SMB shares on the Vero 4k+. “windows cannot access \”. For the life of me I’ve no idea what I do in Windows that makes that happen.

I don’t tinker with anything on the Vero4k+ itself (apart from this failed attempt to speed things up: Network share only allows small file transfer - Help and Support / Vero 4K / Vero 4K + - OSMC Forums); beyond installing the samba server, I let it automatically mount/share USB HDDs. It always comes down to having to just reinstall OSMC and set everything up again.

There are so many different posts about similar things here and elsewhere, but nothing really matches this specific case and the solutions haven’t helped me; is there some trick I’m missing when Windows does this?

Note: The Chorus web-app works just fine in browser.

Thanks

After having had trouble with setting up samba shares (pointing to files/folders on a windows macihine) my suggestion would be to set up some /mnt shares using autofs as described in this thread. I appreciate this may be doing things the other way round, so why not connect the usb hdd’s to your windows machine rather than the vero ? Also did you take a look at the windows logs in event viewer ? Sounds like a permissions/credentials issue. You should also perhaps take a look at the samba log file on the vero when you get these access failures by windows.

Thanks, but I don’t follow this; what should [server]/[share] be in this case?
I suspect this is for the the opposite direction; mounting a share that exists on some_machine to be accessible to OSMC? In my case, OSMC is doing the sharing.

Sounds like a permissions/credentials issue. You should also perhaps take a look at the samba log file on the vero when you get these access failures by windows.

This does sound interesting though; can you tell me how?

Turn on debugging and select specific module (samba) logging. There’s plenty of posts describing how to do this.

Thanks for your help/

When you access the drives from Windows are you using a shortcut? If so then perhaps the share name is changing and that is your issue and not samba breaking. I assume that your just using the automatic setup for the share which would mean that if the mount folder had some issue and you rebooted then those drives may get mounted under a new name which would then break any shortcut. I’ve seen a few thread around here that wind up with that issue. The simple fix if this is the case is to just manually delete the original mount folder and reboot which would then make the mount again at the original location.

Thanks for that. Yeah, the shares were mounted as nwDrives in WinExplorer; they first became inaccessible. So I removed those, cleared the credentials cache. I’m not trying to use any previously existing shortcut now, attempting to browse straight to the share in explorer like: this

\\192.168.178.34\osmc

Windows cannot access \\192.168.178.34\osmc
check the spelling […]

I can ping the ip and hostname, results are good.
I can access the http server chorus for the web interface
But, net view and new use give me this:

C:\Users\Herculainn1>net use \\192.168.178.34\osmc /user:osmc
System error 67 has occurred.
The network name cannot be found.
C:\Users\Herculainn1>net view osmc
System error 53 has occurred.
The network path was not found.
C:\Users\Herculainn1>ping osmc
Pinging osmc [192.168.178.34] with 32 bytes of data:
Reply from 192.168.178.34: bytes=32 time=1ms TTL=64
Reply from 192.168.178.34: bytes=32 time=2ms TTL=64
Reply from 192.168.178.34: bytes=32 time<1ms TTL=64
Reply from 192.168.178.34: bytes=32 time<1ms TTL=64
Ping statistics for 192.168.178.34:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 2ms, Average = 0ms

I get the same results without adding the share name, and swapping hostname with IP, just don’t want to make the post too long :stuck_out_tongue:

Thanks again for your time.

Edit: Updated double backslashes \\

Did you use double \ like \\192.168.178.34\osmc?

Are you sure the samba server is still installed and running?
Suggest you access the Vero via SSH that allows us to do more checks. You actually can use windows powershell to SSH into the Vero.

Details regarding how to access the command line interface can be found here on our Wiki: Accessing the command line - General - OSMC

Did you use double \ like \\192.168.178.34\osmc ?

Yes double backslash, I think this forum editor is stripping some characters like that. Noticed the same checks on other posts and intended to keep an eye on the same here haha sorry.

Oh yeah should have mentioned I’ve checked with this:

root@osmc:/home/osmc# sudo systemctl status samba
* samba.service - Samba Server
Loaded: loaded (/lib/systemd/system/samba.service; enabled; vendor preset: enabled)
Active: active (exited) since Sun 2022-04-10 01:35:34 IST; 5min ago
Process: 3482 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 3482 (code=exited, status=0/SUCCESS)
Apr 10 01:35:34 osmc systemd[1]: Starting Samba Server…
Apr 10 01:35:34 osmc systemd[1]: Started Samba Server.

Is “Active (exited)” what we should expect?
And these are what I’m expecting to be able to see from Windows:

root@osmc:/home/osmc# ls -l /media
total 12
drwxrwxrwx 1 osmc osmc 4096 Mar 17 18:08 NAS4TB3
drwxrwxrwx 1 osmc osmc 4096 Mar 21 19:24 NAS4TB4
-rw-r–r-- 1 root root 232 Jul 2 2020 README

Edit: More info along the same lines

I think the above was just mounted USB drives? so I believe this is the actual shares under Samba:

osmc@osmc:~$ net usershare info --long
[NAS4TB3]
path=/media/NAS4TB3
comment=Auto-mount Volume
usershare_acl=OSMC\osmc:F,
guest_ok=n
[NAS4TB4]
path=/media/NAS4TB4
comment=Auto-mount Volume
usershare_acl=OSMC\osmc:F,
guest_ok=n

So I wonder if I need to make the auto-mounts guest_ok=n? (now how to do that? :stuck_out_tongue: )
Though, recalling I haven’t changed anything on the device, I want to be careful not to change it now if Windows is the source of the problem…

Edit2: and the share configuration I think:

sudo nano /etc/samba/smb.conf
[global]

# If you require a fully custom smb.conf create smb-local.conf instead of editing smb.conf so your
# configuration will not be overwritten by samba upgrades. You can use smb.conf as a template by
# copying it to smb-local.conf then removing the config file line below in the new file. If you only
# need to add some additional shares see smb-shares.conf below for a simpler way to do this.

config file = /etc/samba/smb-local.conf
workgroup = WORKGROUP
security=user
follow symlinks = yes
wide links = no
unix extensions = no
lock directory = /var/cache/samba
load printers = no
printing = bsd
printcap name = /dev/null
disable spoolss = yes
log level = 1
map to guest = bad user
fruit:model = Macmini
# usershare template share = automount template

# Automount template disabled to work around a samba bug causing crashes accessing external drives.

read raw = Yes
write raw = Yes
strict locking = no
min receivefile size = 16384
use sendfile = true
aio read size = 2048
aio write size = 2048
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=131072 SO_SNDBUF=131072

[osmc]
browsable = yes
read only = no
valid users = osmc
path = /home/osmc
comment = OSMC Home Directory

[automount template]
browseable = yes
-valid = no
valid users = osmc
path = %P
hide files = /$RECYCLE.BIN/System Volume Information/desktop.ini/thumbs.db/

# Add custom shares in smb-shares.conf instead of editing smb.conf so they will not be
# overwritten by samba updates. You can only add new shares to smb-shares.conf, not change
# the default shares or global options. If you need full control see smb-local.conf above.

include = /etc/samba/smb-shares.conf

You would need to use the preformatted text button </> for any html code character.

If you login via SSH what does smbclient -L localhost gives you?
If smbclient command not available install via sudo apt install smbclient

Had to install it, here’s the output:
(thanks for the pre-formatted tip!)

osmc@osmc:~$ smbclient -L localhost
Unable to initialize messaging context
Enter WORKGROUP\osmc's password:

        Sharename       Type      Comment
        ---------       ----      -------
        osmc            Disk      OSMC Home Directory
        IPC$            IPC       IPC Service (Samba 4.9.5-Debian)
        NAS4TB4         Disk      Auto-mount Volume
        NAS4TB3         Disk      Auto-mount Volume
Reconnecting with SMB1 for workgroup listing.

        Server               Comment
        ---------            -------

        Workgroup            Master
        ---------            -------
        WORKGROUP            OSMC

Tried this one before to see if any active shares:

osmc@osmc:~$ sudo smbstatus --shares

Service      pid     Machine       Connected at                     Encryption                                                                                                   Signing
--------------------------------------------------------------------------------                                                                                                -------------


osmc@osmc:~$ testparm
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[osmc]"
Processing section "[automount template]"
Can't find include file /etc/samba/smb-shares.conf
Loaded services file OK.
WARNING: socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=131072 SO_SNDBUF=131072
This warning is printed because you set one of the
following options: SO_SNDBUF, SO_RCVBUF, SO_SNDLOWAT,
SO_RCVLOWAT
Modern server operating systems are tuned for
high network performance in the majority of situations;
when you set 'socket options' you are overriding those
settings.
Linux in particular has an auto-tuning mechanism for
buffer sizes (SO_SNDBUF, SO_RCVBUF) that will be
disabled if you specify a socket buffer size. This can
potentially cripple your TCP/IP stack.

Getting the 'socket options' correct can make a big
difference to your performance, but getting them wrong
can degrade it by just as much. As with any other low
level setting, if you must make changes to it, make
 small changes and test the effect before making any
large changes.

Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

# Global parameters
[global]
        config file = /etc/samba/smb-local.conf
        disable spoolss = Yes
        load printers = No
        lock directory = /var/cache/samba
        map to guest = Bad User
        min receivefile size = 16384
        printcap name = /dev/null
        security = USER
        socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=131072 SO_SNDBUF=131072
        unix extensions = No
        fruit:model = Macmini
        idmap config * : backend = tdb
        aio read size = 2048
        aio write size = 2048
        printing = bsd
        strict locking = No
        use sendfile = Yes


[osmc]
        comment = OSMC Home Directory
        path = /home/osmc
        read only = No
        valid users = osmc

Try on the Windows machine:

net use * /del.
net use \\192.168.178.34\osmc /user:osmc

Appreciate this. Here’s output from elevated cmd

C:\WINDOWS\system32>net use * /del
There are no entries in the list.


C:\WINDOWS\system32>net use \\192.168.178.34\osmc /user:osmc
System error 67 has occurred.

The network name cannot be found.

I assume you have confirmed the IP address 192.168.178.34 and it’s the same you use for SSH, or?

If IP is correct I only can imagine it being a firewall or Windows 11 having issues problems.
Might have to jump into Windows Event Logger to check any errors you can see.
Or on the Vero check the samba logs (might have to increase verbosity in smb.conf with log level = 5

Aye, more cmd stuff above showing ping, etc, working and yeah same address for SSH.

I only can imagine it being a firewall or Windows 11 having issues problems

Yeah it must be Windows, haven’t changed anything on the device (nor Windows for that matter, but windows does have a habit of changing shit for itself)

Or on the Vero check the samba logs (might have to increase verbosity in smb.conf

Can you tell me more about that? I didn’t find anything the previous poster was referring to.

Thanks a lot.

Ping doesn’t mean it is the right device :wink:

I guess you already figured out the location of the smb.conf file. Just open it in an editor e.g. nano and add that line log level = 5 to it. Then restart the samba server with sudo systemctl samba restart

You then should find logs in /var/log/samba

haha yea, well definitely the right one :stuck_out_tongue: also set static, hasn’t changed since added to the network :wink:

osmc@osmc:/var/log/samba$ ifconfig -a
eth0: flags=-28605<UP,BROADCAST,RUNNING,MULTICAST,DYNAMIC>  mtu 1500
        inet 192.168.178.34  netmask 255.255.255.0  broadcast 192.168.178.255
        ether 90:0e:b3:01:bb:8b  txqueuelen 1000  (Ethernet)
        RX packets 14346  bytes 11515519 (10.9 MiB)
        RX errors 0  dropped 698  overruns 0  frame 0
        TX packets 8785  bytes 3740296 (3.5 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 30

Ok so, checking logs…
First thing, set the logging level:

sudo nano /etc/samba/smb.conf
log level = 5

Then restarting the samba service:

osmc@osmc:/var/log/samba$ sudo systemctl samba restart
Unknown operation samba.
osmc@osmc:/var/log/samba$ sudo systemctl restart samba

Dunno what went wrong with original command there? changed part ok? Either way I just restarted the whole device anyway, so…

Then, tried to access share on windows explorer:

\\192.168.178.34\osmc

Windows cannot access \\192.168.178.34\osmc

And checking that log. I can’t find a way to copy the text for here, but this is the last entry. Don’t see anything about authentication or failed connections… something else I should look for?

osmc@osmc:/var/log/samba$ sudo nano log.smbd


[2022/04/10 16:04:33.579527,  2] ../source3/smbd/server.c:1381(smbd_parent_loop)
  waiting for connections


Oh here’s the last page of the log.nmbd file. The hostname, WINDOWS_MACHINE_NAME (replaced), and .84 ip, are that of the windows machine trying to access the share

[2022/04/10 16:28:47.372584,  4] ../source3/nmbd/nmbd_workgroupdb.c:165(find_workgroup_on_subnet)
  find_workgroup_on_subnet: workgroup search for WORKGROUP on subnet 192.168.178.34: found.
[2022/04/10 16:28:47.372716,  5] ../source3/nmbd/nmbd_packets.c:1912(read_packet)
  Received a packet of len 174 from (192.168.178.84) port 138
[2022/04/10 16:28:47.372775,  4] ../source3/nmbd/nmbd_packets.c:1296(process_dgram)
  process_dgram: datagram from WINDOWS_MACHINE_NAME<00> to WORKGROUP<1e> IP 192.168.178.84 for \MAILSLOT\BROWSE of type 11 len=6
[2022/04/10 16:28:47.372823,  4] ../source3/nmbd/nmbd_packets.c:117(debug_browse_data)
  debug_browse_data():
    0 char .OSMC.           hex 0b 4f 53 4d 43 00
[2022/04/10 16:28:47.372877,  4] ../source3/nmbd/nmbd_workgroupdb.c:165(find_workgroup_on_subnet)
  find_workgroup_on_subnet: workgroup search for WORKGROUP on subnet 192.168.178.34: found.
[2022/04/10 16:28:57.383023,  4] ../source3/nmbd/nmbd_workgroupdb.c:165(find_workgroup_on_subnet)
  find_workgroup_on_subnet: workgroup search for WORKGROUP on subnet 192.168.178.34: found.
[2022/04/10 16:29:07.390766,  4] ../source3/nmbd/nmbd_workgroupdb.c:165(find_workgroup_on_subnet)
  find_workgroup_on_subnet: workgroup search for WORKGROUP on subnet 192.168.178.34: found.
[2022/04/10 16:29:07.390939,  4] ../source3/nmbd/nmbd_workgroupdb.c:276(dump_workgroups)
  dump_workgroups()
   dump workgroup on subnet  192.168.178.34: netmask=  255.255.255.0:
        WORKGROUP(1) current master browser = UNKNOWN
                OSMC 40819a03 (Samba 4.9.5-Debian)
[2022/04/10 16:29:17.392361,  4] ../source3/nmbd/nmbd_workgroupdb.c:165(find_workgroup_on_subnet)
  find_workgroup_on_subnet: workgroup search for WORKGROUP on subnet 192.168.178.34: found.
[2022/04/10 16:29:17.392543,  4] ../source3/nmbd/nmbd_workgroupdb.c:276(dump_workgroups)
  dump_workgroups()
   dump workgroup on subnet  192.168.178.34: netmask=  255.255.255.0:
        WORKGROUP(1) current master browser = UNKNOWN
                OSMC 40819a03 (Samba 4.9.5-Debian)
[2022/04/10 16:29:27.395156,  4] ../source3/nmbd/nmbd_workgroupdb.c:165(find_workgroup_on_subnet)
  find_workgroup_on_subnet: workgroup search for WORKGROUP on subnet 192.168.178.34: found.
[2022/04/10 16:29:27.395333,  4] ../source3/nmbd/nmbd_workgroupdb.c:276(dump_workgroups)
  dump_workgroups()
   dump workgroup on subnet  192.168.178.34: netmask=  255.255.255.0:
        WORKGROUP(1) current master browser = UNKNOWN
                OSMC 40819a03 (Samba 4.9.5-Debian)
[2022/04/10 16:29:30.719911,  5] ../source3/nmbd/nmbd_packets.c:1912(read_packet)
  Received a packet of len 174 from (192.168.178.84) port 138
[2022/04/10 16:29:30.720152,  4] ../source3/nmbd/nmbd_packets.c:1296(process_dgram)
  process_dgram: datagram from WINDOWS_MACHINE_NAME<00> to WORKGROUP<1e> IP 192.168.178.84 for \MAILSLOT\BROWSE of type 11 len=6
[2022/04/10 16:29:30.720220,  4] ../source3/nmbd/nmbd_packets.c:117(debug_browse_data)
  debug_browse_data():
    0 char .OSMC.           hex 0b 4f 53 4d 43 00
[2022/04/10 16:29:30.720277,  4] ../source3/nmbd/nmbd_workgroupdb.c:165(find_workgroup_on_subnet)
  find_workgroup_on_subnet: workgroup search for WORKGROUP on subnet 192.168.178.34: found.
[2022/04/10 16:29:30.720324,  4] ../source3/nmbd/nmbd_workgroupdb.c:276(dump_workgroups)
  dump_workgroups()
   dump workgroup on subnet  192.168.178.34: netmask=  255.255.255.0:
        WORKGROUP(1) current master browser = UNKNOWN
                OSMC 40819a03 (Samba 4.9.5-Debian)
[2022/04/10 16:29:30.720856,  5] ../source3/nmbd/nmbd_packets.c:1912(read_packet)
  Received a packet of len 174 from (192.168.178.84) port 138
[2022/04/10 16:29:30.720995,  4] ../source3/nmbd/nmbd_packets.c:1296(process_dgram)
  process_dgram: datagram from WINDOWS_MACHINE_NAME<00> to WORKGROUP<1e> IP 192.168.178.84 for \MAILSLOT\BROWSE of type 11 len=6
[2022/04/10 16:29:30.721056,  4] ../source3/nmbd/nmbd_packets.c:117(debug_browse_data)
  debug_browse_data():
    0 char .OSMC.           hex 0b 4f 53 4d 43 00
[2022/04/10 16:29:30.721112,  4] ../source3/nmbd/nmbd_workgroupdb.c:165(find_workgroup_on_subnet)
  find_workgroup_on_subnet: workgroup search for WORKGROUP on subnet 192.168.178.34: found.

Thanks for all the help. After ~10hrs at it, I just went ahead and took the opportunity to get away from Win11 with a fresh Win10 install. All shares easily accessible.

I guess I’ll mark this as solution; OSMC was fine, even my Android could access the shares, so just reinstall Windows.

1 Like