1

I installed VirtualBox on a macOS Sierra host, and macOS Sierra, CentOS 7 and Windows 10 as guests to test a Samba tarball.

I'm not using native SMB sharing method of macOS Sierra (both: host and guest) "System Preferences -> Sharing". For the macOS Sierra host I enabled Sharing with AFP.

The Samba installation method for macOS (Host and Guest) was:

tar zxvf samba-4.5.5.tar.gz  -C /usr/local/Source_Codes/
cd /usr/local/Source_Codes/samba-4.5.5/
./configure --prefix=/usr/local/Custom/samba           \
    --sysconfdir=/usr/local/Custom/samba/etc           \
    --localstatedir=/usr/local/Custom/samba/var           \
    --with-cachedir=/usr/local/Custom/samba/var/cache           \
    --libdir=/usr/local/Custom/samba/var/lib           \
    --with-lockdir=/usr/local/Custom/samba/var/lock           \
    --with-logfilebase=/usr/local/Custom/samba/var/log           \
    --with-piddir=/usr/local/Custom/samba/var/run           \
    --enable-fhs --without-ad-dc  --without-systemd  --without-acl-support
make
sudo make install

The configuration for macOS Sierra Host:

[global]
    log level = 4
    workgroup = BZ
    server string = Samba Server Version %v
    netbios name = MacBook-Air

    wins support = yes
    local master = yes
    preferred master = yes

    log file = /usr/local/Custom/samba/var/log/log.%m
    max log size = 1000

    security = user
    passdb backend = tdbsam


[joseluisbz_Air]
    path = /Users/joseluisbz
    valid users = joseluisbz
    browsable =yes
    writable = yes
    guest ok = yes
    read only = No  

[root_Air]
    path = /
    admin users = joseluisbz
    browsable =yes
    writable = yes
    guest ok = yes
    read only = No

The configuration for macOS Sierra Guest:

[global]
    log level = 4
    workgroup = BZ
    server string = Samba Server Version %v
    netbios name = Vxbox-Mac

    wins support = yes
    local master = yes
    preferred master = yes

    log file = /usr/local/Custom/samba/var/log/log.%m
    max log size = 1000

    security = user
    passdb backend = tdbsam


[joseluisbz_Mac]
    path = /Users/joseluisbz
    valid users = joseluisbz
    browsable =yes
    writable = yes
    guest ok = yes
    read only = No  

[root_Mac]
    path = /
    admin users = joseluisbz
    browsable =yes
    writable = yes
    guest ok = yes
    read only = No

The configuration for CentOS 7 Guest (Installation of Linux):

[global]
    log level = 4
    workgroup = BZ
    server string = Samba Server Version %v
    netbios name = Vxbox-Lnx

    log file = /var/log/samba/log.%m.log
    max log size = 50

    security = user
    passdb backend = tdbsam

[joseluisbz_Lnx]
    path = /home/joseluisbz
    valid users = joseluisbz
    browsable =yes
    writable = yes
    guest ok = yes
    read only = No

[root_Lnx]
    path = /
    admin users = joseluisbz
    browsable =yes
    writable = yes
    guest ok = yes
    read only = No

[printers]
    comment = All Printers
    path = /var/spool/samba
    browseable = no
    guest ok = no
    writable = no
    printable = yes

enter image description here

The problem is:

macOS Sierra Host and macOS Sierra Guest don't show the devices on my LAN, including the Samba servers.

Testing the Windows 10 Guest and CentOS 7 Guest I can see the other devices without problem, like:

macOS Sierra Host (MacBook-Air)
macOS Sierra Guest (Vxbox-Mac)
Windows 10 Guest (Vxbox-Win)
CentOS 7 Guest(Vxbox-Lnx)

Here Screenshot:

enter image description here

I want to figure out, how can I get Samba server discovery in my LAN working in Sierra?

Is there some method to force refresh Network on Finder?


Addendum: To compile Samba 4.5.5 properly edit two files:

ERROR: 
        In file included from ../lib/param/loadparm.h:259:
        default/lib/param/param_local.h:141:1: error: field has incomplete type 'struct timespec'
        LOADPARM_EXTRA_LOCALS
        ^
SOL: This problem can be fixed by adding #include <time.h> to lib/param/loadparm.h
        # /Applications/kate.app/Contents/MacOS/kate /usr/local/Source_Codes/samba-4.5.5/lib/param/loadparm.h
        # pico /usr/local/Source_Codes/samba-4.5.5/lib/param/loadparm.h



ERROR: 
        [3343/3364] Linking default/source4/torture/smbtorture
        clang: warning: argument unused during compilation: '-pie'
        Undefined symbols for architecture x86_64:
        "_getgrent_r", referenced from:
            _test_enum_r_group in nss_tests_1.o
        "_getpwent_r", referenced from:
            _test_enum_r_passwd in nss_tests_1.o
        ld: symbol(s) not found for architecture x86_64
        clang: error: linker command failed with exit code 1 (use -v to see invocation)
SOL: This problem can be fixed editing the file source4/torture/local/nss_tests.c
    $ sudo /Applications/Sublime\ Text.app/Contents/MacOS/Sublime\ Text /usr/local/Source_Codes/samba-4.5.5/source4/torture/local/nss_tests.c
    # pico /usr/local/Source_Codes/samba-4.5.5/source4/torture/local/nss_tests.c

    1.a) Original Snippet:  
        static bool test_enum_r_passwd(struct torture_context *tctx,
                        struct passwd **pwd_array_p,
                        size_t *num_pwd_p)
        {
            struct passwd pwd, *pwdp;
            struct passwd *pwd_array = NULL;
            size_t num_pwd = 0;
            char buffer[4096];
    1.a) Edited Snippet:
        static bool test_enum_r_passwd(struct torture_context *tctx,
                        struct passwd **pwd_array_p,
                        size_t *num_pwd_p)
        {
        #ifdef HAVE_GETPWENT_R
            struct passwd pwd, *pwdp;
            struct passwd *pwd_array = NULL;
            size_t num_pwd = 0;
            char buffer[4096];
    1.b) Original Snippet (in the same funcion):
            if (num_pwd_p) {
                *num_pwd_p = num_pwd;
            }

            return true;
        }

        static bool torture_assert_passwd_equal(struct torture_context *tctx,
    1.b) Edited Snippet:
            if (num_pwd_p) {
                *num_pwd_p = num_pwd;
            }

        #endif /* HAVE_GETPWENT_R */
            return true;
        }

        static bool torture_assert_passwd_equal(struct torture_context *tctx,
    2.a) Original Snippet:
        static bool test_enum_r_group(struct torture_context *tctx,
                        struct group **grp_array_p,
                        size_t *num_grp_p)
        {
            struct group grp, *grpp;
            struct group *grp_array = NULL;
            size_t num_grp = 0;
            char buffer[4096];
    2.a) Edited Snippet:
        static bool test_enum_r_group(struct torture_context *tctx,
                        struct group **grp_array_p,
                        size_t *num_grp_p)
        {
        #ifdef HAVE_GETGRENT_R
            struct group grp, *grpp;
            struct group *grp_array = NULL;
            size_t num_grp = 0;
            char buffer[4096];
    2.b) Original Snippet (in the same funcion):
            if (num_grp_p) {
                *num_grp_p = num_grp;
            }

            return true;
        }

        static bool torture_assert_group_equal(struct torture_context *tctx,
    2.b) Edited Snippet:
            if (num_grp_p) {
                *num_grp_p = num_grp;
            }

        #endif /* HAVE_GETGRENT_R */
            return true;
        }

        static bool torture_assert_group_equal(struct torture_context *tctx,
End Solution!
  • Yes I fixed the needed files previosly. – Chepe Questn Feb 21 '17 at 0:23
  • I want to public all procedure... Check it! – Chepe Questn Feb 21 '17 at 0:24

You must log in to answer this question.

Browse other questions tagged .