Gert
Posts: 148
Joined: Wed Oct 24, 2012 10:19 pm

Samba uses machine name instead of netbios name.

Sat Sep 14, 2019 9:13 pm

Hello All,

Using samba on RPI4B with buster.
I'm giving a netbios name for the server, but windows 7 PC decides to use the machine name instead.
The shares themselves are OK and access permissions work fine.
Just the PC ignoring of the name I've given to the server is annoying.

smb.conf

Code: Select all

#======================= Global Settings =======================

[global]
workgroup = GGHOME
netbios name = raspnas4b
server string = raspnas4b server
security = user
server max protocol = NT1
ntlm auth = yes

### Logging
log file = /var/log/samba/log.%m
max log size = 1000
panic action = /usr/share/samba/panic-action %d

### Authentication
security = user
map to guest = bad user

#======================= Shared Folders =======================

[rpi4_usbdisk]
path = /media/usbdisk
guest ok = yes
guest account = ftp
browseable = yes
read only = no
create mask = 0777
directory mask = 0777
writeable = yes
admin users = everyone

[rpi4_usbstick]
path = /media/usbstick
guest ok = yes
guest account = ftp
browseable = yes
read only = no
create mask = 0777
directory mask = 0777
writeable = yes
admin users = everyone


Machine name:

Code: Select all

$ hostname
rpi4b

However Windows PC shows the name of the machine RPI4B in the network folder. It has worked before as evidenced by the other RPIs (older OS versions) showing up.

Image

Any help is appreciated.

Thanks,
Gert

hortimech
Posts: 332
Joined: Wed Apr 08, 2015 5:52 pm

Re: Samba uses machine name instead of netbios name.

Sun Sep 15, 2019 8:51 am

There is a valid reason why this is happening, the NetBIOS name MUST be the computers hostname, you cannot change what is displayed on Windows by setting the 'netbios name' parameter.

Gert
Posts: 148
Joined: Wed Oct 24, 2012 10:19 pm

Re: Samba uses machine name instead of netbios name.

Sun Sep 15, 2019 8:59 pm

Hi,
hortimech wrote:
Sun Sep 15, 2019 8:51 am
There is a valid reason why this is happening, the NetBIOS name MUST be the computers hostname, you cannot change what is displayed on Windows by setting the 'netbios name' parameter.
It works for the other RPIs. See below example vs above screen copy. There must be a subtle version change that creates the bug.

Config smb.conf for rpi2 machine:

Code: Select all

#======================= Global Settings =======================
[global]
workgroup = GGHOME
server string = raspnas2 server
netbios name = raspnas2
dns proxy = no

### Logging
log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d

### Authentication
security = user
map to guest = bad user

#======================= Sharered Folders =======================
[rpi2_usbstick]
path = /media/usbstick
guest ok = yes
guest account = ftp
browseable = yes
read only = no
create mask = 0777
directory mask = 0777
writeable = yes
admin users = everyone
Cheers,
Gert

Andyroo

Re: Samba uses machine name instead of netbios name.

Sun Sep 15, 2019 9:10 pm

Have you anything in the firewall of the raspnas4 box that could be blocking name resolution?

You could try this and change the order of the resolution to see if anything works

Code: Select all

[global]
    name resolve order = wins lmhosts hosts bcast

hortimech
Posts: 332
Joined: Wed Apr 08, 2015 5:52 pm

Re: Samba uses machine name instead of netbios name.

Mon Sep 16, 2019 8:47 am

There are two ways to find a Samba machine, network browsing and via dns. If you use dns, the NetBIOS name must the same as the computers short hostname, but if you use network browsing, I suppose you could use any valid name. However, I cannot really see any valid reason to do this. It would be easier and safer to change the hostname of the rpi, it doesn't have to be called 'raspberrypi'
Remember that network browsing is going away, it relies on SMBv1 and this is already deprecated on Windows 10 and will be deprecated by Samba when 4.11.0 is released.

Return to “Troubleshooting”