NOTE: If you are in a Linux only or a Linux / macOS network there is a more modern method to resolve host names: Samba Browsing in an all Linux or Linux/OSX network
NOTE: If you are using Mint 18 replace "gedit" references with "xed" below.
NOTE: If you are using Mint 19 replace "gksu gedit" references with "sudo -H xed" below.
[1] Samba Browsing depends on all hosts being members of the same subnet.
If all your machines are connected to and get their IP address from the same router this happens automatically ( all of my machines are in the 192.168.0.xxx range with the same subnet mask of 255.255.255.0 ). But if you have set up static IP addresses yourself you need to make sure that they are in the same ip range and have the same subnet mask. Running the command: ifconfig on Linux and ipconfig on Windows should provide this information.
[2] Services not starting at boot.
Check to see that the following services are running:
Code: Select all
sudo service smbd status
sudo service nmbd status
Code: Select all
sudo service smbd start
sudo service nmbd start
By default Samba will use the host name as the name it uses to identify itself to others on the network. But it can only be 15 characters or less in length. That's a requirement of Samba not Linux. So to see if you are in compliance run the following command and count the number of characters:
Code: Select all
hostname
Code: Select all
gksu gedit /etc/samba/smb.conf
Code: Select all
netbios name = some-name
Then restart samba:
Code: Select all
sudo service smbd restart
Code: Select all
sudo service nmbd restart
Actual Samba communication is done by ip address not name. If you want to browse the LAN by name some mechanism must be provided to convert the name to an ip address. Windows machines use "node" specifications to determine the how and order of how this is done and Samba does as well with this line in the default settings:
* "lmhosts" and "host" are basically lookup tables that specify that this ip address belongs to this name - This is not set up by default.name resolve order = lmhosts wins host bcast
* "wins" refers to a wins server that maintains a list - This too is not set up by default.
* The only default working system is bcast ( broadcast ) which Windows also uses but it appears last in order in Samba.
Rearrange the order to make bcast first by adding a line to the [global] section of /etc/samba/smb.conf - right under the "workgroup" line:
Code: Select all
name resolve order = bcast host lmhosts wins
[5] Firewalls
[5a] Disable the firewall on both of the machines that are trying to communicate and see if you can browse the LAN.
If you are using the built in firewall configurator then issue the following command to disable it:
Code: Select all
sudo ufw disable
Code: Select all
sudo apt-get install nmap
Code: Select all
sudo nmap -sS -sU -T4 192.168.0.100
[5c] ( This is no longer an issue with the latest Mint ) If you do decide to use a firewall and think you have the right ports open you may find that browsing still doesn't work. That's because there may be an error ( omission ) in the base configuration of the firewall itself :Interesting ports on 192.168.0.100:
Not shown: 1993 closed ports
PORT STATE SERVICE
139/tcp open netbios-ssn
445/tcp open microsoft-ds
137/udp open|filtered netbios-ns
138/udp open|filtered netbios-dgm
Edit the firewall configuration:
Code: Select all
gksu gedit /etc/default/ufw
And change the last line to this:# extra connection tracking modules to load
IPT_MODULES="nf_conntrack_ftp nf_nat_ftp nf_conntrack_irc nf_nat_irc"
Code: Select all
IPT_MODULES="nf_conntrack_ftp nf_nat_ftp nf_conntrack_irc nf_nat_irc nf_conntrack_netbios_ns"
Code: Select all
sudo service ufw restart
[6] Workgroup
This isn't necessary if you have a normal home network where everyone is connected to the same router despite some samba howto's insisting that it "must" be done. I have multiple "workgroups" in my LAN and it is not an issue. I'm adding it here because invariably someone will post that it won't work unless you make all the workgroups the same:
Edit smb.conf as root:
Code: Select all
gksu gedit /etc/samba/smb.conf
And change it to whatever you want as long as it's not greater than 15 characters in length then restart samba.workgroup = workgroup
The other problem the Samba user usually faces are permissions issues and that's unique to the user's situation and is not covered here.
Other HowTo's concerning setting up or accessing shares that you might find amusing:
### Installing Samba in Mint 18: viewtopic.php?f=42&t=224391
### Mint 19 and Samba File Sharing Changes: viewtopic.php?f=42&t=270442
### Samba and Mint 20: viewtopic.php?f=42&t=322404
### SHARE CREATION ###
Simple File Sharing in Mint: http://forums.linuxmint.com/viewtopic.php?f=42&t=23169
Using the [homes] Share in Samba: http://forums.linuxmint.com/viewtopic.p ... 3&p=448039
Create Samba Shares Directly from Thunar: viewtopic.php?t=235248
### SHARE DISCOVERY ###
Avahi Networking: http://forums.linuxmint.com/viewtopic.php?f=42&t=112833
Samba Browsing in an all Linux or Linux/OSX network: http://forums.linuxmint.com/viewtopic.p ... 10#p960482
Samba and Windows 10: http://forums.linuxmint.com/viewtopic.php?f=42&t=199907
Samba Without SMB1: viewtopic.php?f=42&t=249758
### SHARE MOUNTING ###
On Demand CIFS Mounting of Shares: viewtopic.php?f=42&t=222087
Using Gigolo GUI to Mount Remote Samba Shares: http://forums.linuxmint.com/viewtopic.php?f=42&t=52144
Auto Mount Samba Shares on Boot ( GVFS Method ): http://forums.linuxmint.com/viewtopic.php?f=42&t=42713
Using AutoFS to Mount Remote Samba Shares: http://forums.linuxmint.com/viewtopic.php?f=42&t=144997
### NON-SAMBA NETWORK STUFF ###
HTTP for Fast Large File Transfers on Local Network : http://forums.linuxmint.com/viewtopic.php?f=42&t=139151
Another HTTP method using "woof": viewtopic.php?f=150&t=217786#p1140084
And another one using "droopy": viewtopic.php?f=150&t=223787&p=1178942#p1178942
### OTHER STUFF ###
Multi User Shared Local Directory: viewtopic.php?f=42&t=69834?f=42&t=69834
Using Bind to Remount Part of a Partition: viewtopic.php?f=42&t=74321
Fixing the Default umask in Mint: viewtopic.php?f=42&t=192794?f=42&t=192794