SAMBA - Unable to see share from openSUSE

Hi, I’m running openSUSE Tumbleweed (KDE) with a Windows 7 VM running in VirtualBox.

I configured the samba server and I’m able to see and read shared folders from my Windows VM.

From openSUSE I’m able to see the workgroup and the windows machine but at the time I access it from Dolphin Samba seems to crash, I see the smb.so process to ocupy all the CPU.

I experiencied a similar issue with Leap but I didn’t tried much yet.

The services I started were smb, nmb and winbind.

I configured the samba server from Yast. This is my smb.conf file:

# smb.conf is the main Samba configuration file. You find a full commented
# version at /usr/share/doc/packages/samba/examples/smb.conf.SUSE if the
# samba-doc package is installed.
[global]
        workgroup = WORKGROUP
        passdb backend = tdbsam
        printing = cups
        printcap name = cups
        printcap cache time = 750
        cups options = raw
        map to guest = Bad User
        include = /etc/samba/dhcp.conf
        logon path = \\%L\profiles\.msprofile
        logon home = \\%L\%U\.9xprofile
        logon drive = P:
        usershare allow guests = No
        security = domain
        add machine script = /usr/sbin/useradd  -c Machine -d /var/lib/nobody -s /bin/false %m$
        domain logons = Yes
        domain master = Yes
        local master = Yes
        os level = 65
        preferred master = Yes
        wins support = Yes
        netbios name = SUSELAPTOP

[homes]
        comment = Home Directories
        valid users = %S, %D%w%S
        browseable = No
        read only = No
        inherit acls = Yes
        guest ok = Yes
[profiles]
        comment = Network Profiles Service
        path = %H
        read only = No
        store dos attributes = Yes
        create mask = 0600
        directory mask = 0700
[users]
        comment = All users
        path = /home
        read only = No
        inherit acls = Yes
        veto files = /aquota.user/groups/shares/
[groups]
        comment = All groups
        path = /home/groups
        read only = No
        inherit acls = Yes
[printers]
        comment = All Printers
        path = /var/tmp
        printable = Yes
        create mask = 0600
        browseable = No
[print$]
        comment = Printer Drivers
        path = /var/lib/samba/drivers
        write list = @ntadmin root
        force group = ntadmin
        create mask = 0664
        directory mask = 0775

[netlogon]
        comment = Network Logon Service
        path = /var/lib/samba/netlogon
        write list = root

[Public]
        comment = Public Folder
        inherit acls = Yes
        path = /home/ignacio/Public
        read only = Yes

You mentioned you can see the “workgroup” but you have configured openSUSE as a full-on windows-style server.

Did you intend for your 2-computer network to be a full-on windows-style server, or will a workgroup do (like for a home or small business)?

Sorry for the late response.
I thought that, for openSUSE/Linux to be able to share files trough samba I needed to setup a SAMBA server, is this not necessary for a home-like network?

Server in Linux means (more or less): the server is a computer that makes resources available to someone else (aka the client). For example if computer X shares files to computer Y, then Y is the client in that transaction and X is the server. But if in addition X can receive files from Y, then in that transaction X is the client and Y the server. When that equal-status sort of sharing happens (because it’s configured to share both ways) it’s called a workgroup.

It seemed to me that you are more in a workgroup situation. For that the [global] stanza should look like this:

[global]
        workgroup = WORKGROUP
        server string = ""
        passdb backend = tdbsam
        name resolve order = bcast host lmhosts wins
        printing = cups
        printcap name = cups
        printcap cache time = 750
        cups options = raw
        map to guest = Bad User
        usershare allow guests = No
        local master = Yes
        os level = 65
        preferred master = Yes
        netbios name = SUSELAPTOP

These next four should be deleted as not relating to your needs and setup:

[profiles]
        comment = Network Profiles Service
        path = %H
        read only = No
        store dos attributes = Yes
        create mask = 0600
        directory mask = 0700
[users]
        comment = All users
        path = /home
        read only = No
        inherit acls = Yes
        veto files = /aquota.user/groups/shares/
[groups]
        comment = All groups
        path = /home/groups
        read only = No
        inherit acls = Yes

[netlogon]
        comment = Network Logon Service
        path = /var/lib/samba/netlogon
        write list = root

If all that you’re sharing is the folder Public then this one stays as important (although I would structure it differently, but see if it suits you)

[Public]
        comment = Public Folder
        inherit acls = Yes
        path = /home/ignacio/Public
        read only = Yes

And if you’re not trying to share the entirety of all the files in the tree based on /home/ignatio then this should be deleted too:

[homes]
        comment = Home Directories
        valid users = %S, %D%w%S
        browseable = No
        read only = No
        inherit acls = Yes
        guest ok = Yes

\

And also you need to make sure that in the firewall there is provision for passing (a) Samba and (b) name resolution.
And check that you have the daemons for samba and naming turned on.

If you don’t know whether the stuff in the last 2 lines is OK/done, ask again. But edit the samba file first as per the above suggestions (or not as you wish).

To edit that file run this command in a console:

kdesu kwrite /etc/samba/smb.conf

that’s for KDE desktop, but if u have Gnome use this:

gnomesu gedit /etc/samba/smb.conf

I should add the final touches for other ppl who might come along here, and want to config Samba.

Check the nmb and smb daemons like this: Yast ==> System ==> Services manager ==> locate nmb and ensure that it is “enabled” and "active’. Similarly locate smb and ensure that it is “enabled” and "active’.

Check/intall the ports for Samba in Yast like so:
Yast ==> firewall ==> interfaces ==>: set the network sevice to External
Yast ==> firewall ==> Allowed services. install these services: Samba Server, Samba Client, Netbios server

Server in Linux means (more or less): the server is a computer that makes resources available to someone else (aka the client). For example if computer X shares files to computer Y, then Y is the client in that transaction and X is the server. But if in addition X can receive files from Y, then in that transaction X is the client and Y the server. When that equal-status sort of sharing happens (because it’s configured to share both ways) it’s called a workgroup.

Thanks a lot for the explanation swerdna, I know how the client-server relationship works (not meant to be disrespectful).
I configured the server and client from openSUSE because I wanted to try the sharing in both ways.

I know I can edit the config file /etc/samba/smb.conf but I wanted to know if the file generated after configuring it through Yast is correct or not.
Beside the shares: [profiles], [users], [groups], [netlogon] and [homes] (I will disable them know) my [global] section seems to be roughly the same as yours (except for some extra lines), but it have the same values in the same options.

The thing is that I could read my “Public” folder form Windows just fine, but when I try to do the same from openSUSE (Dolphin), the smb process seems to hang (100% CPU use).

To make things clearer I will explain you the steps I performed:

  • First of all I’m using wicked to manage the network (I read somewhere that NetworkManager wouldn’t work)
  • In openSUSE I went to Yast->Firewall and selected External Zone for my network interface and also allowed the services: Netbios server, Samba server and Samba client
  • Then, went to Yast->Samba server, in “Shares” I disabled all the shares and added my /home/ignacio/Public one.
    In “Identity” I set netbios=SUSELAPTOP workgroup=WORKGROUP domain controller=Primary (PDC) remote wins server=enabled and retrieve wins server via DHCP enabled too. After that I pressed OK and set my Samba root password.
  • Finally I started and enabled the smb and nmb services.

After this I can see the Public folder in my Win7 virtualbox VM just fine (I putted some files there in order to test it).

Now, I need to know what extra steps I need to know in order to share files from Windows to openSUSE successfully.
Should I do this from the “Windows Domain Membership” Yast menu? or there is some other file I need to edit for the samba client?
(/etc/samba/smb.conf seems to be only for the server I’m I right?)

Thanks a lot!

I think I found the problem:

journalctl -u smb
...]
connect_to_domain_password_server: unable to open the domain client session to machine SUSEDESKTOP. Error was : NT_STATUS_CANT_ACCESS_DOMAIN_INFO
...]

Even running smbtree crashes.

Is there any WINS-Server available in the network you are connecting to?

If not then this might explain the error message “connect_to_domain_password_server: unable to open the domain client session to machine SUSEDESKTOP. Error was : NT_STATUS_CANT_ACCESS_DOMAIN_INFO

Best regards

susejunky

OK junky, I will try disable WINS and see what happens.

Also is it OK to use security = user as per default?
I’m still learning about SAMBA, I still don’t fully understand how it works, but I’ll keep reading :wink:

For know I just wanted to configure a simple network between a Windows and a Linux computer, I know that for Linux-Linux sharing I can use sftp or NFS.

name resolve order = bcast host lmhosts wins

Under [global] did the job, now I can see Windows shares from my openSUSE machine, but I have no idea why. Could someone explain?

This line defines the order in which SAMBA tries to find the machine you want to connect to. bcast (network broadcast) or looking in your local lmhosts file probably did the job.

Here some documentation which might help:

http://www.oreilly.com/openbook/samba/book/ch07_03.html
https://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html

Best regards

susejunky

OK, thanks for the information junky, thank you swerdna too, really appreciated.

Too bad this settings are not part of the defaults, I’ll look for a related issue on bugzilla if not I’ll report it.

Regards.

Now that’s a fine idea (putting sensible defaults into the config file). This options could be encapsulated in Yast.

Just a passing thought.

In fact I suppose I could write a script that simply backs up the default and inserts a workgroup-oriented samba.conf file in its place.