10.3: Potential Windows server browsing fix

Nov 20, '03 09:19:00AM

Contributed by: drclaw

Seems that people are having issues with browsing windows networks via the Panther Finder. Well I was anyway. The symptoms were that limited or no servers were being listed in the Network "directory" and sometimes servers where not characterised into workgroups (i.e. they all appeared in the Network root directory).

Using the built in SAMBA tools, I was able to isolate the problem: The Domain Master Browser (DMB) wasn't responding properly. Why this was, I'm unshure. The DMB is required for browsing of Windows networks, and is either specified by a network admin or is automatically selected by computers on the network. Watching a few processes from the terminal, I noticed that a smbclient process (using the IP of the DMB as an argument) was attempting to talk to the DMB (Panther uses smbclient and scripts to do this). The process was blocked until the DMB responded, which it didn't, thus the corresponding folders and icons the Network directory where not updated by the Finder, and the loss of network browsing.

The DMB for a workgroup can be found using the command nmblookup -M WORKGROUP, where WORKGROUP is the workgroup your Mac is in.

The solutions:

  1. If you have access, shut down the DMB machine so that the Windows network can 're-elect' another Windows DMB. If this doesn't work, try executing this command:
    smbcontrol nmbd force-election
    This should fix the problem.

  2. If that didn't work, or if you administrate your own network, you can make the Mac the DMB by editing the appropriate SAMBA configuration files (this is what I did).
Read the rest of the hint for my solution...

There are two files used in Panther for this. On located at /etc/smb.conf and the other in /var/run/smbbrowsing.conf. These files vary slightly, however, both are altered by using the Directory Access app (used when you want to change work groups, located in Utilities).

So in my particular situation, I wanted the Mac to take control and become the undisputed DMB of my home network . The steps performed were:

  1. In System preferences, stop Windows File Sharing.
  2. Use Directory Access to alter the your workgroup (if necessary).
  3. Add the following:
      domain master = yes
      preferred master = yes
      local master = yes
      os level = 255
    
    just below the line [global] in BOTH /etc/smb.conf AND /var/run/smbbrowsing.conf using vi or pico or some other editor. You will need super user privileges (sudo). Make backups just in case!!
  4. In System Preferences, start Windows File Sharing
  5. In the Terminal, execute the following:
      smbcontrol nmbd force-election
    
    This forces the Windows network to look for a new DMB (hopefully your Mac!).
That's it. Your Mac should now be in control of the Windows network (use the command at the beginning of the hint to see if your Mac's IP is listed). Be careful using this hint on networks that you do not manage, as your computer may take them over, and place you in a lot of trouble. Talk to your admin first!

One last thing to note. If your machine goes to sleep, the Windows network will not operate properly, unless it automatically finds another DMB, which is where this hint started....

Comments (21)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20031113060738627