I wrote this up and wanted to post this here so people can see and hopefully move to new method of NAS/Host/PC/Client discovery with SMB in Windows Network Neighborhood.
Maybe this can become a sticky if its helpful.
I was able to create a series of 4 commands under post init that allow WSD discovery with Python3 package to self install quietly after every reboot.
I successfully tested on my own live machine and it works well. I wrote this all out to help newcomers seeking answer to this issue. Please read to the end!
I got this to work and the goal is to make it survive an embedded install reboot (Well, rather to make Xigmanas install it after every reboot without user intervention)
This is because Python3 package is currently NOT available in Xigma and once installed on an Embedded installation, the package does not survive a reboot.
Ok, so first thing, for this to work, you have to have an internet connection to the NAS so that Xigma can download Python3 from the online repository. Then go here and download the WSD script
https://github.com/christgau/wsdd and click on the green button on the right that says "clone or download" and download it to your pc as a zip. Unzip with your favorite unzip program.
(I personally love and use 7zip. I used to use winace, but it got old )
Save the wsdd.py script found in src folder to a persistent directory in Xigmanas that you know will survive a reboot. I created a folder and placed the script in my data partition under a folder named wsdd (/mnt/Data1/wsdd) Once there, I know it will always be there to run from, all that's left is to install python3 package and point it to your saved directory.
Now we start by creating these commands under post init one by one: (Navigate to System > Advanced > Command Scripts in Xigmanas)
Code: Select all
pkg install -q -y python3
But of course the answer is a yes. We want the package to install all dependencies. So using this -y switch lets it install all dependencies without seeking user intervention.
Next, its super important to change the permissions for the script so it can read, write and execute. (Remember to substitute your directory name where you saved the script as appropriate, mine is Data1)
Code: Select all
chmod 0777 /mnt/Data1/wsdd/wsdd.py
Finally, To run the wsd script:
Code: Select all
/mnt/Data1/wsdd/wsdd.py -w HOME
By leaving out the -i switch, this will allow the script to run on all NIC interfaces in your system.
The -w switch is for your Workgroup name. Substitute the name "HOME" with whatever is the name of your Windows Workgroup. Most people never change this name in their Windows OS, and the default name of your workgroup is simply called "WORKGROUP"
Save all three commands under System > Advanced > Command Scripts and you are all done. I tested this to ensure it reinstalled itself after a reboot 3 times. Each time it worked excellently.
I think this can work well until devs implement WSD discovery protocol in Xigma code. Until then, this works wonderfully.
So this is what your setup should look like: (Under System > Advanced > Command Scripts)
Also don't forget to do these notes:
1. Turn off TCP/IP over Netbios under NIC adapter properties (WINS/DNS settings) in Windows OS. Click on IPv4 protocol and click properties. You should see the option to disable it. This forces Windows to use WSD method instead of Netbios.
2. Turn off SMB1 in Windows, and ensure SMB Direct (Windows 10) is enabled. This forces Windows and SMB to use newer built in SMB version (SMB3). No more worries of security problems under old version SMB.
3. Turn off Local and Domain Master Browser under CIFS/SAMBA service in Xigmanas, as WSD discovery doesn't use old Master Browser anymore. No more [corrupt ] Domain Master Browser elections. You can be just like Trump. (No Collusion! )
4. Once you make all the changes, restart CIFS/SMB service in Xigmanas. Hostnames didn't show up for me until I did this. This is not needed as WSD is super fast. It literally allows the server Hostname to resolve and show up in Windows Network Neighborhood in a few seconds if not, within a second. I am literally blown away by how fast it is. WSD discovery puts old Netbios method to shame. I am literally appalled at the SMB engineers for not including this in SMB before. Its been built into Windows for a long time now. Yes, Netbios worked well before, but WSD method is new discovery method and was built into Windows since dating back to Windows 7! (2008-2009)
This is a purely an OCD issue, not a system issue. There is a small cosmetic thing that I realize. Once it runs the script, it won't give the "beep" you're used to hearing after startup of a fully rebooted system. Mind you, this is only if your system utilizes an internal and/or built in speaker/buzzer. The system is still booted up, but since the script is running, you miss the little beep it gives once finished booting. I think this can be fixed with a return or perhaps another "echo back to cd" command, I just haven't figured out yet
EDIT: Figured it out: I added an echo "return/redirect command at the end of the initial command to allow it to run the script, then redirect back to the command line internally, then finally, to exit from the "command line space", thus allowing full boot to continue.
This allows Xigma to boot fully, run the script and set you back to the command line, or in this case, the full startup. I can once again hear my trusty old "beep beep beep" the system gives me on full startup.
So modifying only your 3rd postinit command, it should look like this:
Code: Select all
/mnt/Data1/wsdd/wsdd.py -i cxgb0 -4 -w HOME /cd &
Code: Select all
Where the -i switch is my Server NIC interface, Chelsio 10Gb Card (cxgb0) You can leave the -i switch out if you want the script to run on all NIC interfaces in your system
and the -4 switch is to force the script to use IPv4 only (I don't use IPv6 yet)If you use IPv6, then just enter -6 instead.
Ok all done! Now reboot and give it a try. If all 4 commands are saved properly under System > Advanced > Command Scripts it should work great.
Full Python3 install with dependencies and script run at bootup! Full hostname resolution of NAS under Windows 10 WITHOUT old Netbios/SMB1 protocols!
Also when upgrading Embedded installation, save config.xml so in case the commands do not survive upgrade, you can restore as with all other settings, but I think commands should survive firmware upgrades.
Edit 2: Just did an Embedded firmware upgrade from XigmaNAS 220.127.116.11 (6536) to XigmaNAS 18.104.22.168 (6625) and post init commands survive upgrade. Package Python3 quietly installs along with running the script. So all good.
Indications and Rationale
I also wanted to mention the advantages of this: (In case you wonder what the use of this is)
1. Most people might be comfortable still using Netbios and old SMB1. However, Netbios is old method. Its like VERY old. Like over 30 years old I think. Maybe older.
2, SMB1 is also VERY old. Plus there are security risks with using old SMB1 protocol. Even Microsoft themselves begs people NOT to use it anymore. This is why Windows 10 now comes default SMB1 disabled on fresh install.
3. WSD discovery protocol is new and WAY better. It resolves hostnames like a beast in Windows Network Neighborhood. No more IP address searching, or looking for your server or PC's on your network. It just works, and works fast and extremely well.
4. WSD discovery method has been built into Windows for a while now. You can still use old stinky Netbios method, but why? WSD is literally built into Windows Explorer.
5. Older Netbios discovery protocol is slower than WSD as well. Windows 10 uses SMB direct to better utilize WSD and resolve your Network Neighborhood better than Netbios ever could.
6. Most other popular Server/NAS providers have all upgraded to WSD discovery protocol. Synology has its own implementation built in so their users don't go through the hell of searching for the NAS on their Network. Freenas also implemented this protocol in their software as well. Don't you want to use newer faster method as well?
There are more, but this should suffice people who ask: "Why do I need this?"
Also, if you have time, a good read: https://www.ixsystems.com/community/res ... -ever.106/
I mooched alot off of this article