local network not working

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
RobertGM
Level 2
Level 2
Posts: 75
Joined: Mon Dec 09, 2019 4:58 pm

local network not working

Post by RobertGM »

I have 4 computers connected on a local network.
Three are running Linux Mint 20.1. One is still with Mint 19.3.
A similar arrangement with two Mint 19.3 boxes, one Mint 17.3 box and one Windows Vista box worked fine with Samba as the networking software. The new arrangement, however, does not work. I tried some of the fixes mentioned here: viewtopic.php?f=42&t=326160&p=2011779#p2011779 to no avail. I also installed GAdmin (which I had not used before) only to learn that GAdmin is not a good idea.
I have tried other networking packages (RSYNC, "Connect to server" from Nemo's File / dropdown menu, Warpinator, Boxes, etc.) While I have had some success, they do not work the way I want; which is the way Samba works: only specific "shared" folders are viewable/accessible on another computer.
I am open to suggestions. And, from what I've read here https://linuxhint.com/apt_remove_package_options/ it seems I may need to purge some of what I have installed (mostly through Software Manager). Is that correct?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
altair4
Level 20
Level 20
Posts: 11461
Joined: Tue Feb 03, 2009 10:27 am

Re: local network not working

Post by altair4 »

Gadmin-samba really needs to be removed from the repository so the uninitiated don't install it.

My recommendation is to start over. Reinstalling samba will not fix this. On every system you used gadmin-samba go through these steps to reset samba to the factory settings:

(1) Make a backup of your current smb.conf

Code: Select all

sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.bak
(2) Copy the default backup which is stored elsewhere just for this situation:

Code: Select all

sudo cp -a /usr/share/samba/smb.conf /etc/samba/
(3) Restart the samba daemon:

Code: Select all

sudo service smbd restart
At this moment you should have a samba server running. You don't have any shares defined at the moment so I would create one as a test. For example - and I will use my username in this example:

(A) Create a "Test" folder to share:

Code: Select all

sudo mkdir -p /srv/Test
(B) Take possession of the folder:

Code: Select all

sudo chown altair /srv/Test
(C) Edit /etc/samba/smb.conf and create a Test share definition at the bottom of the file:

Code: Select all

[Test]
path = /srv/Test
read only = no
guest ok = yes
force user = altair
(D) Restart smbd:

Code: Select all

sudo service smbd restart
On the very same machine that you did all this on open your file manager and connect to the share in the Location bar explicitly by host and share - in this example I will use the host name as vmint201cinn

By mDNS name: smb://vmint201cinn.local/test
OR by ip address: smb://192.168.1.135/test
OR by NetBIOS name: smb://vmint201cinn/test <<-- NetBIOS is notoriously unpredictable so use mDNS or ip address first. ( Note: The WinVista box has no choice but to use either ip address or NetBIOS since only Win10 can use mDNS )
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
RobertGM
Level 2
Level 2
Posts: 75
Joined: Mon Dec 09, 2019 4:58 pm

Re: local network not working

Post by RobertGM »

Thanks Altair.
I will try that unless you agree with this approach:
First purge the existing and start over from either command line or Software Manager.
And, if purging is the way to go, should I also purge the other networking programs first?
(Incidentally, the Vista box is retired. All four computers are using Mint.)
altair4
Level 20
Level 20
Posts: 11461
Joined: Tue Feb 03, 2009 10:27 am

Re: local network not working

Post by altair4 »

Don't purge anything. Samba is what samba is.

You cannot mess up the way the samba package functions so purging and reinstalling will only remove then install the exact same program again. The only way to alter how samba works is through smb.conf - which samba reads on every startup - and that is why I suggested that approach above.

Just remember to never ever use gadmin-samba again.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
RobertGM
Level 2
Level 2
Posts: 75
Joined: Mon Dec 09, 2019 4:58 pm

Re: local network not working

Post by RobertGM »

Your instructions have sort of worked. However, I had to change the IP address to computer name to access the test folder.
I can now see (and open) folders on a couple of other computers. Sometimes this is from the initial display of the "network" folder contents; sometimes through the "Windows Network" folder. But, I cannot yet see shared folders on all computers. And, I can access the respective computer's network shares on a couple of computers but not on my main computer.
I had been fiddling with firewall settings. And, I read about ufw for Samba. Should the firewall be set the same on all computers with special rules made for Samba?
altair4
Level 20
Level 20
Posts: 11461
Joined: Tue Feb 03, 2009 10:27 am

Re: local network not working

Post by altair4 »

You shouldn't have to change the ip address on anything since Linux can use the mDNS name ( hostname.local ) to access other hosts. Your best bet however is not trying to "discover" the other hosts but ask for them explicitly by host and share.

EDIT: Just a suggestion but open up a terminal and run this command:

Code: Select all

avahi-browse -at | grep IPv4
It should list at least all of your Linux machines.

There already exists a built in rule for Samba so all you need to do is run the following on all your machines:

Code: Select all

sudo ufw allow Samba
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
RobertGM
Level 2
Level 2
Posts: 75
Joined: Mon Dec 09, 2019 4:58 pm

Re: local network not working

Post by RobertGM »

It's getting better. However, still some wrinkles. And thanks for your persistence.
There are four computers:
CPR1 is Mint 19.3
CPR2 is Mint 19.3 upgraded to Mint 20.1
CPR3 is Mint 20.1 fresh
CPR4 is Mint 20.1 fresh
CPR4 can see folders for all four computers in the network file manager. It can only open the folder for CMP1. The other two (CPR2 & CPR3) plus CPR4 (itself) get the following:
"Failed to retrieve share list from server: Invalid argument."
And, under the icon is "CPR4 (File Sharing)"
On CPR1, only it's own network shares display. The others get " ...: Connection refused."
Running the avahi test yields this:

Code: Select all

usr@USR01:~$ avahi-browse -at | grep IPv4
+ enp6s0 IPv4 CPR4           _device-info._tcp    local
+ enp6s0 IPv4 CPR4           Microsoft Windows Network local
+ enp6s0 IPv4 CPR3           Microsoft Windows Network local
+ enp6s0 IPv4 CPR2           Microsoft Windows Network local
+ enp6s0 IPv4 CPR1           Microsoft Windows Network local
+     lo IPv4 CPR1           Microsoft Windows Network local
+ enp6s0 IPv4 CPR3           _device-info._tcp    local
+ enp6s0 IPv4 CPR2           _device-info._tcp    local
altair4
Level 20
Level 20
Posts: 11461
Joined: Tue Feb 03, 2009 10:27 am

Re: local network not working

Post by altair4 »

"Failed to retrieve share list from server: Invalid argument."
Let's talk about that for a minute.

You keep trying to "discover" then access a share by going through Network in Nemo rather than accessing the host and share explicitly. A reasonable expectation to be sure but it will not work in all cases because of a change to samba in Mint20 and a bug in gvfs.

The "invalid argument" is when Mint attempts to access a Samba server that has disabled SMB1 ( Mint20 ) on the server side because the bug in gvfs tries to connect to it with SMB1 on the client.

As I stated in yet another HowTo ( viewtopic.php?f=42&t=322404 ) you either have to bypass the gvfs bug by:

** Accessing the sever with a smb://hostname.local/share-name

** Or do a CIFS mount.

Or embrace the dark side and re-enable SMB1 ( Samba calls it NT1 ) on the server side by adding the following line under the workgroup = WORKGROUP line in smb.conf:

Code: Select all

server min protocol = NT1
You can try to just restart smbd sudo service smbd restart but you likely need to reboot it.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
RobertGM
Level 2
Level 2
Posts: 75
Joined: Mon Dec 09, 2019 4:58 pm

Re: local network not working

Post by RobertGM »

I used the cifs mount option and am making progress in that all four computers can now see each other. And I can open all folders (password required, of course).
But the display of folders is skewed.
The network folder on three computers shows:
CPR1 (File Sharing), CPR1 (File Sharing),
CPR2 (File Sharing), CPR2 (File Sharing),
CPR3 (File Sharing), CPR3 (File Sharing),
CPR4
Except on CPR4 it's the opposite:
CPR1, CPR2, CPR3, CPR4 (File Sharing), CPR4 (File Sharing).
altair4
Level 20
Level 20
Posts: 11461
Joined: Tue Feb 03, 2009 10:27 am

Re: local network not working

Post by altair4 »

If you are doing CIFS mounts why do you care how the hosts are displayed under Network? You aren't accessing the hosts that way.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
RobertGM
Level 2
Level 2
Posts: 75
Joined: Mon Dec 09, 2019 4:58 pm

Re: local network not working

Post by RobertGM »

I don't understand your comment altair4.
Along with wanting to access the other computers I want a GUI. Which means (to me) accessing network folders the same way I access folders on each computer; open Nemo File Manager and go to Network ...
And, while I don't need it, I still have the Windows Network folder which, after opening the domain/workgroup folder, presents the four "host" folders again, albeit without the duplicates or the (File Sharing) text beside each name.
altair4
Level 20
Level 20
Posts: 11461
Joined: Tue Feb 03, 2009 10:27 am

Re: local network not working

Post by altair4 »

Okey Dok .........

Samba will announce itself to the rest of the network using two different protocols: NetBIOS and mDNS ( Avahi ). NetBIOS attempts to resolve NetBIOS names whereas mDNS resolves by a hostname.local.

This is why you see duplicates. Since you are mDNS ( and I'm guessing here because of your avahi-browse output ) you can instruct each samba server to disable the NetBIOS announcement with another smb.conf edit - under the same place ( under workgroup = WORKGROUP ):

Code: Select all

disable netbios = yes
This is another situation where technically a sudo service smbd restart should do it but a reboot is probably required.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
RobertGM
Level 2
Level 2
Posts: 75
Joined: Mon Dec 09, 2019 4:58 pm

Re: local network not working

Post by RobertGM »

This, disable netbios = yes, did not work. Only the folder for the computer I am using (and Windows Network) displays in Nemo's network folder.
I don't understand your "Okey Dok ..." comment.
Double clicking on a folder to open it and see what's inside is, for me, far preferable to typing host/folder names in the address bar.
altair4
Level 20
Level 20
Posts: 11461
Joined: Tue Feb 03, 2009 10:27 am

Re: local network not working

Post by altair4 »

In reverse order:
Double clicking on a folder to open it and see what's inside is, for me, far preferable to typing host/folder names in the address bar.
But you said you were using a cifs mount. Now I'm confused.

I set up a debian server yesterday and created a quick Public share on it. On my Linux client I set up a cifs mount in fstab that looks like this:
//deb109.local/Public /media/Deb109Public cifs guest,uid=1000,noauto,nounix,user 0 0
It automatically sets up a link on the side panel of my file manager that when selected mounts the debian share and displays it's contents.
This, disable netbios = yes, did not work. Only the folder for the computer I am using (and Windows Network) displays in Nemo's network folder.
That I cannot reproduce. And with netbios disabled you should not see your system under Windows Network since you no longer have one. If it wasn't for your avahi-browse output I'd think avahi is disabled on all of your other systems.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
RobertGM
Level 2
Level 2
Posts: 75
Joined: Mon Dec 09, 2019 4:58 pm

Re: local network not working

Post by RobertGM »

I was mistaken when I said I am using a cifs mount as you directed.
I followed
embrace the dark side and re-enable SMB1
I added server min protocol = NT1 to samba.conf.
As it turns out, though, cifs-utils is also installed. Perhaps it should be removed?

What I expected, when installing Samba on Mint 20.1, was that it would behave the way it had in previous versions of Mint. But, as my OP points out, it wasn't working.
Now it is (except for the duplicates).

Avahi-autoipd, Avahi-daemon and Avahi-utils are installed as well.
As are: cifs-utils and Smbclient.
Should I add Smb2www?
altair4
Level 20
Level 20
Posts: 11461
Joined: Tue Feb 03, 2009 10:27 am

Re: local network not working

Post by altair4 »

Just out of curiosity when you see duplicates one should resolve to smb://hostname like this:
SMB-NetBIOS.png
SMB-NetBIOS.png (10.19 KiB) Viewed 3268 times
and the other should resolve to smb://hostname.local like this:
SMB-Avahi.png
SMB-Avahi.png (10.09 KiB) Viewed 3268 times
Is this not what you get?

EDIT: Do not add or delete anything.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
RobertGM
Level 2
Level 2
Posts: 75
Joined: Mon Dec 09, 2019 4:58 pm

Re: local network not working

Post by RobertGM »

In the network folder I see a list of icons with computer names under/beside them. The address bar says:
network:///
When I click on a computer folder the address bar changes to:
smb://cpr3/ or smb://cpr2, etc.

Avahi-autoipd, Avahi-daemon and Avahi-utils are installed.
As are: cifs-utils and Smbclient.
Should I add Smb2www?
altair4
Level 20
Level 20
Posts: 11461
Joined: Tue Feb 03, 2009 10:27 am

Re: local network not working

Post by altair4 »

When I click on a computer folder the address bar changes to:
smb://cpr3/ or smb://cpr2, etc.
That's NetBIOS.

What does the duplicate computer folder show in the address bar?
Should I add Smb2www?
No.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
RobertGM
Level 2
Level 2
Posts: 75
Joined: Mon Dec 09, 2019 4:58 pm

Re: local network not working

Post by RobertGM »

It's hard to say which is the duplicate.
One folder goes to:
smb://cpr4.local/
The other folder goes to:
smb://cpr4/
Both display the contents; IE: shared folders on the respective computer.
altair4
Level 20
Level 20
Posts: 11461
Joined: Tue Feb 03, 2009 10:27 am

Re: local network not working

Post by altair4 »

That's why I suggested going to cpr4 and disabling netbios in its smb.conf. Then it would only display the .local one. You said this doesn't work.

I have no explanation for that and cannot reproduce it.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Locked

Return to “Networking”