[SOLVED] Error connecting windows share (SMB, UFW & kernel 4.8)

Connection sharing, Firewall, Samba..etc
Forum rules
Before you post please read how to get help
Arrababiski
Level 1
Level 1
Posts: 25
Joined: Wed Aug 24, 2016 3:21 pm
Location: España

[SOLVED] Error connecting windows share (SMB, UFW & kernel 4.8)

Postby Arrababiski » Wed Dec 07, 2016 5:46 am

I recently upgraded my Mint 18 (x86_64) from kernel 4.4 to 4.8.30. Since then, I can't connect via samba to a windows shared folder in a W7 computer. I try smb://w7_computer/photos/ in Caja 1.14.2 but only to get this error:

Can't show <smb://w7_computer/photos/>
Error: Can't mount the shared folder in
Windows: invalid argument
Select another viewer and try again

Restarting with kernel 4.4 works fine as it did before the upgrade to 4.8.
Disabling the firewall with "sudo ufw disable" works again.
Setting a firewall rule allowing incoming and outgoing traffic from/to 192.168.1.25 (the IP of the W7 computer with the shared folder) doesn't work.

Any other idea...?

What happens with UFW? After upgrading from kernel 4.2 to 4.4 stopped connecting Epson scanners as described here:

viewtopic.php?f=51&t=228387&p=1213851#p1206645

Now stops connecting to shared folders. I'm really stunned... :(
Last edited by Arrababiski on Wed Dec 07, 2016 12:10 pm, edited 1 time in total.

amuk
Level 1
Level 1
Posts: 2
Joined: Wed Dec 07, 2016 7:44 am

Re: Error connecting windows share (SMB, UFW & kernel 4.8)

Postby amuk » Wed Dec 07, 2016 7:55 am

I was able to solve my issue by adding a few lines to /etc/samba/smb.conf
In the GLOBAL SETTINGS I updated my "workgroup" to the workgroup of my windows computer.
I then added this line under the updated workgroup: name resolve order = bcast host

I hope this helps. It was driving me mad till I found it. I am still very new to Linux Mint and enjoy a lot.

Arrababiski
Level 1
Level 1
Posts: 25
Joined: Wed Aug 24, 2016 3:21 pm
Location: España

Re: Error connecting windows share (SMB, UFW & kernel 4.8)

Postby Arrababiski » Wed Dec 07, 2016 11:52 am

Hi amuk!

amuk wrote:I was able to solve my issue by adding a few lines to /etc/samba/smb.conf
In the GLOBAL SETTINGS I updated my "workgroup" to the workgroup of my windows computer.
I then added this line under the updated workgroup: name resolve order = bcast host

I hope this helps. It was driving me mad till I found it. I am still very new to Linux Mint and enjoy a lot.


Thank for your help, but the workgroup was already the same and adding the "name resolver order" line didn't solve the issue.

Fortunately I found one solution. Tried "sudo ufw allow samba" and didn't work. This morning I was creating firewall rules in Terminal via "sudo ufw allow 192.168.1.25" and "sudo ufw allow out 192.168.1.25", none of all worked. But now tried creating a rule in GUFW to allow incoming traffic from 192.168.1.25 (the W7 machine) to 192.168.1.30 (Linux Mint machine) and this was the one, finally worked!!! The Mint computer (.30) has a dynamic IP, also tried to allow incoming traffic from 192.168.1.25 to 127.0.0.1 trying to find a firewall rule valid even if the Mint IP changes but this way doesn't work. Changing Mint dynamic IP to a static IP finally solved the question.

But the disturbing matter for me are still those unexpected changes in firewall behaviour each time I update the kernel... :(

amuk
Level 1
Level 1
Posts: 2
Joined: Wed Dec 07, 2016 7:44 am

Re: [SOLVED] Error connecting windows share (SMB, UFW & kernel 4.8)

Postby amuk » Mon Jan 02, 2017 8:42 pm

I am a noob so please excuse the level of my contribution. With that said, I have found that the Firewall takes a little extra work coming from the Windows platform for the past 20 years. Yes yes another MS convert in the house. Glad you got it all worked out. I am actually searching for the right place to express my opinion regarding the friendliness of Linux Mint, 1 that it is very very friendly and the other being that on a fresh install Windows Shares should be visible. Just figured I may have another person that supports my thought on this. If so please reply or message me with the correct place to express that opinion in the Linux Mint Forum.

peter_szekeres
Level 1
Level 1
Posts: 6
Joined: Mon Mar 20, 2017 2:28 am

Re: [SOLVED] Error connecting windows share (SMB, UFW & kernel 4.8)

Postby peter_szekeres » Mon Mar 20, 2017 2:39 am

I was also affected by this strange bug, but finally managed to find a solution for it. I posted an Ask Ubuntu ticket about it over here:https://askubuntu.com/questions/875845/kernel-4-8-ufw-and-smb-not-working-together

A little update on the solution, if you ever have to make changes to any standing rules to your ufw firewall by the gufw GUI application or in the terminal you have to make sure to save the changes with "sudo dpkg-reconfigure iptables-persistent" so the changes will be saved and loaded in the next instance you start after rebooting your computer. Without it the rules will be set and visible in your gufw application but the iptables will tell you otherwise, so make sure you save the rules.

jrichard326
Level 1
Level 1
Posts: 11
Joined: Thu Mar 09, 2017 8:06 am

Re: [SOLVED] Error connecting windows share (SMB, UFW & kernel 4.8)

Postby jrichard326 » Tue Jul 04, 2017 7:05 am

The solution from peter_szekeres worked for me on Mint 18.2 xfce x64 with Kernel 4.10.0-26.
Thanks.

allanr
Level 1
Level 1
Posts: 7
Joined: Tue Feb 07, 2017 1:02 pm
Location: Scotland

Re: [SOLVED] Error connecting windows share (SMB, UFW & kernel 4.8)

Postby allanr » Sat Jul 08, 2017 5:39 pm

Given that any new Mint 18.2 installations will load the 4.8 kernel by default, I expect more and more people will run into this network issue.
(with kernel 4.8/4.10, Samba and ufw/gufw firewall fails to connect using "hostname", but absolute IP address is ok e.g. 192.168.0.2.)

I'd be interested to hear peoples view(s) on the various workarounds:

1) Disable gufw firewall !?
2) Set firewall Incoming to "Allow" (is that better/worse than 1) ?
3) Revert to kernel 4.4
4) Apply peter_szekeres iptables modification and install iptables-persistant package. The challenge thereafter is remembering to keep gufw changes synced with iptables.
5) Any other ?
Image

User avatar
Vogelfreund
Level 1
Level 1
Posts: 7
Joined: Sun Jan 29, 2017 6:29 am
Location: Basel, Switzerland
Contact:

Re: [SOLVED] Error connecting windows share (SMB, UFW & kernel 4.8)

Postby Vogelfreund » Sun Jul 30, 2017 8:45 am

I run into the same problem after I updated from 18.1. to 18.2. Even though the SAMBA rules for gufw are set, it no longer works. I'm also interested in possible workarounds.

User avatar
Vogelfreund
Level 1
Level 1
Posts: 7
Joined: Sun Jan 29, 2017 6:29 am
Location: Basel, Switzerland
Contact:

Re: [SOLVED] Error connecting windows share (SMB, UFW & kernel 4.8)

Postby Vogelfreund » Mon Jul 31, 2017 5:45 am

I seems that any rules in the firewall are ignored, not only the ones for SAMBA

User avatar
Vogelfreund
Level 1
Level 1
Posts: 7
Joined: Sun Jan 29, 2017 6:29 am
Location: Basel, Switzerland
Contact:

Re: [SOLVED] Error connecting windows share (SMB, UFW & kernel 4.8)

Postby Vogelfreund » Mon Jul 31, 2017 6:47 am

I uninstalled UFW and installed firewalld. Same problem there, rules are not respected.

DrM
Level 2
Level 2
Posts: 79
Joined: Sun Feb 23, 2014 4:03 pm

Re: [SOLVED] Error connecting windows share (SMB, UFW & kernel 4.8)

Postby DrM » Sat Oct 28, 2017 11:21 am

allanr wrote:Given that any new Mint 18.2 installations will load the 4.8 kernel by default, I expect more and more people will run into this network issue.
(with kernel 4.8/4.10, Samba and ufw/gufw firewall fails to connect using "hostname", but absolute IP address is ok e.g. 192.168.0.2.)


Using absolute IP addresses in stead of using hostnames to connect to other shares, is rather tedious and I wouldn't like to run my system without a firewall enabled. For example the "sudo mount -t cifs \\hostname/share /mnt/share o- username=,password=" is much better to use than "sudo mount -t cifs //IP-address/share /mnt/share o- username=,password=". This problem hasn't still been fixed within the 4.11.0-14-generic kernel!


Return to “Other networking topics”