Jump to content
pstadler

Mount network shares with automatic discovery

Recommended Posts

This is a workflow to mount your network shares with automatic discovery. No configuration or bookmarks required!

 

Download stable version. Please report problems here. Your computer won't explode and your shares are safe, I promise.

 

screenshot.png

screenshot-unmount.png

 

Troubles?

Make sure that both, Apple Filing Protocol (afp) and Samba (short smb, QNAP calls it "Microsoft Network") are enabled on your NAS. Due to the nature of the protocols and the available tools on OSX, both of them are required in order to disover network shares in your network. Also note that already mounted shares are not listed in Alfred. Enable guest access to the NAS, not for a specific share, but for the system in general if things don't work.

 

 

The source code is available here: https://github.com/pstadler/alfred-mount

Edited by Patrick Stadler

Share this post


Link to post

Try to enable guest access to the NAS, not for a specific share, but for the system in general. Also make sure, that both AFP and SMB services are activated.

 

If this doesn't help, open Terminal.app, run the following commands and post the output here.

 

dns-sd -B _afpovertcp._tcp

smbutil view -g //<HOSTNAME-OF-YOUR-NAS>   (e.g. smbutil view -g //my-nas.local)

The seconds command is used by alfred-mount for getting a list of available shares as a guest, that's why you should enable guest access.

Edited by pstadler

Share this post


Link to post

mmh... doesn't help

MacBook-Pro-de-Benoit:~ nibelune$ dns-sd -B _afpovertcp._tcp
Browsing for _afpovertcp._tcp
DATE: ---Fri 22 Mar 2013---
16:48:34.168  ...STARTING...
Timestamp     A/R Flags if Domain                    Service Type              Instance Name
16:48:34.168  Add     3  6 local.                    _afpovertcp._tcp.         MacBook Pro de Benoît
16:48:34.168  Add     3  5 local.                    _afpovertcp._tcp.         MacBook Pro de Benoît
16:48:34.168  Add     3  5 local.                    _afpovertcp._tcp.         Freebox Server
16:48:34.168  Add     3  6 local.                    _afpovertcp._tcp.         Freebox Server
16:48:34.169  Add     2  5 local.                    _afpovertcp._tcp.         readynas (AFP)
^C
MacBook-Pro-de-Benoit:~ nibelune$ smbutil view -g //readynas
Share                                           Type    Comments
-------------------------------
media                                           Disk    Media Server Share
backup                                          Disk    Backup Share
resources                                       Disk    Resources Share
IPC$                                            Pipe    IPC Service (readynas)
softwares                                       Disk    Software Share

5 shares listed

Edited by nibelune

Share this post


Link to post

For all QNAP users: 
 
To have the automatic detection of Shares working you have to activate beside the Apple Networking (AFP) also the Microsoft Networking on your QNAP NAS under "Network Services" > "Microsoft Networking".
 
MS-Networking_QNAPs.jpg

 

 

Share this post


Link to post

Any chance of getting NFS support?  Tried playing around with it a bit, but just can't wrap my head around it (could be because I'm dead tired, but still...)

 

Or any leads on what needs to be done to support other mounting formats would be great too!

Share this post


Link to post

Currently I don't have the setup ready to work on NFS support. If I find time, I might give it a try. Feel free to hack on the workflow, would be great if you share your results.

Share this post


Link to post

Thanks for the workflow.

 

How can I navigate in the network drive or mooted drive using Alfred?

 

Please point me in the right direction

 

Look forward to hearing from you

 

 

Share this post


Link to post

Hey thanks for this. Still working in 2017! 

 

How can I connect to other Macs on my network? My QNAP shows up but does this work for Mac shares?

Share this post


Link to post

Glad to hear that. I'm using it frequently, means you can count on an update if this should break in the future.

 

Regarding your question: Enabling SMB in "System Preferences > Sharing > File Sharing > Options..." could potentially solve this problem. Please let me know if this works for you.

Edited by pstadler

Share this post


Link to post

Whoa! Just saw this months later. Still working fine in Oct 2017!

 

Can you update the workflow so if I know the name of the shared folder I can just type it in? Then hopefully that either mounts it straight away or brings up a login prompt?

mount music

Bonjour is great but it's also kinda slow when you have multiple shares. Thanks so much.

 

P.S. If you have even more time could you implement a shortcut key to save a folder as a favorite? For example, CMD + Enter pins a folder so that next time "mount" is envoked it displays the Favorite folders beneath and users could select them without waiting for auto discovery. This could save time also. Thanks. 

Edited by Kevllar

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×