Samba 4.x package support thread

Maybe I did something wrong, I'll give it another try in a few days...

OK, I found a solution. I also had to set:

server min protocol = NT1

to get it to work

Apparently, the default settings in samba4 are not the same as the default settings mentioned in smb.conf help. Default in samba4 is 'SMB2_02', and default according to help is 'LANMAN1'.

Thanks, case closed.

For the community it is good to know that this could be a problem when switching from samba3 to samba4.

Yes i had a request for the old protocols for ksmbd as well, so maybe i will just add a UCI/Luci setting like "Allow Legacy/insecure smb1 protocol" and make the associated changes on daemon startup, so users don't have to dig through this. Seems many embedded/iot devices still rely on smbv1.

1 Like

Or you can add this to the default smb.conf.template:

##Allow Legacy/insecure smb1 protocol
#server min protocol = NT1
#ntlm auth = ntlmv1-permitted

Maybe it is also a good idea to add a "Running config" tab in Luci, with output from 'testparm -sv'.

With smbv1 enabled, VLC on android tv pie seems still have issues.

BusyBox v1.30.1 () built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 19.07.2, r10947-65030d81f3
 -----------------------------------------------------
root@WRT1900ACS:~# opkg list_installed | grep samba4
luci-app-samba4 - git-20.057.55219-13dd17f-1
luci-i18n-samba4-zh-cn - git-20.057.55219-13dd17f-1
samba4-libs - 4.11.6-1
samba4-server - 4.11.6-1
root@WRT1900ACS:~# uci show samba4
samba4.@samba[0]=samba
samba4.@samba[0].workgroup='WORKGROUP'
samba4.@samba[0].charset='UTF-8'
samba4.@samba[0].interface='lan'
samba4.@samba[0].description='NAS'
samba4.@samba[0].macos='1'
samba4.@samba[0].allow_legacy_protocols='1'
samba4.@sambashare[0]=sambashare
samba4.@sambashare[0].name='NAS'
samba4.@sambashare[0].path='/mnt/nas'
samba4.@sambashare[0].users='yding'
samba4.@sambashare[0].read_only='no'
samba4.@sambashare[0].guest_ok='no'
samba4.@sambashare[0].create_mask='0744'
samba4.@sambashare[0].dir_mask='0744'
  • Without smbv1 enabled, VLC can see the samba share, but after input username and password, it loads forever, never get into shared folder.
  • With smbv1 enabled, VLC can login and see folders, but it keeps popup the window to input username and password.

With macOS and iPhone, it works just fine. For Android, solid explorer works even without smbv1 enabled. I guess it use smb2 and above. For VLC android, the issue as described above.

Update: Seems it's VLC's own bug. Many users complained the same issue in VLC forum.

Just a quick heads-up: luci-app-samba4 seems to be broken in somewhat current snapshots. Neither does it recognize already defined shares nor does it allow to add new shares (and, no, adding luci-compat does not help). Not a huge deal for me personally since I'm comfortable adding shares in UCI, but, yeah, it's what it is.

Hopefully i have some time next weekend and can update/fix some of the issues.

1 Like

@greekstreet
VLC on Android works fine without enabling SMB1

I tired VLC 3.2.10 on Mibox S running Android TV 9.0. Still cannot connect. Kodi works fine. It’s probably VLC bug. I noticed the log as below though.

Sun Apr 19 12:20:49 2020 daemon.err smbd[1591]: [2020/04/19 12:20:49.363922,  0] ../../source3/smbd/smb2_server.c:744(smb2_validate_message_id)
Sun Apr 19 12:20:49 2020 daemon.err smbd[1591]:   smb2_validate_message_id: smb2_validate_message_id: client used more credits than granted, mid 5, charge 1, credits_granted 0, seqnum low/range: 5/0

I hope it helps.

I have the same problem with VLC 3.2.11 on Android and Samba 4.11 running on Arch Linux. Previous versions of Samba had no problem, and other SMB clients have no problem. I agree, it's probably a VLC bug, and a weird one at that.

Could be that Samba 4.11 dropped support for SMBv1; see: https://github.com/videolabs/libdsm/issues/110

I saw able to fix this by adding the following to my smb.conf in [global]:

client min protocol = CORE
server min protocol = CORE

This may be of help to anyone trying to use the openwrt package-builder builder.sh on Ubuntu 18.04 LTS.

When I first tried to run it I got a number of errors. Namely,

root@home:/usr/src/openwrt-package-builder# ./builder.sh build config.txt 
./builder.sh: 25: [: Linux: unexpected operator
....
Docker version 19.03.8, build afacb8b7f0
./builder.sh: 47: ./builder.sh: function: not found

The problem: This script depends on bash. 'function' is a bash creature. But with the new Ubuntu, and maybe some others: /bin/sh -> dash
To cut to the solution: Change the first line on builder.sh to like this:

clay@home:/usr/src/openwrt-package-builder$ head -2  builder.sh
#!/bin/bash
# Docker based OpenWRT package build environment

I hope this saves someone the trouble I've had.

I've read a part of the thread and the general consensus seems to be that samba4 should be as fast as samba (3.6). This is not the case for me and samba3.6 is significantly faster 80MB/s vs samba4 60MB/s

  • I've checked processor utilization and memory and both have some room (80MB/s is close to my limit which is up to 90MB/s - depends on congestion).
  • I've tried to set max protocol to SMB2 in samba4. This did not improve the transfer speed, although I'm not sure if SMB2 default in samba4 is the same as SMB2 default in samba3.6
  • ksmbd is as fast as samba4

I don't want to optimize the transfer speed in general just wondering why samba4 is slower. Any ideas?

Not really, for most users samba4 is similar or faster than samba36 otherwise we would see more performance regression issues open. I think its just that samba is a huge project and has like 80+ performance relevant options to set, so the permutations are huge. The defaults work fine, but given some setup (hardware/software/config) a small change might be needed, yet this boils down to a frustrating try&error session of smb.conf settings.

We now at least have ksmbd to compare speeds against, yet in your case it matches samba4.

2 Likes

Hello,
i can no more build my image (based on last hnyman's master) when selecting samba4 server package.
Well, i think anyway i'll stay with ksmbd (i do not need advanced features, i'm just sharing my transmission download folder..), but i'm curious to understand why i can no more build samba4.

this is what i see in CLI when building:

...
make[4]: Entering directory '/home/massi/openwrt/master/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/Python-3.8.3'
make[1]: *** [package/Makefile:107: /home/massi/openwrt/master/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/stamp/.package_compile] Error 2
make: *** [/home/massi/openwrt/master/include/toplevel.mk:224: world] Error 2

that seems not so clear.
but also the build.log file seems unclear

...
rm -rf /home/massi/openwrt/master/tmp/stage-python3
touch /home/massi/openwrt/master/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/stamp/.python3_installed
make[3]: Leaving directory '/home/massi/openwrt/master/feeds/packages/lang/python/python3'
time: package/feeds/packages/python3/compile#645.11#27.82#455.59
make[2]: Leaving directory '/home/massi/openwrt/master'
make[1]: *** [package/Makefile:107: /home/massi/openwrt/master/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/massi/openwrt/master'
make: *** [/home/massi/openwrt/master/include/toplevel.mk:224: world] Error 2

ideas? :slight_smile:
thanks

Also cant really see whats the issue, i work on 4.12 atm, but have some problems getting the pearl stuff to work.

It's failing on the configure stage for me:

Checking for system z (>=1.2.3)                                                   : yes 
Checking for library z                                                            : no 
Checking for zlibVersion                                                          : not found 
Checking for library z                                                            : no 
Checking for zlibVersion                                                          : not found 
ERROR: System library z of version 1.2.3 not found, and bundling disabled
make[3]: *** [Makefile:443: /home/jc/build/openwrt/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/samba-4.11.6/.configured_19bd79387a3cc6f02e16e47173e16e34] Error 1

Checking the staging dir, libz.a is built but I don't see a libz.so or libz.so.1 if that's what the configure script is looking for...
I don't know enough about samba4's crazy build system to debug this myself.

Oh nevermind, ksmbd is hella sweet, I'm joining that train!

1 Like