Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.
Resource icon

Resource How to get your FreeNAS Shares to appear in Windows Network Neighborhood 1

Microsoft decided quite some time ago to relegate UNIX boxes to second class citizens when it comes to having a place in Network Neighborhood (NN). When this decision is combined with a cat's cradle of protocols whizzing across the network (NetBIOS, WINS, SMB1/2/3) it became virtually impossible to untangle a means of getting said boxes to reappear in NN.

This resource provides a means to make that happen. In full disclosure I am "standing on the shoulders of giants" with this solution. The real meat of the solution is christgau's excellent python code providing a daemon for Web Service Discovery, wsdd.py. (see link in section 2)

Here I take that code and create a script which allows it to run at FreeNAS startup.


Procedure:

1. Follow the instructions regarding the removal and/or disablement of NetBIOS, SMB1 and WINS from the original article

2. Create a file /usr/local/bin/wsdd (using your favourite editor) with the contents of the excellent module from christgau File here

Code:
nano /usr/local/bin/wsdd


3. Give group and other execution rights to the file so that it may be called and run by the script

Code:
chmod go+x /usr/local/bin/wsdd


4. Allow the file to be run by the python3 installation on FreeNAS

In FreeNAS 11.2.4.1 (my version) the python reference in /usr/local/bin is a symlink to python3. The wsdd.py file needs python3 so if yu are running a version of FreeNAS without python3 this solution will not work.

Code:
nano /usr/local/bin/wsdd


Modify the hashbang in the file to

Code:
#!/usr/local/bin python


5. Create a shell script somewhere mountable.

I called mine wsdd.sh (not very original ;))

The code has a number of switches which are worth exploring

Code:
 /usr/local/bin/wsdd --help 


The default behavior is the listen and respond on all interfaces and on the default WORKGROUP for the FreeNAS box. This can be onerous especially the interfaces part if you have a lot of virtual interfaces due to VMs Jails etc. Better to listen on the hardwired i/f(s) only. I'm only using 1 - if you need more add another -i entry.
One of my FreeNAS boxes box is also attached to an AD domain so I have included that command too (note that the -d switch overrides any -w entries)

Contents of the script:

Code:
#!/bin/sh

/usr/local/bin/wsdd -w <workgroup name> -i <preferred interface> &


if connected to a domain try this variation

Code:
#!/bin/sh

/usr/local/bin/wsdd -d <domain name> -i <preferred interface> &


(NB the inclusion of an ampersand at the end of the command as this will allow the command to run in the background. This is a bit hacky but I didn't want to dig into the creation of a service on FreeNAS in light of the up-and-coming built-in solution in 11.3-ish :))

6. Set up a Task to run at startup

  1. Goto Tasks
  2. Choose Init/Shutdown Script
  3. Add
  4. Enter details
    • Type = Script
    • Point to wsdd.sh
    • When = PostInit

7. Reboot FreeNAS

8. Windows Network explorer now shows FreeNAS Server+Shares :):)

Thanks heaps to everyone who has made the reappearance of UNIX Shares in the Network Neighborhood possible!! WSDD.py is brilliant!
Author
Ian Carson
Downloads
105
First release
Last update
Rating
0.00 star(s) 0 ratings
Top