paulo07x
Posts: 11
Joined: Sun Jul 28, 2019 2:50 pm

Strange Problem with samba share, can access on laptop but not from a pc?

Sat Aug 10, 2019 3:00 pm

Hi, I have set up a raspberry pi 4 with an external hard drive connected to store files so I can access them from my local home network.

I installed samba ok, configured it and I can access the shared folder from my laptop (Windows 10) but it just won't connect from my PC (Windows 10 too). I was wondering if anyone could help me figure this out?

Image


I think my PC does detect the raspberry pi because it is trying to connect - it just won't connect.



my smb.conf for the shared folder is:

[shared]
path=/media/pi/med
browseable=Yes
create mask=0777
directory mask=0777
public=no

I have tried to disable my firewall and AV to see if that may be the problem but it still would not connect.

On my laptop, it works ok, I can connect to the shared folder on raspberry pi.

My network:

Image


I'm out of ideas...

bls
Posts: 211
Joined: Mon Oct 22, 2018 11:25 pm

Re: Strange Problem with samba share, can access on laptop but not from a pc?

Sat Aug 10, 2019 3:06 pm

Two thoughts: 1) Your smb.conf has the share name as "shared", but your screen shot is showing you accessing \\raspberrypi\share (without the "d"). What is the result if you use the correct share name? 2) If that's just a screen shot fluke, what is the result if you go to a command prompt and type "ping raspberrypi" (obviously, without the quotes). Can it ping the Pi?

Andyroo
Posts: 4240
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Strange Problem with samba share, can access on laptop but not from a pc?

Sat Aug 10, 2019 4:44 pm

Assuming you can ping the Pi my global is a bit different:

Code: Select all

[global]
    netbios name = xxxx
    server string = xxxx
    workgroup = xxxx
    mdns name = mdns
    log file = /var/log/samba/log
    max log size = 1000
    syslog = 0
    server role = standalone server
    unix password sync = no
netbios name and workgroup make Win 10 happier
Server role stops some modules being loaded
unix password sync stops you accidentally changing the Pi password if you are using that user for the share

Its also worth check SMB support of the two machines, though to be honest the simplest way to force Samba is to add

Code: Select all

min protocol = SMB2
or

Code: Select all

min protocol = SMB3
The latter being for Samba v4 or above only.
Need Pi spray - these things are breeding in my house...

paulo07x
Posts: 11
Joined: Sun Jul 28, 2019 2:50 pm

Re: Strange Problem with samba share, can access on laptop but not from a pc?

Sat Aug 10, 2019 6:12 pm

Thanks for all of the suggestion. Yes, the share /shared was screenshot mistake (wrong one)

So I have tried to:

ping the pi and its weird:

I can ping pi's IP no problem but when I ping the hostname it pings different IP (I think):

Image


not sure where it's coming from, I've checked windows host file and nothing suspicious there.

I have added

Code: Select all

[global]
    netbios name = xxxx
    server string = xxxx
    workgroup = xxxx
    mdns name = mdns
    log file = /var/log/samba/log
    max log size = 1000
    syslog = 0
    server role = standalone server
    unix password sync = no
but no change.. I did restart with sudo service smbd restart

I have also used angry IP scanner to make sure the hostname is ok and assigned to the rig IP and it looks fine I think:

Image

hmm...

bls
Posts: 211
Joined: Mon Oct 22, 2018 11:25 pm

Re: Strange Problem with samba share, can access on laptop but not from a pc?

Sat Aug 10, 2019 6:38 pm

You don’t say how your DNS is set up on your LAN, but this appears to be DNS related.Can you ping raspberrypi.local? If so, then you’ll need to dig into Windows control panel network adapter IPV4 DNS settings are configured. There are some settings there about applying domain names to host names for lookup, either depending on what your DHCP server supplies or a hardwired lookup list.

Without knowing more about your configuration, can’t be more prescriptive, but make sure that your laptop and PC have configured the same there.

Andyroo
Posts: 4240
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Strange Problem with samba share, can access on laptop but not from a pc?

Sat Aug 10, 2019 6:43 pm

Have you changed the IP address of the Pi at all?

It may be worth running

Code: Select all

ipconfig /flushdns
on PC with the two addresses.

Also check the HOST file c:\Windows\System32\Drivers\etc\hosts and check that you do not have an entry for the Pi in there.
Need Pi spray - these things are breeding in my house...

paulo07x
Posts: 11
Joined: Sun Jul 28, 2019 2:50 pm

Re: Strange Problem with samba share, can access on laptop but not from a pc?

Sat Aug 10, 2019 7:04 pm

Ok, thanks for all of the advice.

It turned out to be my ISP DNS hijacking thing (TalkTalk - apparently uses this service to if the hostname can not be resolved).

I have set up my router to OpenDNS and all works well now.

Thanks again for all of the suggestions.

Andyroo
Posts: 4240
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Strange Problem with samba share, can access on laptop but not from a pc?

Sat Aug 10, 2019 8:06 pm

Interesting but worrying - it should not have returned ANY address (NXDOMAIN?) let alone a wrong one on the local network!

I wonder if it would have been OK if you used the full name of raspberrypi.local ? At least TalkTalk should not have tried to give it an address as '.local' should not go outside...

Maybe time to buy a small business connection? I miss mine :cry:
Need Pi spray - these things are breeding in my house...

paulo07x
Posts: 11
Joined: Sun Jul 28, 2019 2:50 pm

Re: Strange Problem with samba share, can access on laptop but not from a pc?

Sat Aug 10, 2019 9:20 pm

Andyroo wrote:
Sat Aug 10, 2019 8:06 pm
Interesting but worrying - it should not have returned ANY address (NXDOMAIN?) let alone a wrong one on the local network!

I wonder if it would have been OK if you used the full name of raspberrypi.local ? At least TalkTalk should not have tried to give it an address as '.local' should not go outside...

Maybe time to buy a small business connection? I miss mine :cry:
yeah, it was quite surprising and worrying at the same time. I have found an article about it here: https://manurevah.com/blah/en/blog/DNS- ... and-Others

apparently "Their solution substitutes NXDOMAIN (non-existant domain) replies with A records to an IP that hosts spam (non solicited advertising)."

... but why it tried to resolve it to non-local address no idea. well, it works ok now.
Wish I could have a business connection but they are a bit costly. apart for this issue, I'm pretty happy with my connection, got decent speeds and never had any downtime as far as I can remember.

bls
Posts: 211
Joined: Mon Oct 22, 2018 11:25 pm

Re: Strange Problem with samba share, can access on laptop but not from a pc?

Sat Aug 10, 2019 9:24 pm

I think my ISP’s DNS does this. I haven’t used it in years, but they viewed it as being “friendly” and “helpful” :lol:

Andyroo
Posts: 4240
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Strange Problem with samba share, can access on laptop but not from a pc?

Sat Aug 10, 2019 11:55 pm

WOW :o

I was involved in the TT breach of data so I would not use them again anyway :lol: (personal choice - others are happy etc etc - this is a personal comment and does not reflect the thoughts of others such as (but not limited to) the Raspberry Pi Trading or Foundation companies or hosts of this web site).
Need Pi spray - these things are breeding in my house...

Return to “Troubleshooting”