× NETGEAR will be terminating ReadyCLOUD service by July 1st, 2023. For more details click here.
Orbi WiFi 7 RBE973
Reply

Re: Samba 3.6.25 build for ReadyNAS NV+ v2

sshambar2
Star

Samba 3.6.25 build for ReadyNAS NV+ v2

My brother was having difficulties connecting to his ReadyNAS from his work laptop running Win10, and asked if I could enable SMB2 on his NAS (he couldn't install SMB1 compatibility as the laptop is locked down).  I was able to enable it by adding a file at /etc/frontview/samba/addons/addons.conf on the NAS containing:

[global]
max protocol = SMB2

However, he still was having connection issues, probably because the latest ReadyNAS only has Samba 3.5 where SMB2 is marked "experimental".

 

So I loaded up a virtual machine, and set about compiling a newer Samba release.  The project involved a little more than I expected, but I finally installed all the dependencies on the VM and built Samba 3.6.25. I considered Samba 4, but I wanted to keep compatibility with his Frontview config, and Samba 4 requires a newish Python to compile...(might try that later).

 

Since I went through all the effort, I figured the community might find the results useful.  For anyone who's interested, I've placed the build (and the scripts I wrote to compile all the dependencies and the Samba release) on github at:

 

https://github.com/sshambar/readynas-arm

 

The Samba-3.6.25 tarball is on the releases page, and instructions for installing are in the samba-3.6.25/README.  I compiled with the same settings as the original Samba 3.5 except that the binaries are installed in /usr/local (so as not to disturb the current Samba install) -- but it will use the same config files and state as the original install.

 

To get it working, just untar into /usr/local, and then symlink smbd and nmbd to /usr/sbin in place of the originals (see the README).

 

The github project includes the script I wrote to build all the dependencies using the Netgear SDK (in case you want to build it yourself), including all the "fixes" I had to use to get the original GPL software packages to cross-compile.

 

You can probably use my script to easily add new packages for the ReadyNAS NV+ v2... I've already built a few others for my brother which I may upload as well.

 

Anyway, I hope some of you find it useful 🙂

Scott

Message 1 of 38
Sandshark
Sensei

Re: Samba 3.6.25 build for ReadyNAS NV+ v2

That's great!  Since many users are unfamiliar and/or uncomfortable with SSH access and the Linux command prompt, it would be even better if it could be offered as an add-on.  Any chance you or somebody else interested could build one?

 

I'd volunteer, but I'm not a Linux programmer and have found no "ReadyNAS package building for dummies" guide.  The available instructions clearly assume you are a programming guru.

Message 2 of 38
sshambar2
Star

Re: Samba 3.6.25 build for ReadyNAS NV+ v2

I'd be happy to take a crack at it, but the add-on binaries don't appear to be a standard format, and I've yet to find any documentation on how to create one.  Anyone have a reference they can point me at?

Message 3 of 38
sshambar2
Star

Re: Samba 3.6.25 build for ReadyNAS NV+ v2

I've created a Samba 3.6 add-on using the old ReadyNAS Add-On SDK (thanks mdgm for the pointer).  The initial release can be found at:

 

https://github.com/sshambar/readynas-arm/releases/download/Samba36-3.6.25-1/Samba36_3.6.25-1.bin

 

Once installed, the add-on will run the new Samba 3.6 version.  There's an option to disable SMB2 support if you want, but it's probably best to leave it enabled.  If the add-on is disabled (or removed), the original 3.5 Samba server is restored and started.  Re-enabling the add-on will again start the new 3.6 version.

 

I also created scripts and Makefiles so if anyone wants to rebuild (or fix) the add-on, it's pretty easy.  Basically the add-on is a wrapper around a debian package (to allow removal), which is built from the binary tarfile.

 

The READMEs describe how it all works, but if you have the various SDKs installed, you should be able to build everything without difficulty.

 

Let me know if you have any problems.

 

Message 4 of 38
StephenB
Guru

Re: Samba 3.6.25 build for ReadyNAS NV+ v2


@sshambar2 wrote:

I've created a Samba 3.6 add-on using the old ReadyNAS Add-On SDK (thanks mdgm for the pointer).  The initial release can be found at:

 

Let me know if you have any problems.

 


Thanks for posting this!

 

I don't have own the NV+ v2, but I suspect many folks will find this useful.

Message 5 of 38
Sandshark
Sensei

Re: Samba 3.6.25 build for ReadyNAS NV+ v2

I get the dreaded "Unknown server error" when I try to upload this to my Duo V2.  But that may not be a fault with the package itself.

Message 6 of 38
p-tr
Initiate

Re: Samba 3.6.25 build for ReadyNAS NV+ v2

Unknown server error is caused by browser. 

I had the same problem.

Use old Internet Explorar and it works. 

Message 7 of 38
p-tr
Initiate

Re: Samba 3.6.25 build for ReadyNAS NV+ v2

The message "Unknown server error"  is because You use Chrome or newer browser. 

Try using older Internet Explorer and it works.

Message 8 of 38
Sandshark
Sensei

Re: Samba 3.6.25 build for ReadyNAS NV+ v2


@p-tr wrote:

The message "Unknown server error"  is because You use Chrome or newer browser. 

Try using older Internet Explorer and it works.


Not in this case.

Message 9 of 38
treboR2Robert
Aspirant

Re: Samba 3.6.25 build for ReadyNAS NV+ v2

I tried installing using edge and got the server error.

 

I then tried using internet explorer as directed and it installed fine.

 

HOWEVER

 

I cannot access the shares from my windows 10 laptop.

I tried all sorts of things to fix it but the only way I can access the shares is to enable smb1 in windows.

The addon tells me it installed correctly and when i click on it everything seems ok but i have no access to the shares.

I installed ssh and dug around inside the usr/sbin folder and found that the addon seemed to have changed smbd and nmbd to .orig files and the new ones are linked to usr/local/sbin
And the files smbd and nmbd seem to both be in usr/local/sbin

so it seems the addon done its job but something is wrong ???

 

If i disable the addon and turn smb off and back on again from the web interface and try to connect to the share using windows then windows pops up and says i cant connect because its smb1.

 

I then re-enable the addon and windows just says

attempting to connect for ages then says it cant access the share try checking the name or there might be a problem with your network.

 

(the same happens if i turn smb off and back on from the web interface after enabling the addon) (and the same happens if i restart the whole unit)

 

If I disable the addon but DO NOT turn smb off and on from the web interface i get the same message saying attempting to connect for ages and then windows can't access the share, check the spelling etc..

 

And as i said above if i turn smb off and back on after disabling the addon from the web interface and try connecting again it now says it can't connect because it smb1.

Message 10 of 38
sshambar2
Star

Re: Samba 3.6.25 build for ReadyNAS NV+ v2

 

If you have ssh access, it might be easiest to check the following with the plugin installed and SMB2 enabled:

 

1) if the smbd daemon is running: "ps -ef | grep smbd", should show one or more:

root 1955 1 0 Nov15 ? 00:00:00 /usr/sbin/smbd -D
root 1981 1955 0 Nov15 ? 00:00:00 /usr/sbin/smbd -D
root 7264 1955 0 08:47 ? 00:00:00 /usr/sbin/smbd -D

 

2) the Samba logs: "more /var/log/samba/log.smbd", should include something like:

[2020/11/15 17:28:16, 0] smbd/server.c:1072(main)
smbd version 3.6.25 started.
Copyright Andrew Tridgell and the Samba Team 1992-2011

 

3) try local client to confirm daemon is working: "smbclient -N -L //readynas" (replace readynas with your server name), should display a list of your shares.

 

4) make sure SMB2 include files are being loaded:

"grep include /etc/samba/smb.conf" should have "include = /etc/frontview/samba/addons/addons.conf" on the list

 

"grep include /etc/frontview/samba/addons/addons.conf" should have "include = /etc/frontview/samba/addons/SAMBA36.conf" as output

 

"cat /etc/frontview/samba/addons/SAMBA36.conf" should contain:

[global]
# enable SMB2 support
max protocol = SMB2

 

5) If all that looks ok, then you can also try running smbd directly with debug output.

stop current daemon: "/etc/init.d/samba stop"

start samba directly: "/usr/bin/smbd -i -d 1"

... then try to connect from Win10 (-i makes it quit after 1 connection though!)

 

Something on that list should give you a good idea of what's not working 🙂

 

Good luck,

Scott

 

 

Message 11 of 38
treboR2Robert
Aspirant

Re: Samba 3.6.25 build for ReadyNAS NV+ v2

Hi Scott,

 

Thank you for the fast reply.

 

"ps -ef | grep smbd" gave me

 

root 2742 2484 0 02:08 pts/0 00:00:00 grep smbd

 

 

"more /var/log/samba/log.smbd" game me

 

[2020/11/30 00:48:36, 0] smbd/server.c:1143(main)
smbd version 3.5.22 started.
Copyright Andrew Tridgell and the Samba Team 1992-2010

 

 

"smbclient -N -L //readynas" (replaced readynas with my server name) using cmd on my windows 10 laptop game me

 

'smbclient' is not recognized as an internal or external command,
operable program or batch file.

 

on putty connected to the readynas it gave me

 

smbclient: error while loading shared libraries: libtevent.so.0: cannot open shared object file: No such file or directory

 

 

All of step 4 came back exactly as you said it would.

 

 

"/etc/init.d/samba stop" seemed to work in putty, but on the readynas interface SMB was still green (active) and your plugin was also still active. I refreshed the page quite a few times.

 

"/usr/bin/smbd -i -d 1"  (I assume you meant /sbin here as the with /bin it said invalid directory.)

 

With /sbin it said

 

/usr/sbin/smbd: error while loading shared libraries: libtevent.so.0: cannot open shared object file: No such file or directory

 

 

I am not that clued up when it comes to all this stuff so I'm not sure what's wrong.

 

Hopefully there is something there that tells you what is wrong, and you can tell me how to fix it.

 

Thank You !

Message 12 of 38
treboR2Robert
Aspirant

Re: Samba 3.6.25 build for ReadyNAS NV+ v2

I realised with the more command i need to press enter to scroll to the most recent entries.

 

I done a restart of the ReadyNAS and tried it again.

 

Looks like the most recent entry is the same.

 

[2020/12/02 02:04:47, 0] smbd/server.c:1143(main)
smbd version 3.5.22 started.
Copyright Andrew Tridgell and the Samba Team 1992-2010

 

Its the old version right ?

Message 13 of 38
sshambar2
Star

Re: Samba 3.6.25 build for ReadyNAS NV+ v2

Yep, looks like the dynamic library linker isn't picking up the new libraries in /usr/local/lib (where libtevent.so is installed).

 

On my brothers ReadyNAS, the linker config files in /etc/ld.so.conf.d/libc.conf contain the following:

# libc default configuration
/usr/local/lib

 

This file is included from /etc/ld.so.conf by it's contents:

include /etc/ld.so.conf.d/*.conf

 

All that should lead to the linker picking up the required libraries in /usr/local/lib... however, perhaps the library cache is out of date... you could try running:

 

/sbin/ldconfig

 

to rebuild the cache ("ls -l /etc/ld.so.cache" should show the file is newly created after running that).  You could also run "/sbin/ldconfig -p | grep libtevent" which should show a couple entries for the libtevent.so library...

 

After that, try running "/usr/sbin/smbd -V" and see if that outputs "Version 3.6.25" as expected... if so, then you should be good to go.  (If the ld.so.conf or libc.conf files are not as described above, then they probably need fixing, but I would think that'd be unlikely...)

 

If the ldconfig command does fix the dynamic linker, then I'll need to add that to the postinstall script on the addon... so let me know if that is indeed the problem.  Modern systems generally handle out of date ld.so.cache's well, but these ReadyNASs are running a very old version of linux 🙂

 

Good luck,

Scott

 

Message 14 of 38
treboR2Robert
Aspirant

Re: Samba 3.6.25 build for ReadyNAS NV+ v2

Hi Scott,

 

Thanks again for the fast reply.

 

I have to say each time i saw your reply it filled me with fear because it looked so complicated and I am not very code savvy. BUT I concentrated hard each time and followed your CLEAR instructions to the letter and 5 or 10 mins later it was done, so yea thank you again for taking the time to share your work and also for being so quick to help with VERY clear instructions when there was a problem.

 

Anyway back to it.

 

I run "/sbin/ldconfig"

 

and "ls -l /etc/ld.so.cache" showed a time stamp of seconds ago. Smiley Happy

 

I then run "/sbin/ldconfig -p | grep libtevent" which showed 2 entries for libtevent.so Smiley Happy

 

I then run "/usr/sbin/smbd -V" which showed Version 3.6.25 Smiley Happy

 

I then changed directory to /etc/ld.so.conf.d/ and run "vi libc.conf" which showed

# libc default configuration
/usr/local/lib

Smiley Happy

 

I quit vi by first pressing escape and then pressing ":" and typing "q!" and pressing enter

 

I then changed directory back to "/etc/" and run "vi ld.so.conf" which showed

include /etc/ld.so.conf.d/*.conf

Smiley Happy

 

I quit vi by first pressing escape and then pressing ":" and typing "q!" and pressing enter

 

 

So everything looked great, I tried mapping a new network drive in windows 10 like I did with SMB1 (annonymously) and it wouldn't connect.

I then tried turning SMB off and on from the web interface but it still wouldn't connect.

I then remembered someone saying something about either SMB2 or windows 10 not liking annonymous login so I tried "use different credentials" and connecting using the web interface login details (default is admin and password) and it connected straight away.

 

Obvoiusly now everything is working I will go back and disable annonymous login from my shares and use "users" and permissions etc..

 

 

Thank you very much for your help getting it working !!!

 

I only dug this OLD nv+ v2 out of the cupboard last week to use as a backup for my FreeNAS TrueNAS system and I have still have it completley empty so if you want me to do a factory reset and test the addon once you have fixed what you need to, I am more than happy to do that. Just let me know.

 

Also as a P.S for anyone else who might read this, I also found someone else on the forums here who has created an addon to make the web interface use TLS 1.2 which is very helpful as firefox and other browsers no longer support the TLS version included with the readynas and the only way for me to access the web interface before was either to enable the TLS in firefox (which is not reccomended) or to use the old internet explorer (which I do not like)

The link to the forum post is ;

https://community.netgear.com/t5/New-ReadyNAS-Users-General/Readynas-duo-V2-unable-to-access-admin-p...

 

It does have a quirk to it where it doesn't seem to intsall properly but it actually does Smiley Frustrated

I commented on it in the last post on that thread so have a look over there.

 

The creator hasn't replied so maybe @sshambar2 could fix the addon ? sorry if thats cheeky Scott Smiley Tongue

As I said it does actually work so technically it doesn't need fixing but....

 

Anyway THANKS again Scott, let me know if you want me to do any testing.

Message 15 of 38
sshambar2
Star

Re: Samba 3.6.25 build for ReadyNAS NV+ v2

I've released a new version of the addon: https://github.com/sshambar/readynas-arm/releases/tag/Samba36-3.6.25-2

 

The update updates the library cache on install, and so should fix the samba daemon not running correctly after install.

 

Please let me know if you still have any problems 🙂

 

Thanks,

Scott

Message 16 of 38
Sandshark
Sensei

Re: Samba 3.6.25 build for ReadyNAS NV+ v2

Just to verify:  This can be loaded onto an OS 5.3.13 system over the old version or on one that has not previously had it loaded?

Message 17 of 38
sshambar2
Star

Re: Samba 3.6.25 build for ReadyNAS NV+ v2

Yes, I had my brother install it on his NV+ v2 and it replaced the (currently) installed addon with the new version.

 

Of course, it's also possible to just remove the old version and install the new one 🙂

 

S.

Message 18 of 38
treboR2Robert
Aspirant

Re: Samba 3.6.25 build for ReadyNAS NV+ v2

Hi Scott,

 

Thanks for updating the addon.

 

Will installing the new one actually do anything for me ? as mine is obviously now working after what we done the other day.

 

I am thinking of doing a OS Reinstal anyway as I would like to disable SSH and I don't think there is a way to do that apart from a OS Reinstall or a Factory Reset.

 

One thing I have noticed when using SMB at the moment is that I can't access my shares if I log in as a user. I have all the correct permissions set up (at least I think so) but no matter what I do, and I have tried A LOT of different things, it will not let me access the shares as a user, it only works if I login using the admin account that I use to access the Web Interface.

 

I don't know if this worked with the standard SMB1 setup ?

 

I will have a play this week at some point when I get a chance and report back.

 

Thanks again Smiley Happy

Message 19 of 38
sshambar2
Star

Re: Samba 3.6.25 build for ReadyNAS NV+ v2

Reinstalling the addon will make it so that uninstalling the addon correctly restores the old samba binaries (by re-running the ldconfig on removal)... so you might consider it if you ever think you might remove the addon 🙂

 

If you want to disable ssh, that's pretty easy without reinstalling... run the following (as root)

 

sed -i s/SSH=1/SSH=0/ /etc/default/services

/etc/init.d/ssh stop

 

I'll have my brother test logging in as non-admin, and see if that works for him.

Message 20 of 38
treboR2Robert
Aspirant

Re: Samba 3.6.25 build for ReadyNAS NV+ v2

Hi mate,

 

I had a chance last night / today to do a factory reset.

 

Once reset I tried logging in with the standard smb1 setup and I was having the same problem. After a few hours of pulling my hair out it turned out to be something very simple.

 

I was trying to access the shares by mapping a network drive in windows 10.

 

 

\\xxx.xxx.x.x\c\media

Logging in as admin works fine like this but as a user it says NO !

 

 

\\xxx.xxx.x.x\media

It turns out that if I leave the "c" out then I can login as a user no problem Smiley LOL Smiley Frustrated

 

 

I'm assuming it has something to do with the fact that only the admin can access \\xxx.xxx.x.x\c but it still doesn't make much sense to me. Smiley Indifferent

 

Anyway I got everthing setup how I wanted and I then disconneced the mapped drives, disabled SMB1 on my computer and rebooted it.

 

I installed the new version of your addon and like magic windows connected to it 1st time (without the "c" of course Smiley LOL) Smiley Very Happy I didn't even have to turn SMB off and on in the web interface.

 

GREAT work Sir !!!

 

Thank you very much, I (and I guess a fair few others) really appreciate it !

 

Robot Very Happy

Message 21 of 38
treboR2Robert
Aspirant

Re: Samba 3.6.25 build for ReadyNAS NV+ v2

That's insteresting that you can disable ssh ( I assume you do this over ssh )

 

So what happens after you type that command ? Does the ssh session your in just get cut off / disconnected ?

 

I done a factory reset anyway now so don't need it but thanks for the instructions. Smiley Happy

Message 22 of 38
StephenB
Guru

Re: Samba 3.6.25 build for ReadyNAS NV+ v2


@treboR2Robert wrote:

 

I'm assuming it has something to do with the fact that only the admin can access \\xxx.xxx.x.x\c but it still doesn't make much sense to me. Smiley Indifferent

Whether it makes sense to you or not, it is precisely because only the admin can access \\xxx.xxx.x.x\c

 

There are both network permissions and file permissions involved in access controls.  The C share is set up so that only the admin has the needed network permissions to access it.

Message 23 of 38
sshambar2
Star

Re: Samba 3.6.25 build for ReadyNAS NV+ v2


@treboR2Robert wrote:

 

So what happens after you type that command ? Does the ssh session your in just get cut off / disconnected ?

 


No, the command stops the sshd daemon (and disables it starting at boot) which prevents new sessions from connecting, but the current session will continue until you log out.

 

Message 24 of 38
StephenB
Guru

Re: Samba 3.6.25 build for ReadyNAS NV+ v2

Personally I'd leave ssh enabled, especially on a legacy NAS (where there are no support implications). 

Message 25 of 38
Discussion stats
  • 37 replies
  • 6270 views
  • 9 kudos
  • 6 in conversation
Announcements