Newbie: how to setup network file shares (SMB)?

In case you need a platform-independent solution, try sshfs.

2 Likes

I’m actually not sure. I believe it was registering the user password in HaikĂș.
I also updated the system and restarted.
So it worked.

1 Like

Maybe Haiku support for newer SMB would be something suitable for a GSoC?

2 Likes

The gsoc page can be edited on github, you can submit a PR to add this idea if it isn’t there already

2 Likes

samba4 is already in the depot, I added an update to the work done by @extrowerk, had the recipe disabled at first but on an update at haikuports it was enabled, this hasn’t been tested enough though, and haiku_fusemb needs a rebuild against the newer samba to link to it.
Had it setup but didn’t get as far as actually mounting a share on the network (haven’t tried that hard too though :rofl: )

5 Likes
~> pkgman search samba
Status  Name           Description                                                     
---------------------------------------------------------------------------------------
S       samba          Library bits of the samba network filesystem                    
        samba_devel    Library bits of the samba network filesystem (development files)
        samba4         Library bits of the samba network filesystem                    
        samba4_devel   Library bits of the samba network filesystem (development files)
        samba4_source  Library bits of the samba network filesystem (source files)     
~> 

Seems it is 
 however as it created as a samba4 package 
 it conflicts with existing samba package and packages which requires the existing samba package

~> pkgman install samba4
  100% repochecksum-1 [65 bĂĄjt]
EllenƑrzƑkĂłd Ă©rvĂ©nyesĂ­tĂ©se a tĂĄrolĂłhoz (BeSly Software Solutions)...done.
  100% repochecksum-1 [65 bĂĄjt]
EllenƑrzƑkĂłd Ă©rvĂ©nyesĂ­tĂ©se a tĂĄrolĂłhoz (FatElk_64)...done.
  100% repochecksum-1 [65 bĂĄjt]
EllenƑrzƑkĂłd Ă©rvĂ©nyesĂ­tĂ©se a tĂĄrolĂłhoz (Haiku)...done.
  100% repochecksum-1 [64 bĂĄjt]
EllenƑrzƑkĂłd Ă©rvĂ©nyesĂ­tĂ©se a tĂĄrolĂłhoz (HaikuPorts)...done.
  100% repocache-2 [2,03 MiB]
EllenƑrzƑkĂłd Ă©rvĂ©nyesĂ­tĂ©se a tĂĄrolĂłhoz (HaikuPorts)...done.
  100% repochecksum-1 [65 bĂĄjt]
EllenƑrzƑkĂłd Ă©rvĂ©nyesĂ­tĂ©se a tĂĄrolĂłhoz (KapiX's Depot)...done.
  100% repochecksum-1 [71 bĂĄjt]
EllenƑrzƑkĂłd Ă©rvĂ©nyesĂ­tĂ©se a tĂĄrolĂłhoz (LOTE)...done.
Encountered problems:
problem 1: package samba4-4.20.2-1 conflicts with samba provided by samba-3.6.25-11
  solution 1:
    - allow deinstallation of samba-3.6.25-11
    - allow deinstallation of fusesmb_haiku-0.9-5
    - allow deinstallation of mplayer-1.5-1
    - allow deinstallation of kdenlive-23.08.5-1
    - allow deinstallation of kio_extras-23.08.5-2
  solution 2:
    - do not install "providing samba4"
Please select a solution, skip the problem for now or quit.
select [1...2/s/q]: 2
Nothing to do.
~> 

The existing samba package should be upgraded with new version - that would be a better option after tests.

~> pkgman search samba -D
Repository  Name           Version    Arch  
--------------------------------------------
<system>    samba          3.6.25-11  x86_64
HaikuPorts  samba          3.6.25-11  x86_64
HaikuPorts  samba_devel    3.6.25-11  x86_64
HaikuPorts  samba4         4.20.2-1   x86_64
HaikuPorts  samba4_devel   4.20.2-1   x86_64
HaikuPorts  samba4_source  4.20.2-1   source
~>
2 Likes

You can’t have both versions installed at the same time, hence the conflict. :slight_smile:
And indeed, this newer version hasn’t been tested and won’t be the default without thorough testing.

2 Likes

How can we help testing? Any certain procedures?

Haven’t touched it in a while, only thing I checked back then was looking if the binaries in the package didn’t fail to execute. For one fusesmb_haiku needs a rebuild with samba4 if you intend to check it out.
On the procedure, I guess it would/should do the trick as it is done with current samba?

2 Likes

Hello DigitalBox, I try to connect my NAS via SAMBA but I do not know how to use the command:
mount_nfs server:export mountpoint uid gid

could you pleas guide me how the cli has to look like


Thanks for looking into it


Maybe there is a tutorial on your website, I am going to visit later


Well, as said above Haiku SMB client is quite limited to only v1, which is unsecure and more and more unsupported/rejected by NAS SAMBA servers.
While there is a more recent SAMBA available for Haiku, it’s not yet fully tested and needs to use userland fuse to do it.

So may I suggest that you instead try to use NFS protocol instead to access your NAS share(s) ? Most NAS support to shares over SMB/SAMBA and NFS at the same time.

The mount_nfs command won’t works with SAMBA but via NFS.
The expected syntax is the following:

mount_nfs hostname_or_ip_address_of_your_nas:/exported_folder /path/to/local/folder 0 0

Where:

  • hostname_or_ip_address_of_your_nas is the name (or IP address if it has no DNS name, like for a local home or SOHO NAS server sharing files) or your NAS.

  • /exported_folder is the NFS export “path” of your shared folder. Check you NAS NFS configuration panel to retrieve it. Usually it’s something like /nas_volume_something/some/path/to/a_folder_shared_over_NFS or more simplier just /exported_folder_name, depends on how the NAS does to expose shared folder(s) over NFS.

  • /path/to/local/folder is a path to a folder on your Haiku system, For instance, /boot/home/nfs You must create the folder first (via Tracker of via a mkdir -p /boot/home/nfscommand

  • the two trailing zeroes are for mapping the user ID and group ID into local Haiku valid value. As Haiku currently have a root user, it’s mapping to its user ID and group ID, zero in both case.

The mount_nfs command use the old NFSv2 client in Haiku, which is stable but quite slow, and will obviously works only if you NAS has NFS v2 enabled.

But you can also switch to more recent NFSv4 client available in Haiku, but as mount_nfs is harcoded to use old NVSv2 client, you have to use the more generic mount command in such case:

mount -t nf4 -p hostname_or_ip_address_of_your_nas:/exported_folder /path/to/local/folder

Or course, check your NAS has enabled NFSv4 support, not just v2 and v3.

Last but not least, you can use some GUI tools to make it easier.
Like this one for instance:

In any case, whatever the way you will use, if it doesn’t works, you needs to look for more detailed messages from kernel by checking /var/log/syslog, or even better watching it live via a tail -f /var/log/syslog command from another terminal), and share here there details. Sometimes it’s the export name which is not the correct one, sometimes it’s the server rejecting the client connection for some reason like version not supported, credentials, whatever.

Which kind of NAS do you use?

2 Likes