What's new

Entware Looking for a guide on using Entware's Samba v4

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

iTyPsIDg

Senior Member
I would like to switch to Entware's Samba v4 because I'm hoping the added support for TimeMachine with Samba 4.8 would help resolve my current TimeMachine issues.

I tried setting it up, but it didn't work for me, and the instructions at OpenWrt didn't help me. I currently use two additional user accounts so that we each have access to our own folder on a TimeMachine partition and our own folder on a Data partition.

Does someone have a guide or could someone that's done it write up a guide to follow? I ended up reverting back to the version provided by RMerlin in the Asuswrt-Merlin firmware; it may not work with my TimeMachine since I upgraded to 12.3, but at least the Data partition works.

I got the idea from this thread, but it doesn't have enough details for me to replicate it.
 
Last edited:
Just make a copy of your current /etc/smb.conf running under Merlin. Then use that for the Entware config. Check the startup messages for errors in case there's something that needs to be tweaked.
 
Here's what I did:
  1. Turn off "Enable Share" under USB Application - Network Place (Samba) Share / Cloud Disk.
  2. Install samba4-server: opkg install samba4-server
  3. Copy /etc/smb.conf to /opt/etc/samba: cp /etc/smb.conf /opt/etc/samba
  4. Restart Samba by running /opt/etc/init.d/S91smb restart
    1. Less:
      Shutting down SMB services:
      kill: you need to specify whom to kill
      FAIL
      Shutting down NMB services:
      kill: you need to specify whom to kill
      FAIL
      Starting SMB services:
      OK
      Starting NMB services:
      OK
  5. Reboot router
  6. Investigate contents of /opt/var/log/samba (Empty)
  7. Restart Samba again
    1. Less:
      Shutting down SMB services:
      kill: you need to specify whom to kill
      FAIL
      Shutting down NMB services:
      OK
      Starting SMB services:
      OK
      Starting NMB services:
      OK

I still can't seem to connect and I don't have any idea why. I keep getting connection failed in Finder on my Macbook Pro.

FE File Explorer on my iPhone seems to indicate the port isn't listening, so I tried netstat -tunlp | grep 445 on the router and got no results.
 
Last edited:
There are a number of directives in the Asus generated smb.conf that the Entware samba4-server doesn’t deal with/understand.

Try to comment out the following and see if samba4 starts:

#display charset = UTF8

#auth methods = guest

#use spnego = yes

While your editing, you might consider also commenting out max protocol = SMB2
 
Ok, so it looks like /opt/var/log/samba is supposed to be empty.

I reviewed /opt/var/log/log.smbd and found the following:
Less:
[2022/04/01 13:30:42.116402,  0] ../../source3/smbd/server.c:1790(main)
  smbd version 4.14.7 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2021
invalid permissions on directory '/opt/var/run/samba/ncalrpc': has 0777 should be 0755
dcesrv_create_ncalrpc_socket: Failed to create ncalrpc socket '/opt/var/run/samba/ncalrpc/DEFAULT': File exists
dcesrv_setup_endpoint_sockets: Failed to setup 'ncalrpc:[DEFAULT]' sockets for 'svcctl' 'spoolss' 'wkssvc' 'dssetup' 'netdfs' 'samr' 'lsarpc' 'srvsvc' 'winreg' 'mgmt' : NT_STATUS_OBJECT_NAME_COLLISION
dcesrv_init: Failed to init DCE/RPC endpoints: NT_STATUS_OBJECT_NAME_COLLISION
main: Failed to setup RPC server: NT_STATUS_OBJECT_NAME_COLLISION
exit_daemon: daemon failed to start: Samba cannot setup ep pipe, error code 13
[2022/04/01 13:31:20.423730,  0] ../../source3/smbd/server.c:1790(main)
  smbd version 4.14.7 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2021
[2022/04/01 13:31:20.424495,  1] ../../lib/param/loadparm.c:1873(lpcfg_do_global_parameter)
  lpcfg_do_global_parameter: WARNING: The "syslog" option is deprecated
[2022/04/01 13:31:20.425216,  2] ../../source3/lib/tallocmsg.c:84(register_msg_pool_usage)
  Registered MSG_REQ_POOL_USAGE
[2022/04/01 13:31:20.425256,  2] ../../source3/lib/dmallocmsg.c:78(register_dmalloc_msgs)
  Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED
lp_load_ex: refreshing parameters
Initialising global parameters
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[global]"
lpcfg_do_global_parameter: WARNING: The "syslog" option is deprecated
adding IPC service
added interface lo ip=127.0.0.1 bcast=127.255.255.255 netmask=255.0.0.0
added interface br0 ip=192.168.50.1 bcast=192.168.50.255 netmask=255.255.255.0
loaded services
INFO: Profiling support unavailable in this build.
Becoming a daemon.
Registered MSG_REQ_POOL_USAGE
pid_to_procid: messaging_dgm_get_unique failed: No such file or directory
Registered MSG_REQ_POOL_USAGE
Registered MSG_REQ_POOL_USAGE
Failed to fetch domain sid for WORKGROUP_NAME
DCERPC endpoint server 'winreg' registered
DCERPC endpoint server 'srvsvc' registered
DCERPC endpoint server 'lsarpc' registered
DCERPC endpoint server 'samr' registered
DCERPC endpoint server 'netdfs' registered
DCERPC endpoint server 'dssetup' registered
DCERPC endpoint server 'wkssvc' registered
DCERPC endpoint server 'spoolss' registered
DCERPC endpoint server 'svcctl' registered
DCERPC endpoint server 'ntsvcs' registered
DCERPC endpoint server 'eventlog' registered
DCERPC endpoint server 'initshutdown' registered
Initialise the svcctl registry keys if needed.
Initialise the eventlog registry keys if needed.
invalid permissions on directory '/opt/var/run/samba/ncalrpc': has 0777 should be 0755
dcesrv_create_ncalrpc_socket: Failed to create ncalrpc socket '/opt/var/run/samba/ncalrpc/DEFAULT': File exists
dcesrv_setup_endpoint_sockets: Failed to setup 'ncalrpc:[DEFAULT]' sockets for 'svcctl' 'spoolss' 'wkssvc' 'dssetup' 'netdfs' 'samr' 'lsarpc' 'srvsvc' 'winreg' 'mgmt' : NT_STATUS_OBJECT_NAME_COLLISION
dcesrv_init: Failed to init DCE/RPC endpoints: NT_STATUS_OBJECT_NAME_COLLISION
main: Failed to setup RPC server: NT_STATUS_OBJECT_NAME_COLLISION
exit_daemon: daemon failed to start: Samba cannot setup ep pipe, error code 13
 
Here is my /opt/var/log/log.nmdb:
Less:
[2022/04/01 13:30:42.242311,  0] ../../source3/nmbd/nmbd.c:961(main)
  nmbd version 4.14.7 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2021
daemon_ready: daemon 'nmbd' finished starting up and ready to serve connections
*****

Samba name server RT-AX86U-ADA0 is now a local master browser for workgroup WORKGROUP_NAME on subnet 192.168.50.1

*****
[2022/04/01 13:31:20.549016,  0] ../../source3/nmbd/nmbd.c:961(main)
  nmbd version 4.14.7 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2021
[2022/04/01 13:31:20.549862,  1] ../../lib/param/loadparm.c:1873(lpcfg_do_global_parameter)
  lpcfg_do_global_parameter: WARNING: The "syslog" option is deprecated
Registered MSG_REQ_POOL_USAGE
Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED
lp_load_ex: refreshing parameters
Initialising global parameters
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[global]"
lpcfg_do_global_parameter: WARNING: The "syslog" option is deprecated
services not loaded
Becoming a daemon.
Registered MSG_REQ_POOL_USAGE
Opening sockets 137
open_sockets: Broadcast sockets opened.
added interface lo ip=127.0.0.1 bcast=127.255.255.255 netmask=255.0.0.0
added interface br0 ip=192.168.50.1 bcast=192.168.50.255 netmask=255.255.255.0
making subnet name:192.168.50.1 Broadcast address:192.168.50.255 Subnet mask:255.255.255.0
create_subnets: Ignoring loopback interface.
making subnet name:UNICAST_SUBNET Broadcast address:0.0.0.0 Subnet mask:0.0.0.0
making subnet name:REMOTE_BROADCAST_SUBNET Broadcast address:0.0.0.0 Subnet mask:0.0.0.0
load_lmhosts_file: Can't open lmhosts file /opt/etc/samba/lmhosts. Error was No such file or directory
Loaded hosts file /opt/etc/samba/lmhosts
add_name_to_subnet: Added netbios name *<00> with first IP 192.168.50.1 ttl=0 nb_flags= 0 to subnet 192.168.50.1
add_name_to_subnet: Added netbios name *<20> with first IP 192.168.50.1 ttl=0 nb_flags= 0 to subnet 192.168.50.1
add_name_to_subnet: Added netbios name __SAMBA__<20> with first IP 192.168.50.1 ttl=0 nb_flags= 0 to subnet 192.168.50.1
add_name_to_subnet: Added netbios name __SAMBA__<00> with first IP 192.168.50.1 ttl=0 nb_flags= 0 to subnet 192.168.50.1
create_server_on_workgroup: Created server entry RT-AX86U-ADA0 of type 40819a03 (Samba on Entware) on workgroup WORKGROUP_NAME.
initiate_myworkgroup_startup: Added server name entry RT-AX86U-ADA0 on subnet 192.168.50.1
add_name_to_subnet: Added netbios name *<00> with first IP 192.168.50.1 ttl=0 nb_flags= 0 to subnet UNICAST_SUBNET
add_name_to_subnet: Added netbios name *<20> with first IP 192.168.50.1 ttl=0 nb_flags= 0 to subnet UNICAST_SUBNET
add_name_to_subnet: Added netbios name __SAMBA__<20> with first IP 192.168.50.1 ttl=0 nb_flags= 0 to subnet UNICAST_SUBNET
add_name_to_subnet: Added netbios name __SAMBA__<00> with first IP 192.168.50.1 ttl=0 nb_flags= 0 to subnet UNICAST_SUBNET
add_name_to_subnet: Added netbios name RT-AX86U-ADA0<20> with first IP 192.168.50.1 ttl=0 nb_flags= 0 to subnet UNICAST_SUBNET
add_name_to_subnet: Added netbios name RT-AX86U-ADA0<03> with first IP 192.168.50.1 ttl=0 nb_flags= 0 to subnet UNICAST_SUBNET
add_name_to_subnet: Added netbios name RT-AX86U-ADA0<00> with first IP 192.168.50.1 ttl=0 nb_flags= 0 to subnet UNICAST_SUBNET
add_name_to_subnet: Added netbios name WORKGROUP_NAME<00> with first IP 192.168.50.1 ttl=0 nb_flags=80 to subnet UNICAST_SUBNET
add_name_to_subnet: Added netbios name WORKGROUP_NAME<1e> with first IP 192.168.50.1 ttl=0 nb_flags=80 to subnet UNICAST_SUBNET
add_name_to_subnet: Added netbios name *<00> with first IP 192.168.50.1 ttl=0 nb_flags= 0 to subnet REMOTE_BROADCAST_SUBNET
add_name_to_subnet: Added netbios name *<20> with first IP 192.168.50.1 ttl=0 nb_flags= 0 to subnet REMOTE_BROADCAST_SUBNET
add_name_to_subnet: Added netbios name __SAMBA__<20> with first IP 192.168.50.1 ttl=0 nb_flags= 0 to subnet REMOTE_BROADCAST_SUBNET
add_name_to_subnet: Added netbios name __SAMBA__<00> with first IP 192.168.50.1 ttl=0 nb_flags= 0 to subnet REMOTE_BROADCAST_SUBNET
daemon_ready: daemon 'nmbd' finished starting up and ready to serve connections
send_host_announcement: type 819a03 for host RT-AX86U-ADA0 on subnet 192.168.50.1 for workgroup WORKGROUP_NAME
add_name_to_subnet: Added netbios name RT-AX86U-ADA0<20> with first IP 192.168.50.1 ttl=0 nb_flags= 0 to subnet 192.168.50.1
add_name_to_subnet: Added netbios name RT-AX86U-ADA0<03> with first IP 192.168.50.1 ttl=0 nb_flags= 0 to subnet 192.168.50.1
add_name_to_subnet: Added netbios name RT-AX86U-ADA0<00> with first IP 192.168.50.1 ttl=0 nb_flags= 0 to subnet 192.168.50.1
add_name_to_subnet: Added netbios name WORKGROUP_NAME<00> with first IP 192.168.50.1 ttl=0 nb_flags=80 to subnet 192.168.50.1
add_name_to_subnet: Added netbios name WORKGROUP_NAME<1e> with first IP 192.168.50.1 ttl=0 nb_flags=80 to subnet 192.168.50.1
write_browse_list: Wrote browse list into file /opt/var/cache/samba/browse.dat
check_for_master_browser_fail: Forcing election on workgroup WORKGROUP_NAME subnet 192.168.50.1
check_elections: >>> Starting election for workgroup WORKGROUP_NAME on subnet 192.168.50.1 <<<
send_election_dgram: Sending election packet for workgroup WORKGROUP_NAME on subnet 192.168.50.1
send_election_dgram: Sending election packet for workgroup WORKGROUP_NAME on subnet 192.168.50.1
send_election_dgram: Sending election packet for workgroup WORKGROUP_NAME on subnet 192.168.50.1
send_election_dgram: Sending election packet for workgroup WORKGROUP_NAME on subnet 192.168.50.1
send_election_dgram: Sending election packet for workgroup WORKGROUP_NAME on subnet 192.168.50.1
run_elections: >>> Won election for workgroup WORKGROUP_NAME on subnet 192.168.50.1 <<<
become_local_master_browser: Starting to become a master browser for workgroup WORKGROUP_NAME on subnet 192.168.50.1
become_local_master_browser: first stage - attempt to register ^1^2__MSBROWSE__^2^1
write_browse_list: Wrote browse list into file /opt/var/cache/samba/browse.dat
add_name_to_subnet: Added netbios name __MSBROWSE__<01> with first IP 192.168.50.1 ttl=0 nb_flags=80 to subnet 192.168.50.1
become_local_master_stage1: go to stage 2: register the WORKGROUP_NAME<1d> name.
add_name_to_subnet: Added netbios name __MSBROWSE__<01> with first IP 192.168.50.1 ttl=0 nb_flags=80 to subnet UNICAST_SUBNET
add_name_to_subnet: Added netbios name WORKGROUP_NAME<1d> with first IP 192.168.50.1 ttl=0 nb_flags= 0 to subnet 192.168.50.1
become_local_master_stage2: registered as master browser for workgroup WORKGROUP_NAME on subnet 192.168.50.1
broadcast_announce_request: sending announce request for workgroup WORKGROUP_NAME to subnet 192.168.50.1
add_name_to_subnet: Added netbios name WORKGROUP_NAME<1d> with first IP 192.168.50.1 ttl=0 nb_flags= 0 to subnet UNICAST_SUBNET
*****

Samba name server RT-AX86U-ADA0 is now a local master browser for workgroup WORKGROUP_NAME on subnet 192.168.50.1

*****
send_local_master_announcement: type 849a03 for name RT-AX86U-ADA0 on subnet 192.168.50.1 for workgroup WORKGROUP_NAME
send_workgroup_announcement: on subnet 192.168.50.1 for workgroup WORKGROUP_NAME
write_browse_list: Wrote browse list into file /opt/var/cache/samba/browse.dat
send_local_master_announcement: type 849a03 for name RT-AX86U-ADA0 on subnet 192.168.50.1 for workgroup WORKGROUP_NAME
send_workgroup_announcement: on subnet 192.168.50.1 for workgroup WORKGROUP_NAME
send_local_master_announcement: type 849a03 for name RT-AX86U-ADA0 on subnet 192.168.50.1 for workgroup WORKGROUP_NAME
send_workgroup_announcement: on subnet 192.168.50.1 for workgroup WORKGROUP_NAME
I started very simple with the smb.conf file:
INI:
[global]
        netbios name = RT-AX86U-ADA0
        interfaces = lo br0
        server string = Samba on Entware
        workgroup = WORKGROUP_NAME
        guest account = nobody
        security = user
        map to guest = Bad User
        guest ok = yes
        guest only = no
        timestamp logs = no
        preserve case = yes
        short preserve case = yes
        socket options = TCP_NODELAY SO_KEEPALIVE IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536
        log level = 3
        syslog = 0
        passdb backend = smbpasswd
        smb encrypt = disabled
        smb passwd file = /etc/samba/smbpasswd
        printcap name = /opt/etc/printcap
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top