network name and samba - does not work after reboot

I am trying to have accessible computer by its network name (same as hostname) by ping and Samba client from other computers and one directory shared on my laptop.
I simple, trivial wish I hope. Nothing extravagant. Something what every Windows user has out-of-the box, just to select a shared directory.
However I struggle hard to do the same with linux.

Sharing directory with samba is relatively easy, the issues I have is with my laptop network name. It is not recognized/propagated to the local network.

I cannot rely on static data in /etc/hosts. This is a laptop not a server, I move it between different networks.

To achieve propagation of my network name (hostname) dynamically, so everyone in the local network can at least ping me, I was advised to use winbind (winbindd), that is to rely on MS NetBios technology There is no native linux technology to achieve this? shame! what about plain/dynamic DNS? why it is not my network name not propagated to my local DNS server/wifi/rooter?

To do that I was advised to do:

  • run winbind service (winbindd daemon)
  • run samba service (umm, not sure if this is necessary for network name propagation, but I also want to share data so lets keep it as an essential).
  • add “wins” to /etc/nsswitch.conf to “hosts” section

Well, it seems to work on my other two computers with Ubuntu and Mandriva well. But not on Suse :frowning:
Well, not completely, not permanently.
It magically start working when I call “Yast -> Samba Configuration”.
No change here (everything is already set: Domain Name, Not a DC, Netbios Hostname, Wins server support=yes, use Wins for Hostname Resolution) just hit OK.
It runs SOMETHING in the background (some scripts) for a few seconds.
And then abrakadabra, everything is fine, my network name is recognized, everyone can use my samba exposed directory, smb4k sees me in the Network Neighborhood.
BUT when I restart, I am “back in square one”.
Pinging my name does not work, smb4k does not see me, or cannot find me even by IP! Samba sharing works by using direct IP. Not all clients support connecting by IP notably not smb4k. To use Samba properly you have to sort out network name visibility fist.

I would like to make “Yast -> Samba Configuration” achievements somewhat more PERMANENT.
What exactly runs when I hit OK?
No new server/daemon was started. I checked PS, nothing with newer PID appeared. And samba and winbind are started on boot, they were running indeed.
No change in configuration was made. I checked all changes made in /etc - but none found!

Where is winbind configuration? smb.conf?
Do I need to run wins server/client, another daemon?

Any hint?
Many thanks for any help!

More details:

espinosa@espinosadell:~> hostname

espinosa@espinosadell:~> cat /etc/samba/smb.conf

Samba config file created using SWAT

from UNKNOWN (

Date: 2011/06/19 15:45:43

workgroup = HOMENET
passdb backend = smbpasswd
wide links = Yes
follow symlinks = yes
unix extensions = no
netbios name = espinosadell
wins support = Yes

comment = public
path = /home/espinosa/public
read only = No

/etc/nsswitch.conf (shortened):
hosts: files dns wins
networks: files dns
services: files

(old values for hosts were: files mdns4_minimal [NOTFOUND=return] dns, what is the mdns4_minimal [NOTFOUND=return]??? I rather removed it)

espinosa@espinosadell:~> cat /etc/HOSTNAME
(I removed domain name, all other computers have just one name, hostname, …and they work)

espinosa@espinosadell:~> cat /etc/hosts localhost

special IPv6 addresses

::1 localhost ipv6-localhost ipv6-loopback

fe00::0 ipv6-localnet

ff00::0 ipv6-mcastprefix
ff02::1 ipv6-allnodes
ff02::2 ipv6-allrouters
ff02::3 ipv6-allhosts

(I removed “espinosadell” from the localhost line. To test ping to my machine locally, to test that that it takes “espinosadell” from network not “hosts” file)

espinosa@espinosadell:~> rpm -qa | grep -i samba
espinosa@espinosadell:~> rpm -qa | grep -i winbind

When computers do not show up in a network browse, it often relates to the browser master. If your laptop becomes the master when started, there is an upset in the network until the new browser becomes aware of all computers on the network so a time lag before seeing all PC’s is normal. The [global] setting in samba is called:

local master = no 


local master = yes

local master
This option allows nmbd (NetBIOS name server to provide NetBIOS over IP naming services to clients) to try and become a local master browser on a subnet. If set to no then nmbd will not attempt to become a local master browser on a subnet and will also lose in all browsing elections. By default this value is set to yes. Setting this value to yes doesn’t mean that Samba will become the local master browser on a subnet, just that nmbd will participate in elections for local master browser.
Setting this value to no will cause nmbd never to become a local master browser.
Default: *local master = yes *

This works best if one PC is left on or turned on first with this setting set to yes while the others are set to no. Not having the optiion set is the same as saying yes. Also, I have not been setting wins=yes but to no and I have not found using windbond to do anything but create errors in the background, wasting PC resources and is not the source of the problem you are seeing. There is a great resource for Samba you can find here:

openSUSE SuSE Linux HOWTOs and Tutorials by Swerdna

Thank You,

Unfortunatelly, it did not help.
I put explicitly local master = no (I guess it is what I need) to my smb.conf
It still does not work.

I also removed other options (one by one):
netbios name = espinosadell (Ubuntu does not have it either, and Ubuntu works)
wins support = Yes (this starts WINS server in Samba server. Do I need WINS server? I don’t know. I just need my network name to be visible)

Still with negative result.

I looked into Ubutnu smb.conf. Everything is commented out. No special option. Just workgroup name, logging, security, and (huh) printer sharing, is set. (both # and ; means comments right?)
Nothing regarding netbios, wins, winbind, …

Also Yast ceased to work. I played with options a bit, no help, returned back to options they worked last time - and this time it did not help. Magic trick is over.

It is very, very frustrating :frowning:

I’d do three things:

  • Fix the Samba/AppArmor bug (if you’re using openSUSE 11.4) check AppArmor as follows:

GoTo Yast -> Novell AppArmor -> AppArmor Control Panel,
Click on Set profile modes (Configure) button,
Highlight the entries ‘usr.sbin.nmbd’ and ‘usr.sbin.smbd’ in turn and, for each, click the Toggle Mode button to set the mode from ‘enforce’ to ‘complain’.
Click Done, OK etc etc.

  • Make the [global] stanza of smb.conf to look like this:
        workgroup = HOMENET
        netbios name = espinosadell
        server string = 
        map to guest = Bad User
        name resolve order = bcast host lmhosts wins
        printcap name = cups
        os level = 64
        preferred master = Auto
        local master = Yes
        usershare allow guests = Yes
        cups options = raw
        use client driver = Yes
  • Turn off winbind (a carry over from Ububtu who do things differently)

After that, run this command to get the machine looking around: su -c “rcnmb restart;rcsmb restart”
And for luck, reboot (re-announces the machine).

Why not try this for your global section and see if it helps…

    workgroup = HOMENET
    netbios name = espinosadell
    server string = The Master of the Universe
    security = SHARE
    map to guest = Bad User
    name resolve order = wins bcast host lmhosts
    printcap name = cups
    preferred master = Yes
    local master = No
    domain master = No
    wins support = Yes
    usershare allow guests = Yes
    usershare max shares = 100
    cups options = raw

Thank You,

Just to be thorough, on the Ubuntu machine, run this command and post the results here:“testparm -s”

Opening thread after 10 months.
Just to give you some feedback.

Thank you all involved, all trying to help. Unfortunately news is negative.
I have tried everything suggested. To no avail.
I did switch off AppArmour completely, firewall as well, to no avail.
I gave up and “solved” it by not using my laptop as Samba server, sharing files through other computers.
I have finally upgraded my OS, to openSuse 12.1 so I can try fresh. To attest or not 11.3 bug theory.

I have also looked for a winbind alternative. Some other system providing dynamic peer-to-peer decentralized network name recognition.
Winbing is deprecated, the protocol used, even by its original creator - Microsoft. High time to look for an alternative. Something newer Windows have in LLMNR.
There seem to be only one alternative - Avahi.
However, this also fails, because of .local subdomain, or pseudo-domain, Avahi uses. It is not recognized by. See details in my post here:
linux networking - Configure Avahi nss-mdns not to use local suffix with hostnames because of issue in mounting Samba share - Server Fault
Everyone is welcome to help.

Is openSuse version of nss-mdns compiled with --enable-search-domains?
This should make nss-mdns honor /etc/resolf.conf configuration, notably the “search local” command.
This could potentially solve my Samba & hostnames issue. Perhaps other distributions do that.

i noticed this too, i’d horribly new at this but i think the issue is the service nmb. check after a fresh reboot to see if its running, mine wasnt after reboots. going to yast>samba server conf area and then just clicking okay I recheck the status of nmb and its active and I am able to resolve the host name off a different pc. so I set the nmb service to start on boot and my problem is solved.