[Solved] Samba Haiku shares

Hi, I’m new to Haiku and trying to replicate my usual “linux” workflow which consists on ssh remote and samba shares access to a virtual machine

I’ve got no problem booting Haiku on VirtualBox, and enable sshd but I struggle a lot with samba

I’ve managed to get samba up and running, I can browse the shares from my MacOS computer but after a while (a matter of minutes) my ssh sessions freeze and Haiku UI become unstable, the desktop is erased in blue and moving the mouse repaints the icons and launch tools.

I’ve not found a solution to launch nmbd and smbd as services so I launch them from the command line as daemons.

I suspect a problem in the samba haiku port itself but would like to know if some of you have found a way to get samba running and being stable…

What network card do you use in VirtualBox? PCnet is known to cause problems on Haiku, try switching to Intel Pro/1000.

Right, samba port hasn’t been updated to use Haiku’s launch_daemon yet.
It should provide /system/data/user_launch/samba launch file.

Here are some examples on how to do that in the .recipe.
https://github.com/haikuports/haikuports/search?q=user_launch

1 Like

Thanks ! Changing the network card did the job. I left Haiku running for 2 hours, while browsing the samba share from time to time, and everything is fine !

2 Likes

Lucky you! I have never seen samba working yet :wink:

And now samba even runs at boot time ! I’m blessed :slight_smile:

[as I’m lazy, I only used /boot/home/config/settings/boot/UserBootscript]

Is there a guide to help setting up a samba server on haiku?

It’s pretty straighforward,

  • use pkgman to install the samba package
  • edit /system/settings/samba/smb.conf

[global]
workgroup = SAMBA
security = user
debug level = 5
guest account = user
allow insecure wide links = yes
unix extensions = no

[haiku]
path = /
public = yes
read only = no
follow symlinks = yes
wide links = yes

Then from the command line
smbpasswd -a user
type your password twice

Then add these two lines to /boot/home/config/settings/boot/UserBootscript
/bin/nmbd --daemon
/bin/smbd --daemon

Restart haiku

The server will appear as “shredder”

Note : I don’t have my Haiku VM machine running, it’s from memory, check the docs

4 Likes

That doesn’t seem to work, and there are no docs included with the samba package. :frowning:

The full doc is here
https://www.samba.org/samba/docs/man/

You might have troubles if you’re browsing from Windows. Windows access to samba shares have always been a PITA for me. MacOS is really forgiving for that matter, I never had a single problem browsing any kind of quick&dirty samba setups

1 Like

It doesn’t work from Windows, but now I can share filed between 32bit and 64bit Haiku installs!

1 Like

This now works for me - many thanks. I installed fuseSMB from HaikoDepot and made the alterations to the config file as per instructions but I found that the nmbd was not running. If I started it manually then the HAIKU-D630 machine (this one) would show in Windows 7 and was fully accessible. I then added the /bin/nmbd line after the /bin/smbd in the UserBootscript file and it now works on boot up.

I don’t know where the Windows machine is supposed to show up in Haiku but it does not really matter that much to me as at least I can transfer files from Windows to Haiku even though I do it from the Windows machine.

The cgimenez instructions could either be incorporated into the FuseSMD instalation or made readily available.

Thanks for the help - invaluable.

So far it works on Windows 7 but not on Windows 10. Will leave it for the moment and do other things with my life but this is good result for me.

SMBv1 is disabled in default on W10, and on Haiku we have no support for more recent SMB versions (yet).

2 Likes

With the work started out by @extrowerk I got a bit further at packaging latest release (atm 4.20.2).
Still not sure if it’s working at all, but yesterday I got errors when trying to add a user, today I got some progress. :slight_smile:

~> smbpasswd -a user
INFO: Current debug levels:
  all: 5
  tdb: 5
  printdrivers: 5
  lanman: 5
  smb: 5
  rpc_parse: 5
  rpc_srv: 5
  rpc_cli: 5
  passdb: 5
  sam: 5
  auth: 5
  winbind: 5
  vfs: 5
  idmap: 5
  quota: 5
  acls: 5
  locking: 5
  msdfs: 5
  dmapi: 5
  registry: 5
  scavenger: 5
  dns: 5
  ldb: 5
  tevent: 5
  auth_audit: 5
  auth_json_audit: 5
  kerberos: 5
  drs_repl: 5
  smb2: 5
  smb2_credits: 5
  dsdb_audit: 5
  dsdb_json_audit: 5
  dsdb_password_audit: 5
  dsdb_password_json_audit: 5
  dsdb_transaction_audit: 5
  dsdb_transaction_json_audit: 5
  dsdb_group_audit: 5
  dsdb_group_json_audit: 5
doing parameter guest account = user
doing parameter allow insecure wide links = yes
doing parameter unix extensions = no
pm_process() returned Yes
Attempting to find a passdb backend to match tdbsam (tdbsam)
No builtin backend found, trying to load plugin
load_module_absolute_path: Probing module '/packages/samba4-4.20.2-1/.self/lib/samba/pdb/tdbsam.so'
load_module_absolute_path: Module '/packages/samba4-4.20.2-1/.self/lib/samba/pdb/tdbsam.so' loaded
Attempting to register passdb backend tdbsam
Successfully added passdb backend 'tdbsam'
Found pdb backend tdbsam
pdb backend tdbsam has a valid init
New SMB password:
Retype new SMB password:
tdbsam_open: Converting version 0.0 database to version 4.0.
tdbsam_convert_backup: updated /packages/samba4-4.20.2-1/.self/settings/samba/passdb.tdb file.
tdb(/var/winbindd_idmap.tdb): tdb_open_ex: could not open file /var/winbindd_idmap.tdb: No such file or directory
dbwrap_lock_order_lock: check lock order 1 for /packages/samba4-4.20.2-1/.self/settings/samba/passdb.tdb
dbwrap_lock_order_unlock: release lock order 1 for /packages/samba4-4.20.2-1/.self/settings/samba/passdb.tdb
dbwrap_lock_order_lock: check lock order 1 for /packages/samba4-4.20.2-1/.self/settings/samba/passdb.tdb
dbwrap_lock_order_unlock: release lock order 1 for /packages/samba4-4.20.2-1/.self/settings/samba/passdb.tdb
dbwrap_lock_order_lock: check lock order 1 for /packages/samba4-4.20.2-1/.self/settings/samba/passdb.tdb
dbwrap_lock_order_unlock: release lock order 1 for /packages/samba4-4.20.2-1/.self/settings/samba/passdb.tdb
TDBSAM converted successfully.
tdbsam_open: successfully opened /packages/samba4-4.20.2-1/.self/settings/samba/passdb.tdb
pdb_getsampwnam (TDB): error fetching database.
 Key: USER_user
Finding user user
Trying _Get_Pwnam(), username as lowercase is user
Get_Pwnam_internals did find user [user]!
Opening cache file at /var/samba/lock/gencache.tdb
Forcing Primary Group to 'Domain Users' for user
tdb(/var/account_policy.tdb): tdb_open_ex: could not open file /var/account_policy.tdb: No such file or directory
Could not open tdb: No such file or directory
dbwrap_lock_order_lock: check lock order 1 for /var/account_policy.tdb
dbwrap_lock_order_unlock: release lock order 1 for /var/account_policy.tdb
account_policy_get: tdb_fetch_uint32_t failed for type 1 (min password length), returning 0
tdb(/var/account_policy.tdb): tdb_transaction_start: nesting 1
dbwrap_lock_order_lock: check lock order 1 for /var/account_policy.tdb
dbwrap_lock_order_unlock: release lock order 1 for /var/account_policy.tdb
account_policy_get: tdb_fetch_uint32_t failed for type 2 (password history), returning 0
tdb(/var/account_policy.tdb): tdb_transaction_start: nesting 1
dbwrap_lock_order_lock: check lock order 1 for /var/account_policy.tdb
dbwrap_lock_order_unlock: release lock order 1 for /var/account_policy.tdb
account_policy_get: tdb_fetch_uint32_t failed for type 3 (user must logon to change password), returning 0
tdb(/var/account_policy.tdb): tdb_transaction_start: nesting 1
dbwrap_lock_order_lock: check lock order 1 for /var/account_policy.tdb
dbwrap_lock_order_unlock: release lock order 1 for /var/account_policy.tdb
account_policy_get: tdb_fetch_uint32_t failed for type 4 (maximum password age), returning 0
tdb(/var/account_policy.tdb): tdb_transaction_start: nesting 1
dbwrap_lock_order_lock: check lock order 1 for /var/account_policy.tdb
dbwrap_lock_order_unlock: release lock order 1 for /var/account_policy.tdb
account_policy_get: tdb_fetch_uint32_t failed for type 5 (minimum password age), returning 0
tdb(/var/account_policy.tdb): tdb_transaction_start: nesting 1
dbwrap_lock_order_lock: check lock order 1 for /var/account_policy.tdb
dbwrap_lock_order_unlock: release lock order 1 for /var/account_policy.tdb
account_policy_get: tdb_fetch_uint32_t failed for type 6 (lockout duration), returning 0
tdb(/var/account_policy.tdb): tdb_transaction_start: nesting 1
dbwrap_lock_order_lock: check lock order 1 for /var/account_policy.tdb
dbwrap_lock_order_unlock: release lock order 1 for /var/account_policy.tdb
account_policy_get: tdb_fetch_uint32_t failed for type 7 (reset count minutes), returning 0
tdb(/var/account_policy.tdb): tdb_transaction_start: nesting 1
dbwrap_lock_order_lock: check lock order 1 for /var/account_policy.tdb
dbwrap_lock_order_unlock: release lock order 1 for /var/account_policy.tdb
account_policy_get: tdb_fetch_uint32_t failed for type 8 (bad lockout attempt), returning 0
tdb(/var/account_policy.tdb): tdb_transaction_start: nesting 1
dbwrap_lock_order_lock: check lock order 1 for /var/account_policy.tdb
dbwrap_lock_order_unlock: release lock order 1 for /var/account_policy.tdb
account_policy_get: tdb_fetch_uint32_t failed for type 9 (disconnect time), returning 0
tdb(/var/account_policy.tdb): tdb_transaction_start: nesting 1
dbwrap_lock_order_lock: check lock order 1 for /var/account_policy.tdb
dbwrap_lock_order_unlock: release lock order 1 for /var/account_policy.tdb
account_policy_get: tdb_fetch_uint32_t failed for type 10 (refuse machine password change), returning 0
tdb(/var/account_policy.tdb): tdb_transaction_start: nesting 1
dbwrap_lock_order_lock: check lock order 1 for /var/account_policy.tdb
dbwrap_lock_order_unlock: release lock order 1 for /var/account_policy.tdb
get_privileges: No privileges assigned to SID [S-1-1-0]
dbwrap_lock_order_lock: check lock order 1 for /var/account_policy.tdb
dbwrap_lock_order_unlock: release lock order 1 for /var/account_policy.tdb
get_privileges: No privileges assigned to SID [S-1-5-32-548]
dbwrap_lock_order_lock: check lock order 1 for /var/account_policy.tdb
dbwrap_lock_order_unlock: release lock order 1 for /var/account_policy.tdb
get_privileges: No privileges assigned to SID [S-1-5-32-549]
dbwrap_lock_order_lock: check lock order 1 for /var/account_policy.tdb
dbwrap_lock_order_unlock: release lock order 1 for /var/account_policy.tdb
get_privileges: No privileges assigned to SID [S-1-5-32-550]
dbwrap_lock_order_lock: check lock order 1 for /var/account_policy.tdb
dbwrap_lock_order_unlock: release lock order 1 for /var/account_policy.tdb
get_privileges: No privileges assigned to SID [S-1-5-32-551]
dbwrap_lock_order_lock: check lock order 1 for /var/account_policy.tdb
dbwrap_lock_order_unlock: release lock order 1 for /var/account_policy.tdb
get_privileges: No privileges assigned to SID [S-1-5-32-544]
dbwrap_lock_order_lock: check lock order 1 for /var/account_policy.tdb
dbwrap_lock_order_unlock: release lock order 1 for /var/account_policy.tdb
Storing (new) account user with RID 501
dbwrap_lock_order_lock: check lock order 1 for /packages/samba4-4.20.2-1/.self/settings/samba/passdb.tdb
dbwrap_lock_order_unlock: release lock order 1 for /packages/samba4-4.20.2-1/.self/settings/samba/passdb.tdb
dbwrap_lock_order_lock: check lock order 1 for /packages/samba4-4.20.2-1/.self/settings/samba/passdb.tdb
dbwrap_lock_order_unlock: release lock order 1 for /packages/samba4-4.20.2-1/.self/settings/samba/passdb.tdb
Finding user user
Trying _Get_Pwnam(), username as lowercase is user
Get_Pwnam_internals did find user [user]!
Forcing Primary Group to 'Domain Users' for user
Storing account user with RID 501
dbwrap_lock_order_lock: check lock order 1 for /packages/samba4-4.20.2-1/.self/settings/samba/passdb.tdb
dbwrap_lock_order_unlock: release lock order 1 for /packages/samba4-4.20.2-1/.self/settings/samba/passdb.tdb
dbwrap_lock_order_lock: check lock order 1 for /packages/samba4-4.20.2-1/.self/settings/samba/passdb.tdb
dbwrap_lock_order_unlock: release lock order 1 for /packages/samba4-4.20.2-1/.self/settings/samba/passdb.tdb
Added user user.
Freeing parametrics:
7 Likes