samba netbios name

In my smb.conf file I’ve got the statement

netbios name = USMCL0SMITH1

In SUSE 11.1 the samba shares appeared under the above name. In 11.2 I’m using the same smb.conf file, but the shares appear under LINUX-7JRK, which is the computer’s hostname. Why is that, and how do I fix it? Thanks!

That’s strange, can you post here the [global] stanza of smb.conf. You can see it with this command:

cat /etc/samba/smb.conf

OK. Well, samba has been pretty flaky. I can no longer reproduce the original question because I can’t get samba show up on the network any more. Even on the host computer. Not sure how that happened.

Firewall is off.

Here is the smb.conf file. Works perfectly under 11.1, and 11.0 before that. I’m pretty sure it dates back to 10-something. :\

[global]

;WINS server
	netbios name = USMCL0SMITH1
	security = share
	encrypt passwords = yes
	domain logons = no
	domain master = no
	local master = yes
	wins support = yes
	wins proxy = yes
	os level = 1

; Browsing
	server string = Samba
	workgroup = WORKGROUP
	guest account = pcguest
	public = yes
	browseable = yes
	lm announce = yes
	browse list = yes
	auto services = yes
	guest ok = yes
	preload = yes

[virtualbox]
	comment = Data Share
	hosts allow = 192.168.254. localhost 
	path = /media/fat32/data/
	read only = no
	guest ok = yes
	guest only = yes
	public = yes

[mailbox]
	comment = Public Share
	hosts allow = all
	path = /media/fat32/public/
	read only = no
	guest ok = yes
	guest only = yes
	public = yes

The first share is supposed to be accessible only to my vmware XP machine. I know it says virtualbox - I used to use virtualbox - too lazy to change it. The second is a public share - read/write.

Any suggestions appreciated.

You’ve made the PC into a wins server. But the underlying name resolution mechanism (by which named machines are sought on the lan) is set as the default, which is to not use a wins server, so there’s confusion. And if you have a wins server you must code that information into all the other machines, if not there will be even more confusion. [Wins servers are often found in medium enterprise businesses, or small businesses that have been conned into unnecessary expenditure]

A few questions:

  1. Did you really mean to setup name resolution on the network using a wins server? Or do you want to use the default techniques that you would find in a home or small office network?
  2. And what operating systems are running on your LAN?

You say that like it’s a Bad Thing.:wink: I can’t remember why I originally chose to do it this way - I think it was to allow name resolution across the two subnets (the LAN and the vmware virtual net).

As I said, this smb.conf has worked well for me in the past. I need it to do two things:

  1. Provide a share point between the host and a virtual XP machine running on the host, and

  2. Provide a share point for other computers on the LAN to exchange files with me.

As to the environment, that varies. I travel, and I plop my laptop down in whatever office environment I end up being in and hope for the best. Under 11.1, the smb.conf file worked just fine in my office (big-four consulting firm) and at home a computer or two and wireless. In the various offices that I traveled to around the world, I can say that it worked at least part of the time. At this moment, under 11.2 I am currently having trouble getting my laptop to be visible to itself, let alone anyone else. I can see my wife’s Vista computer just fine.

Do you want to bridge subnets still?

Yes, I need to bridge the subnets.

I fully admit that the smb.conf file lacks elegance. Since it’s given me good service, before I go about completely changing it, I would first like to know what has changed in samba in 11.2 that might cause my shares to be un-browsable?

I can’t actually find any real difference in the two versions, which suggests that there may be something else on my system that is blocking samba. Suggestions?

OK. I seem to have things working, at least on my home network. I am getting the desired behavior from the following changes to the above smb.conf file:

[global]
;WINS server
	netbios name = USMCL0SMITH1
	security = share
	encrypt passwords = yes
#	domain logons = no
#	domain master = no
#	local master = yes
#	wins support = yes
#	wins proxy = yes
	name resolve order = wins lmhosts hosts bcast
	interfaces eth0 wlan0 lo
        bind interfaces only = yes 
#	os level = 1

; Browsing
	server string = Samba
	workgroup = WORKGROUP
	guest account = pcguest
	public = yes
	browseable = yes
	lm announce = yes
	browse list = yes
	auto services = yes
	guest ok = yes
	preload = yes

But what’s more, I could not get the computer to resolve netbios names without changing /etc/nsswitch.conf. In particular, I needed to make this change:

#hosts:	files mdns4_minimal [NOTFOUND=return] dns wins
hosts:  files mdns4_minimal [NOTFOUND=return] wins dns

I will report further if I have trouble/solutions on other networks.

I’m glad it’s working for you.

I was trying to think of away to advise you but it’s difficult against your requirements to cross subnets. Even now, you have “wins” turned off but you instruct it in name resolve order to use wins for name resolution when it should be bcast that comes first, that’s likely why you have to up the priority on wins in nsswitch.conf.

But forget all that, because it’s working, and there’s a powerful saying in Linux: “if it works, don’t fix it”.

Yeah, I admit that samba is something that I have always struggled with. Back in the beginning (around SUSE 10.1) I put together a smb.conf file that should have worked, but didn’t. What followed was an endless stream of “try this” suggestions until I got something that worked. I had to change it every release up until 11.0, and occasionally upgrading samba within a version, because, well, I don’t know why - samba just changed. There’s a lot of magic involved in getting samba to work.

Anyway, it is working today, including across subnets, meaning that my vmware XP box can see my wife’s vista box, and visa versa. I have no idea why. XD It may not work in the office tomorrow.

The order of host priorities seems to be standard advise given over in ubuntu land, btw.

The one thing that has me seriously stumped is just how my vmware xp machine is seeing anything. It is connecting through the interface vmnet8, which is conspicuously absent from the interfaces statement in smb.conf.:\

This might be worth a read: Samba and Suse: HowTo Set up an openSUSE-Windows Home Office LAN/Network. Versions 10, 11

The order of host priorities seems to be standard advise given over in ubuntu land, btw.
Name resolve order is not well understood. There’s an extensive writeup on it here as it relates to Ubuntu: HowTo Configure Samba Ubuntu Windows Network Browsing on a SOHO LAN In particular see this section: About the Name Resolve Order

Advice in the Ubuntu forums to put wins first would be correct only in cases where there was a wins server on the network. In microsoft homes, the norm, occurrences of wins servers would be be infinitesimal :wink: