A correct method of configuring Samba for browsing SMB shares in a home network
October 17, 2016 25 Comments
SMB
SMB (Server Message Block) is the underlying protocol that Microsoft Windows computers use to connect to resources, such as file shares and printers, and to transfer information when the connections are established. Samba is the Linux implementation of SMB that allows file and printer information to be transferred between Windows and Linux computers. An early variant of the SMB protocol is known as ‘CIFS’ (Common Internet File System). CIFS is actually obsolete, so the correct term to use these days is ‘SMB’ (see the blog post Why You Should Never Again Utter The Word, "CIFS"), although ‘CIFS’ is still used sometimes when referring to SMB.
Terminology
You are likely to come across several terms when reading about Samba, such as NetBIOS, Active Directory (AD), Lightweight Directory Access Protocol (LDAP), Kerberos, Windows Internet Name Service (WINS) and Winbind, to name but a few. Most are used in larger corporate or enterprise networks but you can ignore most of them – only broadcast NetBIOS name resolution or WINS are necessary to configure Samba in small home networks. For example, my home network uses broadcast NetBIOS name resolution and sometimes has up to 15 devices connected (Linux, Windows 7/10, macOS, Android and iOS), all of which can browse file shares using SMB/Samba.
Note: You should not use Broadcast NetBIOS Name Resolution and WINS at the same time.
To explain the terminology – Active Directory is a central database of user accounts and passwords used primarily in Windows networks to authenticate users, and LDAP is the protocol that clients and servers use to access the Active Directory database. Kerberos is a separate encrypted authentication mechanism used for client-server applications, such as computers that access a specific file or web server, or SQL database. WINS is a mechanism for storing Windows computer name to IP address mappings on a central server – the WINS Server. Computers in a LAN interrogate the WINS server to obtain the IP addresses of other computers. It’s a bit like DNS except that the WINS Server stores Windows computer names rather than URLs or domain names. Winbind is a Unix/Linux mechanism that allows Windows NT accounts to look like a Unix service to Unix/Linux machines.
NetBIOS
How is NetBIOS relevant to Samba? Samba uses NetBIOS in three different ways:
- NetBIOS over UDP Port 137 to advertise Windows computer names for name to IP address resolution;
- NetBIOS over UDP Port 138 to advertise services that the computer offers and to elect a ‘Master Browser’ (explained below);
- SMB over NetBIOS over TCP/IP Port 139 to connect to file shares or printers. Once connected, the computers may negotiate using SMB direct over TCP/IP Port 445 to improve efficiency of the connection.
NetBIOS over UDP (Port 137) is a connectionless broadcast protocol that Windows machines use to advertise over the LAN their names and corresponding IP addresses. Other computers receive the broadcasts and cache the names and IP addresses in a name to IP address mapping table.
NetBIOS over UDP (Port 138) is a connectionless broadcast protocol that Windows machines use to advertise their eligibility to become the Master Browser or Backup Browser for a Windows Workgroup in the LAN. An automatic election process elects only one machine in a Workgroup to become the Master Browser for that workgroup, and elects one or more ‘Backup Browsers’ in the Workgroup. The Master Browser and Backup Browser(s) collate a list of all the computers in the Workgroup and the services that they offer. It is more efficient for a single computer to assume the master role and to collate the information than it is for the information to remain distributed. When you click on ‘Network’† in File Explorer’s ‘Network Neighbourhood’‡ window, your computer interrogates the Master Browser(s) to obtain a list of the Windows Workgroups in the LAN, the members of the Workgroup(s) and the file and printer services that each Workgroup member offers. If the Master Browser fails or is disconnected, a re-election takes place and a new Master Browser is elected from the list of Backup Browsers in that Workgroup. The same process occurs if you are using a Linux file manager (Dolphin in KDE, Nautilus in GNOME, etc.) with Samba. You can configure the ‘priority’ of the Samba server in each machine in the Workgroup so that it is either more likely or less likely to be elected the Master Browser for the Workgroup. You could even configure Samba on a Linux machine so that it will never be a Master Browser. (It is also possible to configure a Windows machine so that it will never be a Master Browser.)
† Renamed ‘Entire Network’ in some versions of Windows.
‡ Renamed ‘My Network Places’ or simply ‘Network’ in some versions of Windows.
SMB over NetBIOS over TCP/IP (Port 139) is a connection orientated protocol that Windows computers use to connect to file shares and printers, to retrieve directory listings and to transfer files. Having obtained a list of computers and file shares from the Master Browser, if you click on a particular file share to connect to it, your computer looks up the name of the target computer in the local name table, obtains the target computer’s IP address and initiates a SMB over NetBIOS over TCP/IP connection to it. The target computer then issues a username and password prompt for you to complete the connection. If authentication is successful, the SMB protocol is used to transfer a directory listing of the contents of the share. If you drag and drop a file from the share to your local machine, or vice-versa, SMB is used to transfer the file. Behind the scenes, during the initial connection set-up, your computer and the target carry out a negotiation. If both machines support SMB direct over TCP/IP, the directory listing and subsequent file transfer are transported using SMB over TCP/IP Port 445. This is much more efficient because it eliminates completely the NetBIOS overhead.
When you install and configure Samba on a Linux computer, the ‘smbd
‘ and ‘nmbd
‘ daemons enable all of the functionality above. In a small network you do not need to enable or use AD, LDAP, Kerberos, WINS, Winbind or anything else for that matter. Samba and its built-in NetBIOS mechanisms will allow you to participate in a Windows Workgroup environment to share and use folders, files and printers.
Workgroups
The majority of Windows computers running in home networks are configured, by default, in a single Workgroup. A Workgroup is a simple way for computers in small networks to advertise and share resources, such as folders and printers, with other members of the same group. You can configure multiple Workgroups in the same LAN but each computer can belong to only one Workgroup. The theory is that different computers can share different resources within their group.
Please Note: A Windows Workgroup is not the same thing as a Windows HomeGroup. The latter concept was introduced in Windows 7 and is an ‘evolution’ of the Workgroup concept, in which you share folders and files but specify a pre-determined group password. All computers wishing to join the HomeGroup specify the same password to connect to the resources in that group. Samba does not participate in Windows HomeGroups because the latter is a Windows-only feature.
Configuring Samba
Firstly, install Samba on the Linux computer. Use Samba 4 and avoid Samba 3, which is obsolete. I have several laptops and a Network Addressable Storage (NAS) server, all running Linux with various releases of Samba 4. I also have a desktop computer running Windows 10 for family use. In addition, family and friends connect various laptops running Windows 7 and Windows 10 to my home network, as well as tablets and smartphones (see How to Access Shared Windows Folders on Android, iPad, and iPhone). This NAS runs 24/7 so I could have configured Samba to always make it the Master Browser but this is not necessary as the remaining computers in the network will elect a new Master Browser should the NAS fail.
Below is a summary of the steps to configure Samba in a Windows Workgroup:
- Configure the same Workgroup name on all of the Windows computers (for example, How to Change Workgroup in Windows 10). The default Windows 10 Workgroup is called ‘
WORKGROUP
‘. In the example further down I used the Windows GUI to change the Workgroup name to ‘GREENGABLES
‘. There is plenty of information on the Internet about how to configure Windows file sharing so I won’t repeat any of it here (for example, How to Enable Network Discovery and Configure Sharing Options in Windows 10 and How to set up file sharing on Windows 10 (Share files using File Explorer)).
- Configure Samba on the Linux machines by editing the file ‘
/etc/samba/smb.conf
‘ on each. The contents of the file ‘smb.conf
‘ are shown below for a Linux NAS and two Linux laptops. The NetBIOS name of the NAS is ‘akhanaten
‘ and the laptops are ‘tutankhamun
‘ and ‘smenkhkare
‘. You can use either of thesmb.conf
files of the two laptops as a template for thesmb.conf
file of any Linux computer in your own home network. You can ignore thesmb.conf
file of the NAS if you simply want to be able to browse SMB/Samba shares on other computers in your home network.
- Use the command ‘
pdbedit
‘ on each Linux machine to define and configure the Samba users on that machine. The command ‘smbpasswd
‘ is an alternative to ‘pdbedit
‘ but I recommend you use the latter, as ‘smbpasswd
‘ is deprecated. Each Samba user must exist as a Linux user because it is the Linux users who own the shares and are used for authentication.
- The NAS has Linux users ‘
anne
‘, ‘marilla
‘, ‘matthew
‘ and ‘guest
‘, whereas each of the laptops has a Linux user ‘anne
‘. The user name does not have to be the same on different computers.
- The purpose of each variable in ‘
smb.conf
‘ is explained on the applicable Samba manual page (enter the command ‘man smb.conf
‘ in a terminal window) and the Samba documentation page for smb.conf on the Web.
Furthermore, make sure the Winbind daemon is not running. If Winbind is installed, make sure the service is not running and is disabled.
smb.conf
of NAS running Ubuntu Server Edition:
[global] # SMB uses ports 139 & 445, as explained in this blog post smb ports = 139 445 netbios name = akhanaten workgroup = greengables # Use either NetBIOS broadcast for name resolution or entries in the /etc/hosts file name resolve order = bcast host # Don't care if the workgroup name is upper or lower case case sensitive = no # User authentication is used to access the shares security = user map to guest = bad user guest account = guest # Don't allow the use of root for network shares invalid users = root # Domain master only applies to LANs that are inter-connected across a WAN domain master = no # This machine is eligible to be a Master Browser and its priority is 4 # (the higher the os level, the more preferred to be Master Browser) # (the maximum allowable value for os level is 255) preferred master = yes os level = 4 dns proxy = no # Always advertise the shares automatically auto services = global # Interfaces on which to listen for NetBIOS broadcasts and to allow SMB connections # Include "lo" because it is the internal interface # em1 is the name of the Ethernet interface, found using the ifconfig command interfaces = lo em1 bind interfaces only = yes log file = /var/log/samba/log.%m max log size = 1000 syslog = 0 panic action = /usr/share/samba/panic-action %d server role = standalone server passdb backend = tdbsam obey pam restrictions = yes # Don't synchronise the Linux and Samba user passwords - they can be different unix password sync = no passwd program = /usr/bin/passwd %u passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* . pam password change = yes # This Samba configuration does not advertise any printers load printers = no # File to map long usernames to shorter Unix usernames, if necessary username map = /etc/samba/smbusers # Allow guest user access if specified in the shares guest ok = yes # First user share is called "anne" - only user "anne" specified below can connect to the share [anne] comment = "anne share" path = /nas/shares/anne writeable = yes valid users = anne # Second user share is called "marilla" - only user "marilla" specified below can connect to the share [marilla] comment = "marilla share" path = /nas/shares/marilla writeable = yes valid users = marilla # Third user share is called "matthew" - only user "matthew" specified below can connect to the share [matthew] comment = "matthew share" path = /nas/shares/matthew writeable = yes valid users = matthew # Fourth user share is called "guest" - any user can connect to the share [guest] comment = "guest account" path = /nas/shares/guest writeable = yes guest ok = yes valid users = guest anne marilla matthew
smb.conf of laptop #1 running Gentoo Linux:
[global] ;no need to specify 'smb ports' as ports 139 & 445 used by default workgroup = GREENGABLES netbios name = tutankhamun case sensitive = no browseable = yes ;If this machine becomes a Master Browser, the following parameter allows it to hold the browse list browse list = yes printcap name = cups printing = cups log file = /var/log/samba/log.%m max log size = 50 security = user map to guest = bad user encrypt passwords = yes passdb backend = tdbsam domain master = no local master = yes preferred master = yes ; os level = 6 on the other laptop, so I have made it 5 on this laptop. os level = 5 name resolve order = bcast wins support = no dns proxy = no ;Listen for NetBIOS on Ethernet and Wireless interfaces ;Names of the interfaces found using ifconfig command interfaces = enp4s0f1 wlp3s0 [netlogon] comment = Network Logon Service path = /var/lib/samba/netlogon guest ok = yes [printers] comment = All Printers path = /var/spool/samba guest ok = yes printable = yes create mask = 0700 [print$] path = /var/lib/samba/printers write list = @adm root guest ok = yes [anne-share] path = /home/anne/anne-share/ guest ok = yes ;read only = no writeable = yes browseable = yes valid users = anne [Public] path = /home/anne/Public/ guest ok = yes ;read only = no writeable = yes browseable = yes
smb.conf of laptop #2 running Gentoo Linux:
[global] ;no need to specify 'smb ports' as ports 139 & 445 used by default workgroup = GREENGABLES netbios name = smenkhkare case sensitive = no browseable = yes ;If this machine becomes a Master Browser, the following parameter allows it to hold the browse list browse list = yes printcap name = cups printing = cups log file = /var/log/samba/log.%m max log size = 50 security = user map to guest = bad user encrypt passwords = yes passdb backend = tdbsam domain master = no local master = yes preferred master = yes ; os level = 5 on the other laptop so I have made it 6 on this laptop os level = 6 name resolve order = bcast wins support = no dns proxy = no ;Listen for NetBIOS on Ethernet and Wireless interfaces ;Names of the interfaces found using ifconfig command interfaces = eth0 wlan0 [netlogon] comment = Network Logon Service path = /var/lib/samba/netlogon guest ok = yes [printers] comment = All Printers path = /var/spool/samba guest ok = yes printable = yes create mask = 0700 [print$] path = /var/lib/samba/printers write list = @adm root guest ok = yes [anne-share] path = /home/anne/share-share/ guest ok = yes ;read only = no writeable = yes browseable = yes valid users = anne [Public] path = /home/anne/Public/ guest ok = yes ;read only = no writeable = yes browseable = yes
Samba Commands
The following are Samba commands you can use on any of the Linux computers to find information on the Samba shares.
The ‘smbtree
‘ command lists the computers currently using SMB in the local network:
user $ smbtree
GREENGABLES
\\AKHANATEN Samba 4.3.11-Ubuntu
\\AKHANATEN\IPC$ IPC Service (Samba 4.3.11-Ubuntu)
\\AKHANATEN\guest guest account
\\AKHANATEN\matthew matthew share
\\AKHANATEN\marilla marilla share
\\AKHANATEN\anne anne share
\\SMENKHKARE Samba 4.2.14
\\SMENKHKARE\Samsung_CLX-8385ND Samsung CLX-8385ND
\\SMENKHKARE\Canon_MP510_Printer Canon MP510 Printer
\\SMENKHKARE\Virtual_PDF_Printer Virtual PDF Printer
\\SMENKHKARE\Canon_MP560_WiFi Canon MP560 WiFi
\\SMENKHKARE\IPC$ IPC Service (Samba 4.2.14)
\\SMENKHKARE\Public
\\SMENKHKARE\anne-share
\\SMENKHKARE\print$
\\SMENKHKARE\netlogon Network Logon Service
\\TUTANKHAMUN Samba 4.2.11
\\TUTANKHAMUN\Samsung_Xpress_C460FW Samsung Xpress C460FW
\\TUTANKHAMUN\Canon_MP560_Printer Canon PIXMA MP560
\\TUTANKHAMUN\Canon_MP510_Printer Canon PIXMA MP510
\\TUTANKHAMUN\Virtual_PDF_Printer Virtual PDF Printer
\\TUTANKHAMUN\IPC$ IPC Service (Samba 4.2.11)
\\TUTANKHAMUN\Public
\\TUTANKHAMUN\anne-share
\\TUTANKHAMUN\print$
\\TUTANKHAMUN\netlogon Network Logon Service
HOME
\\BTHUB5 BT Home Hub 5.0A File Server
\\BTHUB5\IPC$ IPC Service (BT Home Hub 5.0A File Server)
‘BTHUB5
‘ is a BT Home Hub 5 (a network router and broadband modem). Notice that it is configured by default to be in a Windows Workgroup named ‘HOME
‘. The BT Home Hub 5 has a USB port to which an external USB HDD could be attached, so I assume computers in the home network could have been configured to use the HOME
Workgroup instead of GREENGABLES
and hence access that USB HDD, i.e. use it as a NAS. However, no HDD is attached to the BT Home Hub 5, so just ignore the BTHUB5
device and the HOME
Workgroup.
The ‘nmblookup
‘ command is used to see which services each computer offers. The strings ‘..__MSBROWSE__.
‘ and ‘<1d>
‘ in the output indicate that the computer is currently the Master Browser (see the Microsoft TechNet article NetBIOS Over TCP/IP for details):
user $ nmblookup akhanaten
192.168.1.70 akhanaten<00>
user $ nmblookup -A 192.168.1.70
Looking up status of 192.168.1.70
AKHANATEN <00> - B <ACTIVE>
AKHANATEN <03> - B <ACTIVE>
AKHANATEN <20> - B <ACTIVE>
GREENGABLES <00> - <GROUP> B <ACTIVE>
GREENGABLES <1e> - <GROUP> B <ACTIVE>
MAC Address = 00-00-00-00-00-00
user $ nmblookup tutankhamun
192.168.1.79 tutankhamun<00>
user $ nmblookup -A 192.168.1.79
Looking up status of 192.168.1.79
TUTANKHAMUN <00> - B <ACTIVE>
TUTANKHAMUN <03> - B <ACTIVE>
TUTANKHAMUN <20> - B <ACTIVE>
GREENGABLES <00> - <GROUP> B <ACTIVE>
GREENGABLES <1e> - <GROUP> B <ACTIVE>
MAC Address = 00-00-00-00-00-00
user $ nmblookup smenkhkare
192.168.1.90 smenkhkare<00>
user $ nmblookup -A 192.168.1.90
Looking up status of 192.168.1.90
SMENKHKARE <00> - B <ACTIVE>
SMENKHKARE <03> - B <ACTIVE>
SMENKHKARE <20> - B <ACTIVE>
..__MSBROWSE__. <01> - <GROUP> B <ACTIVE>
GREENGABLES <00> - <GROUP> B <ACTIVE>
GREENGABLES <1d> - B <ACTIVE>
GREENGABLES <1e> - <GROUP> B <ACTIVE>
MAC Address = 00-00-00-00-00-00
‘..__MSBROWSE__.
‘ and ‘<1d>
‘ in the above output indicates that the laptop named smenkhkare
is currently the Master Browser of the Workgroup named GREENGABLES
. See the Microsoft TechNet article NetBIOS Over TCP/IP to interpret the output.
Now let’s look at what happens when thutmoseiii
, the Windows 10 desktop connected to this home network, is powered up:
user $ smbtree
GREENGABLES
\\AKHANATEN Samba 4.3.11-Ubuntu
\\AKHANATEN\IPC$ IPC Service (Samba 4.3.11-Ubuntu)
\\AKHANATEN\guest guest account
\\AKHANATEN\matthew matthew share
\\AKHANATEN\marilla marilla share
\\AKHANATEN\anne anne share
\\SMENKHKARE Samba 4.2.14
\\SMENKHKARE\Samsung_CLX-8385ND Samsung CLX-8385ND
\\SMENKHKARE\Canon_MP510_Printer Canon MP510 Printer
\\SMENKHKARE\Virtual_PDF_Printer Virtual PDF Printer
\\SMENKHKARE\Canon_MP560_WiFi Canon MP560 WiFi
\\SMENKHKARE\IPC$ IPC Service (Samba 4.2.14)
\\SMENKHKARE\Public
\\SMENKHKARE\anne-share
\\SMENKHKARE\print$
\\SMENKHKARE\netlogon Network Logon Service
\\TUTANKHAMUN Samba 4.2.11
\\TUTANKHAMUN\Samsung_Xpress_C460FW Samsung Xpress C460FW
\\TUTANKHAMUN\Canon_MP560_Printer Canon PIXMA MP560
\\TUTANKHAMUN\Canon_MP510_Printer Canon PIXMA MP510
\\TUTANKHAMUN\Virtual_PDF_Printer Virtual PDF Printer
\\TUTANKHAMUN\IPC$ IPC Service (Samba 4.2.11)
\\TUTANKHAMUN\Public
\\TUTANKHAMUN\anne-share
\\TUTANKHAMUN\print$
\\TUTANKHAMUN\netlogon Network Logon Service
\\THUTMOSEIII Lounge Computer
HOME
\\BTHUB5 BT Home Hub 5.0A File Server
\\BTHUB5\IPC$ IPC Service (BT Home Hub 5.0A File Server)
user $ nmblookup thutmoseiii
192.168.1.74 thutmoseiii<00>
192.168.56.1 thutmoseiii<00>
user $ nmblookup -A 192.168.1.74
Looking up status of 192.168.1.74
THUTMOSEIII <20> - B <ACTIVE>
THUTMOSEIII <00> - B <ACTIVE>
GREENGABLES <00> - <GROUP> B <ACTIVE>
GREENGABLES <1e> - <GROUP> B <ACTIVE>
MAC Address = AA-BB-CC-DD-EE-FF (anonymised by me)
So Linux computer smenkhkare
remained the Master Browser. This is because the Windows 10 computer has its Registry subkey HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Browser\Parameters\MaintainServerList
set to ‘Auto
‘, and also there is no subkey \HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Browser\Parameters\IsDomainMaster
so implicitly its value is False (i.e. the computer is not a Preferred Master Browser). See Microsoft TechNet article Specifying Browser Computers for details.
By the way, notice that two IP addresses are listed for thutmoseiii
. This is because thutmoseiii
is connected to two network adapters: 192.168.1.74 is the IP address of thutmoseiii
in the home network, and 192.168.56.1 is the IP address of the virtual network interface for the virtual computers in VirtualBox installed on thutmoseiii
.
If the Samba service on smenkhkare
is now stopped from the command line, Windows 10 computer thutmoseiii
is elected Master Browser after more than a minute has elapsed:
user $ nmblookup -A 192.168.1.74
Looking up status of 192.168.1.74
THUTMOSEIII <20> - B <ACTIVE>
THUTMOSEIII <00> - B <ACTIVE>
GREENGABLES <00> - <GROUP> B <ACTIVE>
GREENGABLES <1e> - <GROUP> B <ACTIVE>
GREENGABLES <1d> - B <ACTIVE>
..__MSBROWSE__. <01> - <GROUP> B <ACTIVE>
MAC Address = AA-BB-CC-DD-EE-FF (anonymised by me)
If the Samba service on smenkhkare
is then restarted from the command line and the Windows 10 computer is allowed to go to sleep, the laptop named smenkhkare
becomes the Master Brower again as expected.
NetBIOS Commands in Windows
Now let’s look at some NetBIOS equivalent commands on the Windows 10 computer (Windows computer name: thutmoseiii
).
First let’s see which remote computers thutmoseiii
detects:
C:\WINDOWS\system32>nbtstat -c
VirtualBox Host-Only Network 2:
Node IpAddress: [192.168.56.1] Scope Id: []
No names in cache
Ethernet:
Node IpAddress: [192.168.1.74] Scope Id: []
NetBIOS Remote Cache Name Table
Name Type Host Address Life [sec]
------------------------------------------------------------
AKHANATEN <20> UNIQUE 192.168.1.70 381
TUTANKHAMUN <20> UNIQUE 192.168.1.79 407
SMENKHKARE <20> UNIQUE 192.168.1.90 416
WiFi:
Node IpAddress: [0.0.0.0] Scope Id: []
No names in cache
Local Area Connection* 11:
Node IpAddress: [0.0.0.0] Scope Id: []
No names in cache
Four adapters are listed in the above output: ‘VirtualBox Host-Only Network 2
‘, ‘Ethernet
‘, ‘WiFi
‘ and ‘Local Area Connection* 11
‘. Let’s look at why they are listed:
- The first adapter listed exists because VirtualBox is installed on
thutmoseiii
and has a virtual network adapter to enable virtual computers to be networked together (see What Is A Oracle VM VirtualBox Host-Only Network Adapter? if you don’t know what is a VirtualBox Host-Only Network Adapter).
- The second adapter listed is the computer’s Ethernet adapter.
thutmoseiii
is connected to the home network via this interface, and the above output shows thatthutmoseiii
has correctly detected the three other computers connected to the home network.
- The third adapter listed is the computer’s wireless adapter.
thutmoseiii
also has a Wi-Fi interface, currently disabled in Windows, hence no active wireless connection is listed.
- The fourth adapter is a ‘Microsoft Wi-Fi Direct Virtual Adapter’ according to the output of the
ipconfig/all
command. As the Wi-Fi interface is currently disabled in Windows, no active connection is listed here either.
Now let’s see what thutmoseiii
reports about itself:
C:\WINDOWS\system32>nbtstat -n
VirtualBox Host-Only Network 2:
Node IpAddress: [192.168.56.1] Scope Id: []
NetBIOS Local Name Table
Name Type Status
---------------------------------------------
THUTMOSEIII <20> UNIQUE Registered
THUTMOSEIII <00> UNIQUE Registered
GREENGABLES <00> GROUP Registered
GREENGABLES <1E> GROUP Registered
GREENGABLES <1D> UNIQUE Registered
☺☻__MSBROWSE__☻<01> GROUP Registered
Ethernet:
Node IpAddress: [192.168.1.74] Scope Id: []
NetBIOS Local Name Table
Name Type Status
---------------------------------------------
THUTMOSEIII <20> UNIQUE Registered
THUTMOSEIII <00> UNIQUE Registered
GREENGABLES <00> GROUP Registered
GREENGABLES <1E> GROUP Registered
WiFi:
Node IpAddress: [0.0.0.0] Scope Id: []
No names in cache
Local Area Connection* 11:
Node IpAddress: [0.0.0.0] Scope Id: []
No names in cache
The above is correct: thutmoseiii
is the Master Browser in the Windows Workgroup of VirtualBox Host-Only Network 2, but not a Master Browser in the GREENGABLES Workgroup to which thutmoseiii
is connected by Ethernet cable. As the Wi-Fi interface in thutmoseiii
is currently disabled, no active wireless connection is listed.
Now let’s take a look at what thutmoseiii
reports about akhanaten
:
C:\WINDOWS\system32>nbtstat -a akhanaten
VirtualBox Host-Only Network 2:
Node IpAddress: [192.168.56.1] Scope Id: []
Host not found.
Ethernet:
Node IpAddress: [192.168.1.74] Scope Id: []
NetBIOS Remote Machine Name Table
Name Type Status
---------------------------------------------
AKHANATEN <00> UNIQUE Registered
AKHANATEN <03> UNIQUE Registered
AKHANATEN <20> UNIQUE Registered
GREENGABLES <00> GROUP Registered
GREENGABLES <1E> GROUP Registered
MAC Address = 00-00-00-00-00-00
WiFi:
Node IpAddress: [0.0.0.0] Scope Id: []
Host not found.
Local Area Connection* 11:
Node IpAddress: [0.0.0.0] Scope Id: []
Host not found.
The above is also correct, as akhanaten
is indeed not a Master Browser.
Now let’s have a look at what thutmoseiii
reports about tutankhamun
:
C:\WINDOWS\system32>nbtstat -a tutankhamun
VirtualBox Host-Only Network 2:
Node IpAddress: [192.168.56.1] Scope Id: []
Host not found.
Ethernet:
Node IpAddress: [192.168.1.74] Scope Id: []
NetBIOS Remote Machine Name Table
Name Type Status
---------------------------------------------
TUTANKHAMUN <00> UNIQUE Registered
TUTANKHAMUN <03> UNIQUE Registered
TUTANKHAMUN <20> UNIQUE Registered
GREENGABLES <00> GROUP Registered
GREENGABLES <1E> GROUP Registered
MAC Address = 00-00-00-00-00-00
WiFi:
Node IpAddress: [0.0.0.0] Scope Id: []
Host not found.
Local Area Connection* 11:
Node IpAddress: [0.0.0.0] Scope Id: []
Host not found.
The above is also correct, as tutankhamun
is indeed not a Master Browser.
Now let’s have a look at what thutmoseiii
reports about smenkhkare
:
C:\WINDOWS\system32>nbtstat -a smenkhkare
VirtualBox Host-Only Network 2:
Node IpAddress: [192.168.56.1] Scope Id: []
Host not found.
Ethernet:
Node IpAddress: [192.168.1.74] Scope Id: []
NetBIOS Remote Machine Name Table
Name Type Status
---------------------------------------------
SMENKHKARE <00> UNIQUE Registered
SMENKHKARE <03> UNIQUE Registered
SMENKHKARE <20> UNIQUE Registered
☺☻__MSBROWSE__☻<01> GROUP Registered
GREENGABLES <00> GROUP Registered
GREENGABLES <1D> UNIQUE Registered
GREENGABLES <1E> GROUP Registered
MAC Address = 00-00-00-00-00-00
WiFi:
Node IpAddress: [0.0.0.0] Scope Id: []
Host not found.
Local Area Connection* 11:
Node IpAddress: [0.0.0.0] Scope Id: []
Host not found.
The above is also correct, as smenkhkare
is indeed the Master Browser (notice the ‘☺☻__MSBROWSE__☻
‘ and ‘<1D>
‘).
Q.E.D.
So there you have it; Browser Elections take place and the Master Browser is any one of the Linux or Windows computers in the home network, thus enabling SMB browsing to take place. No WINS, no LDAP, no AD, no Kerberos. All SMB communication is carried out using NetBIOS over TCP/IP and Broadcast NetBIOS Name Resolution, as shown by the output of the command ‘nbtstat -r
‘ on thutmoseiii
:
C:\WINDOWS\system32>nbtstat -r
NetBIOS Names Resolution and Registration Statistics
----------------------------------------------------
Resolved By Broadcast = 65
Resolved By Name Server = 0
Registered By Broadcast = 233
Registered By Name Server = 0
NetBIOS Names Resolved By Broadcast
---------------------------------------------
BTHUB5 <00>
呂啈㕂†††††䱃噅坏㌲匰⁓†
TUTANKHAMUN <00>
AKHANATEN <00>
SMENKHKARE <00>
I assume the line of Chinese and other characters is because of some deficiency in NBTSTAT.EXE
, CMD.EXE
or Windows 10 generally — despite having entered ‘CHCP 65001
‘ and chosen a Unicode TrueType font in CMD.EXE
— but the important point is that the statistics listed by the ‘nbtstat -r
‘ command clearly show that only broadcasts are used for NetBIOS Name resolution, as promised. NetBIOS name resolution works fine in the home network and all the sharing-enabled computers in the home network can browse SMB shares on other sharing-enabled computers, whether they are running Windows, Linux, macOS, Android or iOS. I reiterate that this is for a typical home network.
Command to find Master Browsers
In Linux you can use the ‘nmblookup
‘ command as follows to find out which machine in the home network is currently the Master Browser in each Workgroup:
user $ nmblookup -M -- -
192.168.1.254 __MSBROWSE__
192.168.1.90 __MSBROWSE__
192.168.56.1 __MSBROWSE__
You can see above that there are currently three Master Browsers in this home network. Let’s check the details for these three Master Browsers:
user $ nmblookup -A 192.168.1.254
Looking up status of 192.168.1.254
BTHUB5 <00> - B <ACTIVE>
BTHUB5 <03> - B <ACTIVE>
BTHUB5 <20> - B <ACTIVE>
..__MSBROWSE__. <01> - <GROUP> B <ACTIVE>
HOME <1d> - B <ACTIVE>
HOME <1e> - <GROUP> B <ACTIVE>
HOME <00> - <GROUP> B <ACTIVE>
MAC Address = 00-00-00-00-00-00
You can see above that the machine BTHUB5
(which is actually the home network’s router) is the Master Browser in the Workgroup named HOME
(see earlier).
user $ nmblookup -A 192.168.1.90
Looking up status of 192.168.1.90
SMENKHKARE <00> - B <ACTIVE>
SMENKHKARE <03> - B <ACTIVE>
SMENKHKARE <20> - B <ACTIVE>
..__MSBROWSE__. <01> - <GROUP> B <ACTIVE>
GREENGABLES <00> - <GROUP> B <ACTIVE>
GREENGABLES <1d> - B <ACTIVE>
GREENGABLES <1e> - <GROUP> B <ACTIVE>
MAC Address = 00-00-00-00-00-00
You can see above that computer SMENKHKARE
is currently the Master Browser in the Workgroup named GREENGABLES
.
user $ nmblookup -A 192.168.56.1
Looking up status of 192.168.56.1
No reply from 192.168.56.1
You can see above that the network node 192.168.56.1
is inactive, which is not surprising considering that it is a node on a VirtualBox virtual subnet on the Windows 10 computer thutmoseiii
(see earlier) and VirtualBox is not running at the moment on that computer.
On a Windows machine it is not quite so easy to find out which machines are currently Master Browsers. However, on the face of it the third-party utility lanscan.exe
can do it (see How to Determine the Master Browser in a Windows Workgroup):
C:\WINDOWS\system32>lanscan
LANscanner v1.67 - ScottiesTech.Info
Scanning LAN...
Scanning workgroup: HOME...
Scanning workgroup: GREENGABLES...
BTHUB5 192.168.1.254 11-11-11-11-11-11 HOME MASTER
THUTMOSEIII 192.168.56.1 22-22-22-22-22-22 GREENGABLES MASTER
SMENKHKARE 192.168.1.90 aa-bb-cc-dd-ee-ff GREENGABLES MASTER
TUTANKHAMUN 192.168.1.79 33-33-33-33-33-33 GREENGABLES
AKHANATEN 192.168.1.70 55-55-55-55-55-55 GREENGABLES
Press any key to exit...
(MAC addresses anonymised by me.)
Notice above that lanscan.exe
listed the VirtualBox virtual subnet node 192.168.56.1
in Windows 10 computer thutmoseiii
(see earlier) but omitted to list the node 192.168.1.74
(also thutmoseiii
) in the real network. Now, in this particular case thutmoseiii
on 192.168.1.74
is not a Master Browser. Nevertheless, as lanscan.exe
is supposed to list all nodes, its failure to list the node 192.168.1.74
is a shortcoming.
And what happens if thutmoseiii
on node 192.168.1.74
becomes a Master Browser? In that case lanscan.exe
still omits the node from the list and, in addition, wrongly shows tutankhamun
as a Master Browser:
C:\WINDOWS\system32>nbtstat -n
VirtualBox Host-Only Network 2:
Node IpAddress: [192.168.56.1] Scope Id: []
NetBIOS Local Name Table
Name Type Status
---------------------------------------------
THUTMOSEIII <20> UNIQUE Registered
THUTMOSEIII <00> UNIQUE Registered
GREENGABLES <00> GROUP Registered
GREENGABLES <1E> GROUP Registered
GREENGABLES <1D> UNIQUE Registered
☺☻__MSBROWSE__☻<01> GROUP Registered
Ethernet:
Node IpAddress: [192.168.1.74] Scope Id: []
NetBIOS Local Name Table
Name Type Status
---------------------------------------------
THUTMOSEIII <20> UNIQUE Registered
THUTMOSEIII <00> UNIQUE Registered
GREENGABLES <00> GROUP Registered
GREENGABLES <1E> GROUP Registered
GREENGABLES <1D> UNIQUE Registered
☺☻__MSBROWSE__☻<01> GROUP Registered
WiFi:
Node IpAddress: [0.0.0.0] Scope Id: []
No names in cache
Local Area Connection* 11:
Node IpAddress: [0.0.0.0] Scope Id: []
No names in cache
C:\WINDOWS\system32>nbtstat -A 192.168.1.79
VirtualBox Host-Only Network 2:
Node IpAddress: [192.168.56.1] Scope Id: []
Host not found.
Ethernet:
Node IpAddress: [192.168.1.74] Scope Id: []
NetBIOS Remote Machine Name Table
Name Type Status
---------------------------------------------
TUTANKHAMUN <00> UNIQUE Registered
TUTANKHAMUN <03> UNIQUE Registered
TUTANKHAMUN <20> UNIQUE Registered
GREENGABLES <00> GROUP Registered
GREENGABLES <1E> GROUP Registered
MAC Address = 00-00-00-00-00-00
WiFi:
Node IpAddress: [0.0.0.0] Scope Id: []
Host not found.
Local Area Connection* 11:
Node IpAddress: [0.0.0.0] Scope Id: []
Host not found.
C:\WINDOWS\system32>lanscan
LANscanner v1.67 - ScottiesTech.Info
Scanning LAN...
Scanning workgroup: HOME...
Scanning workgroup: GREENGABLES...
BTHUB5 192.168.1.254 11-11-11-11-11-11 HOME MASTER
THUTMOSEIII 192.168.56.1 22-22-22-22-22-22 GREENGABLES MASTER
TUTANKHAMUN 192.168.1.79 33-33-33-33-33-33 GREENGABLES MASTER
SMENKHKARE 192.168.1.90 aa-bb-cc-dd-ee-ff GREENGABLES
AKHANATEN 192.168.1.70 55-55-55-55-55-55 GREENGABLES
Press any key to exit...
(MAC addresses anonymised by me.)
Linux appears to have the edge on Windows in this respect, as the Samba command ‘nmblookup -M -- -
‘ detects all the Master Browsers correctly in the above situation:
user $ nmblookup -M -- -
192.168.1.254 __MSBROWSE__
192.168.1.74 __MSBROWSE__
192.168.56.1 __MSBROWSE__
So it appears that, from a Windows computer, the only sure way to find all Master Browsers is to use the command ‘nbtstat -a <computer name>
‘ to check each remote machine in the home network, plus the command ‘nbtstat -n
‘ to check the Windows computer you are using.
Footnote
The ebuild of the current Gentoo Stable Branch package net-fs/samba-4.2.11
(and probably the ebuild of the Testing Branch package net-fs/samba-4.2.14
as well) is not entirely correct, as it pulls in unnecessary dependencies (see Gentoo Bug Report No. 579088 – net-fs/samba-4.x has many hard dependencies, make some optional). For example, Kerberos is not required at all if you are not using LDAP, AD, etc. and are just using NETBIOS Name Resolution by Broadcast in a Windows Workgroup (like most home users). However, the Gentoo samba
ebuild forces the user to install Kerberos (either the MIT implementation app-crypt/mit-krb5
or the Heimdal implementation app-crypt/heimdal
) even if you specify that Samba should be built without support for LDAP, AD, etc. This does not cause any harm, but it is unnecessary.
user $ eix -I samba
[I] net-fs/samba
Available versions: 3.6.25^t 4.2.11 ~4.2.14 [M]~4.3.11 [M]~4.4.5 [M]~4.4.6 [M]~4.5.0 {acl addc addns ads (+)aio avahi caps (+)client cluster cups debug dmapi doc examples fam gnutls iprint ldap ldb +netapi pam quota +readline selinux +server +smbclient smbsharemodes swat syslog +system-mitkrb5 systemd test (+)winbind zeroconf ABI_MIPS="n32 n64 o32" ABI_PPC="32 64" ABI_S390="32 64" ABI_X86="32 64 x32" PYTHON_TARGETS="python2_7"}
Installed versions: 4.2.11(19:40:03 16/09/16)(avahi client cups fam gnutls pam -acl -addc -addns -ads -aio -cluster -dmapi -iprint -ldap -quota -selinux -syslog -system-mitkrb5 -systemd -test -winbind ABI_MIPS="-n32 -n64 -o32" ABI_PPC="-32 -64" ABI_S390="-32 -64" ABI_X86="64 -32 -x32" PYTHON_TARGETS="python2_7")
Homepage: http://www.samba.org/
Description: Samba Suite Version 4
If you are a Gentoo Linux user, you can merge the package net-fs/samba
with the same USE flags shown above (obviously change “-systemd
” to “systemd
” if you use systemd instead of OpenRC), and use the laptops’ smb.conf
files shown in this post as templates, and you will be able to share files and printers using Samba and NetBIOS name resolution. Don’t forget to use pdbedit
to define the Samba users, and don’t forget to stop and disable winbindd
if it is already installed.
Further reading
- How NetBIOS name resolution really works
- Name Resolution and Browsing (See the section Browser Elections)
- How Computer Browser Service Works
- NetBIOS Over TCP/IP
- Nbtstat
- Windows Networking
ADDENDUM (October 30, 2016): You probably already use the Public folder in Windows. If not, you can find a brief explanation in the article Simple Questions: What is the Public Folder & How to Use it?. There are a number of default sub-folders in C:\Users\Public\
on a Windows machine. There are some differences depending on the version of Windows, but in Windows 10 (Anniversary Update) these sub-folders are named:
C:\Public\Libraries
C:\Public\Public Account Pictures
C:\Public\Public Desktop
C:\Public\Public Documents
C:\Public\Public Downloads
C:\Public\Public Music
C:\Public\Public Pictures
C:\Public\Public Videos
These predefined sub-folders are not ordinary folders, and I have noticed a surmountable minor limitation when accessing them from a Linux machine using Samba, as explained below.
If I enable Public Folder Sharing on a Windows machine (‘Turn on sharing so that anyone with network access can read and write files in the Public folders’) and configure the security permissions of the Public folder for Everyone, from another Windows machine in the Workgroup I can copy files to the first machine’s Public folder and default sub-folders. From a Linux machine in the Workgroup I can copy files to the Public folder on Windows machines in the Workgroup but I cannot copy files to the default sub-folders (the Dolphin file manager displays the error message ‘Access denied. Could not write to .
‘). However, this is not a big deal because I can copy files into the Public folder itself and into manually created sub-folders in the Public folder.
ADDENDUM (February 13, 2018): Windows 10 Version 1709 and later have the SMBv1/CIFS protocol disabled by default, so the Lanscan utility will no longer work in Windows 10 Version 1709. That is not a big deal if you also have Linux machines on your home network; just use the Samba commands from one of those Linux machines instead. If you have devices on your home network that only support SMBv1/CIFS protocol and they cannot be configured to use the SMBv3 protocol, your only option is to configure Windows 10 Version 1709 to use the SMBv1 protocol, which is less secure than the later SMB protocols. See e.g. the article Cannot browse network neighborhood under Windows 10 Fall Creators update 1709 and newer for how to configure Windows 10 Version 1709 to use the SMBv1 protocol. In my case, all my Linux machines using Samba can be configured via the smb.conf
file to use a newer version of the SMB protocol (see ‘server min protocol’ and ‘server max protocol’ in the Samba documentation for smb.conf).
How do I access my Samba share if I want to use a vpn router? I can see the apache based programs in my browser but my Windows File Explorer is not seeing the files on the server.
Accessing Samba shares is possible over a VPN, but not using Broadcast NetBIOS Name Resolution. Either you specify an IP address for the share (e.g. \\192.168.1.70\anne instead of \\AKHANATEN\anne), or you have the IP-to-hostname mapping in your C:\WINDOWS\System32\drivers\etc\hosts file (or /etc/hosts on a Linux machine), or use some other form of hostname-to-IP address mapping such as LDAP or WINS (but why bother?).
If your Linux machines have a firewall, see my latest post Prevent Linux firewalls interfering with Samba commands in a home network that uses broadcast NetBIOS name resolution.
Hats off. I have done battle with samba for some years without spotting this approach which I am about to implement the only question I have is why is the [netlogon] added to the laptops and not the server?
Good question. Actually, the
[netlogon]
section in the two laptopsmb.conf
files is redundant here (i.e. serves no purpose in my case) as there is currently no line ‘logon script = <script name>
‘ in mysmb.conf
files and I have no reason for Windows SMB clients to execute Windows batch files when they log in to the Linux machines to access Samba shares. So you can just delete the[netlogon]
section if you want:[netlogon]
comment = Network Logon Service
path = /var/lib/samba/netlogon
guest ok = yes
Ref. Using Samba : Chapter 6 : 6.6 Logon Scripts
Good!
My approach has developed over the years, having fewer users, all the shared directories are lumped together and then synced on the server and laptops using syncthing. This allows one to retrieve deleted files from other computers as syncthing keeps a record and hopefully having three or four copies acts as a backup. Anyway a review of my samba settings was long over due so thanks for sharing.
By the way, although I quoted a low ‘os level’ of 4 for my NAS in this blog post, and that does indeed work (it just means there is a new Master Browser every time another machine with a higher os level connects to the network), if your NAS is always-on (or nearly always) you could, if you wanted, have ‘
os level = 255
‘ instead in the NAS’ssmb.conf
so that the NAS is always the Master Browser (until you discconnect it or power it down, at which point a normal re-election for Master Browser would occur).Opted for 254 in case of passing Win Server. Laptops 100 down to 99 so far! Always thinking on an industrial scale.Cut my teeth on Samba and Linux when I found myself in employment in a firm with no IT and decided to put in a Ubuntu server and samba to network the office of mixed Windows and Macs. Sadly Apple had a hissy fit at the same time and abandoned the open source solution in favour of developing there own SMB solution which I could not get to play nicely with samba (the macs kept locking the files they opened) so took the Micro HP server home. This left me with an abiding hatred for all things Apple but I had finally learned my way around Linux via Win95, O/S2/ SUSE, Ubuntu and now Debian. More plumber than prof I plunder manuals for what I need but lack the intellect to absorb and recall hence my interest in your simple approach to home networks my smb.conf now being a grave yard of defunct settings which I leave in place just so that I don’t add them again in the vane hope of improving my laptops ability to deal with a variety of Windows and samba networks.
I always found duel booting a pain so discovering Virtualisation was the key for me to go fully linux.
Sorry to ramble but I never meet anyone who can do more than press the on/off button.
If you haven’t already have a play with sycthing it is really good.
Hadn’t heard of syncthing before. Looks good. Will keep it in mind if I need something like that in future. Good luck with your Samba configuration.
Thanks for the write-up. I’m going to use this as a check list to confirm my current setup and try to resolve problems.
Your expertise may be able to help me with a current problem.
The current version of Win 10 drops the SMB1 and browsing ability in windows explorer
https://support.microsoft.com/en-au/help/4034314/smbv1-is-not-installed-windows-10-and-windows-server-version-1709
I am having a heck of a time trying to get my desktop accessing my NAS again – I use a 1GBe NIC (I need it for WoL) and a 10GBe NIC for file transfers….just doesn’t seem to play nice with the new Win version!
At any rate, I was curious how you have managed it given the network you have?
Is there an alternate protocol you can think of to allow browsing without having to map network shares (eg FTP)?
Hope you can help!
If your NAS is configurable, you may be able to configure it to use the SMBv3 protocol instead of SMBv1/CIFS protocol. If it isn’t, your only option is to configure Windows 10 Version 1709 to use SMBv1 protocol, which is less secure than the later SMB protocols. See e.g. the article Cannot browse network neighborhood under Windows 10 Fall Creators update 1709 and newer for how to configure Windows 10 Version 1709 to use the SMBv1 protocol. In my case, all my Linux machines using Samba can be configured via the
smb.conf
file to use a newer version of the SMB protocol (see ‘server min protocol’ and ‘server max protocol’ in the Samba documentation for smb.conf).I added the following four lines in the
[global]
section in/etc/samba/smb.conf
on all Linux machines in my home network, to force them to use the SMBv3 protocol:min protocol = SMB3
max protocol = SMB3
client min protocol = SMB3
client max protocol = SMB3
Specifying ‘
SMB3
‘ defaults to ‘SMB3_11
‘, as explained in the Samba documentation:https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html#CLIENTMAXPROTOCOL
Note that the
smbstatus
command on the Samba server will report the protocol as ‘Unknown (0x0311)
‘ for versions of Samba prior to 4.4.0 (see https://bugzilla.samba.org/show_bug.cgi?id=11472).I found that my Samsung Galaxy Note 8 phone running Android 9 cannot browse SMB shares using the SMBv3 protocol, only using SMBv1 or SMBv2, so I changed the four lines in
/etc/samba/smb.conf
to:min protocol = SMB2
max protocol = SMB3
client min protocol = SMB2
client max protocol = SMB3
Unfortunately, to date a bug in Samba results in the Samba command
smbtree
only working with SMBv1 (i.e. with ‘client max protocol = NT1
‘ in/etc/samba/smb.conf
):http://samba.2283325.n4.nabble.com/smbtree-command-shows-nothing-with-SMB2-3-td4717529.html
https://bugzilla.samba.org/show_bug.cgi?id=12876
If you enter the command
smbtree
when using SMB2 or SMB3, the command will incorrectly return nothing.If your Linux distribution’s package repositories contain nbtscan (http://unixwiz.net/tools/nbtscan.html) and nmbscan (http://nmbscan.g76r.eu/), you could install and use those to provide some of the information that
smbtree
would provide. For example:$ nbtscan -v 192.168.1.1-254
$ nmbscan -a
Also, the
smbclient
command can get a list of shares available on a host. For example:$ smbclient -L 192.168.1.70
$ smbclient -L AKHANATEN
Thanks for this post, it’s very informative!
You’re welcome. Glad it is of use.
Pingback: Using WS-Discovery to enable Windows 10 to browse SMB shares in my home network of Linux computers | Fitzcarraldo's Blog
Pingback: A Linux command-line utility to discover and list WSD-enabled computers and printers on a home network | Fitzcarraldo's Blog
unable to see linux shared folders on windows 10 pro and ent and vise versa. followed all your instructions and no go.
using mint 19.3 and unable to see m$ workgroup shares. its using samba 4.7.6
mint 20 and ubuntu 20 same issues
for some strange reason, LMDE4 and mx-linux is fine on a m$ network, those distros use samba 4.9.5
my smb.conf in lm19.3 file looks like a dog meal with so many hacks its beyond a joke
Anyone else get LM20 or Ubuntu 20 to work in a m$ workgroup network?
i heard also another method of hacking fstab files to get it to simply browse your shared folders on your network. not exactly user friendly nor inviting new users to linux
Windows 10 no longer uses Computer Browser service and the SMBv1 protocol, so you have to use the WS-Discovery daemon
wsdd
and SMBv2 or SMBv3 in Linux in order for Windows 10 to display SMB shares in File Explorer. See the following recent post:I now use the SMBv2 and SMBv3 protocols in Linux, which are compatible with Windows 10. See the following comment:
I stumbled upon your blog when trying to learn about Web Services Discovery vs Netbios. Your blogs have so much detail and are really well explained for those less technical but motivated.. like me! Thank you.
Can I quizz you about this please? I have several Raspberry Pis on my LAN and each has Samba and shares on it. I started using OpenVPN recently and have a server, running as a routed VPN, on one of my Pis. When connected to the VPN the Pis don’t get auto-populated into the network neighbourhood of my vpn connected client Windows PC. I think I understand that’s because the Netbios (and likewise the wsd?) protocol cannot traverse from one subnet into another.
It’s not really a show stopper because I can map the shares as network drives. However I was wondering could connecting clients be told how to connect to the Samba Master browser on the LAN and get the info from there about what hosts are on the LAN and thus use that info to populate the clients network neighbourhood? What do you think? I could make one of the Pis os level = 255 in its smb.conf and then push its ip to the VPN and… then maybe someone on GitHub would write an awesome bit of code that can make the rest work?!
I think this does work on a bridged VPN, although I haven’t tried, but I like the idea of getting that functionality on my routed VPN without having to send all those nbns and browser broadcast packets over the VPN link eating up bandwidth. Would you have any ideas if this can be made to work at all, on a routed VPN?
Thank you.
Pingback: Moving from Lubuntu 18.04 to 20.10 | Fitzcarraldo's Blog
I have been running “Linux on the Server, Windows on the Desktop” for years, at home, at work and wherever else they let me advise on how to share files. Yet, after 20 years of doing this, I still found new things to get into in your article. For example, I was not familiar with many of the Linux command line tools you mentioned.
I was eager to try “smbtree”, but it exits without any output at all. Why might that be?
Please read the comment I made on 18 May 2020.
Pingback: Using GeckoLinux to resurrect my old nettop | Fitzcarraldo's Blog