NOTE! This site uses cookies and similar technologies.

If you not change browser settings, you agree to it.

I understand

Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Having problems browsing SAMBA shares? ..README

Having problems browsing SAMBA shares? ..README 6 years 2 months ago #1

  • chewitt
  • chewitt's Avatar
I've seen "SAMBA isn't working, now I can't connect to shares on my HTPC" being posted in a few places so I thought I'd post a note to educate people on what's going on. The statement that SAMBA is broken is rarely true. It's usually running fine, and the cause of the problem is simply the ugly way that NetBios over TCP/IP name resolution works.

The reason you cannot see an smb://share "that was working 5 mins ago" is down to browser election fights between the computers on the network. An election fight is a peer-to-peer negotiation over who gets elected to be in charge of the domain(s) and/or local master browser list; the list of computer names that will appear in the Windows Network Neighbourhood (or it's current equivalent). The machine that wins the election is determined through a combination of uptime, OS version and config settings - meaning the outcome can be unpredictable, and the election process can take time (minutes not milliseconds). Over time your HTPC (as longest uptime device) has probably been elected the master browser, so if you reboot your HTPC the browser list is gone and the remaining machines on the network will restart an election process to decide who owns/creates the replacement. Once the election is over it will take time (again, minutes not milliseconds) to distribute the list and ensure every client has the same version. If you reboot other computers they will join the network and announce their availability, so an election discussion takes place to see if they should become the master browser. It's easy to see how this process may go titsup.com from time to time. Sadly, Mac and Linux computers can suffer the same issues as their Windows counterparts as they (via their local SAMBA client) are ultimately participating in the same process.

In corporate networks this issue is mitigated by having a pre-determined machine configured to win all the elections and maintain the browser list(s) - usually a domain controller. Rigging the election guarantees the election result and ensures the election process is completed quicker. The good news is that it's simple to configure SAMBA on your OE based HTPC to do the same thing. The reason for picking the HTPC to be the master browser is that it's probably the going to be the computer that has the highest uptime in your home network.

First, ensure you have /storage/.config/samba.conf. If you don't there is a sample one in the directory that can be renamed. Then add the lines indicated below to your [global] section:
[global]
  server string = Media Centre(%i)
  workgroup = HOME
  domain master = yes  <-- add this line
  local master = yes  <-- add this line
  preferred master = yes  <-- add this line
  os level = 100  <-- add this line
  netbios name = AppleTV
  security = share
  guest account = root
  socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536
  wins support = yes
  syslog only = yes
  name resolve order = lmhosts wins bcast host
  printcap name = /dev/null
  load printers = no
Even if you do this the problem will never be completely eliminated, but Windows network browsing should in theory be more consistent (in theory!). If it does not clear the problem the solution is usually to "turn everything off and on again" so that the old (incorrect) browser list is lost and a new (correct) one is created, or access your HTPC directly via an IP address based URL, e.g. \\192.168.1.2\

NB: in pre-RC6 setups the last two lines shown above (printcap name and load printers) were incorrectly placed under the [printers] section of the sample configuration file. If you move them to [global] as above you'll see some SAMBA startup errors in /var/log/messages go away.
Last Edit: 5 years 9 months ago by chewitt.
The administrator has disabled public write access.

Re: Having problems browsing SAMBA shares? ..README 6 years 1 month ago #2

  • rockdawg
  • rockdawg's Avatar
  • Offline
  • Junior Boarder
  • Posts: 68
  • Thank you received: 1
  • Karma: 2
OK. This has been driving me crazy. I figured out how to set one of my NAS as the Master Browser, but still nothing. Almost 48 hours later and the custom hostname still won't show in Windows. The "old" openelec name had disappeared. Again, no host name I set in the OS settings addon will appear in Windows. So I finally decide to inspect /var/log/messages and while it is mostly Greek to me, I noticed a couple lines that said something like, "couldn't find Master Browser in workgroup 'WORKGROUP'. My workgroup is not named WORKGROUP, it is MSHOME. So I went in to samba.conf and changed the workgroup name to MSHOME and rebooted. The messages file no longer says it can't find the Master Browser. I go into windows and low and behold there is the share, but it's showing as OPENELEC and not the CR-XBMC I have it set to in the OS settings addon. :angry: So again I go back to samba.conf and change the netbios name from openelec to CR-XBMC and reboot yet again. I go back into windows and FINALLY I see CR-XBMC! So is thesamab.conf file the proper place to set the name? If so, what the purpose of the host name setting in the addon?
The administrator has disabled public write access.

Re: Having problems browsing SAMBA shares? ..README 6 years 1 month ago #3

  • chewitt
  • chewitt's Avatar
By default OE uses /etc/smb.conf file to set things up, and this file is created at boot-time by scripts that extract workgroup and hostname from the settings.xml file created by the OE configuration add-on to store its data. If you create the /storage/.config/samba.conf configuration file it is detected at boot-time and is used to start SAMBA instead of the default settings in /etc/smb.conf, so you need to ensure the workgroup and hostname data it contains is correct, as once this file is active hostname changes made via the configuration addon no longer have any effect.

NB: The same kind of override logic and behaviour applies to any of the .conf files you create in /storage/.config
Last Edit: 5 years 9 months ago by chewitt.
The administrator has disabled public write access.

Re: Having problems browsing SAMBA shares? ..README 6 years 1 month ago #4

  • rockdawg
  • rockdawg's Avatar
  • Offline
  • Junior Boarder
  • Posts: 68
  • Thank you received: 1
  • Karma: 2
I see what you're saying. Maybe the addon should include the workgroup name so that users won't have to go outside the GUI to changes that?

Thanks for all your help. I appreciate it.
The administrator has disabled public write access.

Re: Having problems browsing SAMBA shares? ..README 6 years 1 month ago #5

  • chewitt
  • chewitt's Avatar
I'm not 100% sure whether its used by OE, but XBMC has a "workgroup" setting under it's network preferences.
The administrator has disabled public write access.

Re: Having problems browsing SAMBA shares? ..README 6 years 3 weeks ago #6

  • Ninjamawwe
  • Ninjamawwe's Avatar
How do I force a windows XP computer do always be the master? I have all my media+mysql+thumbnails on a winXP machine that is always on, and I would prefer for only that machine to be smb-master. Can this be achieved by "opting out" of beeing the master on the other clients (openelec and xbmc-live installed on the other machines at home). I.e. something like this:
domain master = no  <-- add this line
  local master = no  <-- add this line
  preferred master = no  <-- add this line

/ninjamawwe
The administrator has disabled public write access.

Re: Having problems browsing SAMBA shares? ..README 6 years 3 weeks ago #7

  • chewitt
  • chewitt's Avatar
You can not-force the OE box to be the master by removing lines from samba.conf, but to ensure the XP box becomes the workgroup/domain master things are potentially a lot more complex, particularly if you have other (newer) machines on the network (i.e. a Win7 laptop) as the election process considers OS version, SP levels and a few other factors, not just uptime. Generally the newer the OS, the more likely it will assume the master role. Have a read of THIS, it will probably help.
The administrator has disabled public write access.

Re: Having problems browsing SAMBA shares? ..README 6 years 3 weeks ago #8

  • Ninjamawwe
  • Ninjamawwe's Avatar
According to that link, it seem that is maybe not that complex to force one machine to be the master, provided that the other machines have settings that respect that (auto/no for isDomainMaster setting).
Thanks for the info, it has been bugging me for a while that sometimes samba bugs out when I boot my mediacenters, now I have a better understanding of why.
The administrator has disabled public write access.

Re: Having problems browsing SAMBA shares? ..README 5 years 3 months ago #9

  • Bossanova808
  • Bossanova808's Avatar
  • Offline
  • Expert Boarder
  • Posts: 362
  • Thank you received: 10
  • Karma: 7
Also worth reading this if you're having samba issues

Without this I couldn't see my shares, did the change and rebooted, wa la, there they were:
alan.lamielle.net/2009/09/03/windows-7-nonpaged-pool-srv-error-2017

..Win 7 is not really set up to be a server out of the box.
The administrator has disabled public write access.

Re: Having problems browsing SAMBA shares? ..README 5 years 3 months ago #10

  • protocol77
  • protocol77's Avatar
  • Offline
  • Senior Boarder
  • Posts: 111
  • Thank you received: 3
  • Karma: 0
i have finally found a solution or at least it is working for me so far

after giving up for a while and using windows xp as my server OS because it did not suffer this issue i came across an article for setting a windows pc to be the master browser and win the election almost if not everytime i have since installed windows home server 2011 and performed this so i cannot say for sure if it runs on windows 7 where it is used as the server OS so if someone tries it for a week or so and see if they get the issues are doing the things in the following guide if they could post back here and let everyone know how it went then we can finally have a proper resolution to this annoying problem

it is fairly easy to do just follow this (it does say for WHS 2011 but it should work on windows 7)

setting master browser guide
Last Edit: 5 years 3 months ago by protocol77.
The administrator has disabled public write access.

Re: Having problems browsing SAMBA shares? ..README 4 years 7 months ago #11

  • Kunga
  • Kunga's Avatar
  • Offline
  • Junior Boarder
  • Posts: 21
  • Karma: 0
how can you edit samba.conf.sample
The administrator has disabled public write access.

Re: Having problems browsing SAMBA shares? ..README 4 years 7 months ago #12

  • chewitt
  • chewitt's Avatar
Rename the file to samba.conf and use vi (or nano if you have the plugin installed):
mv /storage/.config/samba.conf.sample /storage/.config/samba.conf
vi /storage/.config/samba.conf
reboot to effect any changes.
The administrator has disabled public write access.

Re: Having problems browsing SAMBA shares? ..README 4 years 7 months ago #13

  • protocol77
  • protocol77's Avatar
  • Offline
  • Senior Boarder
  • Posts: 111
  • Thank you received: 3
  • Karma: 0
Kunga wrote:
how can you edit samba.conf.sample


what i did was download the samba.conf file to my windows desktop then went into my computer

then to tool then folder options then click on the view tab and uncheck the hide extentions for known file types

then i went to the file on the desktop and at the end of samba.conf i added .txt for text file

i then used a program called textpad and opened it up in that and then changed the options then after saving i removed the .txt from the end and then used filezilla to place it back in the .config folder
The administrator has disabled public write access.

Re: Having problems browsing SAMBA shares? ..README 4 years 7 months ago #14

  • chewitt
  • chewitt's Avatar
Download PuTTY and learn a few basics over SSH because it's far easier to edit the files in-situ (nano will be installed by default in the next beta/RC) than mess about with copying files around; particularly on windows systems where you have to be mindful of line-ending issues
The administrator has disabled public write access.

Having problems browsing SAMBA shares? ..README 4 years 7 months ago #15

  • CHBMB
  • CHBMB's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 19
  • Thank you received: 1
  • Karma: 0
Incidentally, I've got an UnRaid server set up as local master and was running into intermittent problems browsing my server shares. I found the solution was to edit samba.conf and put no to local master, domain master and preferred master. Unfortunately this was before I found this thread which would have helped greatly to isolate the problem!

Thanks for pointing it out though, will be a great help to many I expect.
The administrator has disabled public write access.
  • Page:
  • 1
  • 2