Я встановив VirtualBox на хості macOS Sierra та macOS Sierra, CentOS 7 та Windows 10 як гості, щоб протестувати Samba tarball.
Я не використовую власний метод обміну SMB в macOS Sierra (і для хоста, і для гостя) "Налаштування системи -> Спільний доступ". Для хоста macOS Sierra я ввімкнув Спільний доступ з AFP.
Метод установки Samba для macOS (хост і гість) був:
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
Конфігурація для 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
Конфігурація для 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
Конфігурація для CentOS 7 Guest (Установка 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
Проблема полягає в наступному:
macOS Sierra Host та macOS Sierra Guest не показують пристрої в моїй локальній мережі, включаючи сервери Samba.
Тестування Windows 10 Guest та CentOS 7 Guest Я можу без проблем бачити інші пристрої, як-от:
macOS Sierra Host (MacBook-Air)
macOS Sierra Guest (Vxbox-Mac)
Windows 10 Guest (Vxbox-Win)
CentOS 7 Guest(Vxbox-Lnx)
Тут знімок екрана:
Я хочу зрозуміти, як я можу отримати відкриття сервера Samba у своїй локальній мережі, що працює в Сьєррі?
Чи є якийсь метод змусити оновити мережу в Finder?
Додаток: Для складання Samba 4.5.5 належним чином відредагуйте два файли:
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!