Permanently map a network drive on Mac OS X Leopard

Mount a Windows Share in OS X and Have it Reconnect at Login (via www.howtogeek.com)

Mounting the Windows Share

When you are in Finder you can click Go and Connect to Server or you can type Command + K to get to the same menu.

In Server Address you will need to put the location of you Windows share with this format smb://server/share where server is the name or IP address of your Windows machine and share is going to be the folder or drive you want to mount.

alt text

If your Windows share requires authentication it will ask you for that info here.

Now if you have Connected Servers showing on your desktop, it will show up on your desktop an in Finder.

Making the Share Mount at Login

To keep the share showing up when you have to log out seems pretty difficult. The internet is littered with ways to write scripts to allow you to do this. But OS X makes it pretty simple if you are just needing to add the share to your machine.

You will need to be in System Preferences for this, which you can get to by clicking on the Apple Menu and then going to System Preferences.

alt text

Then you will go to Accounts.

alt text

Once in Accounts, you will need go to the Login Items tab. Then you will just drag the share from your desktop or Finder window into the Login Items list.

alt text

If your share requires authentication, it may be possible to add the username and password into your keychain with the check box in the authentication window. Some shares will not work with the keychain though.

This is pretty nice if you are working a lot between OS X and Windows, and need to move files between the two.


To solve the issue of a Finder window showing the network drive each time you log in, you can check the Hide box in the Login Items list.


What kind of NAS are you using?

If it has an IP#, supports AFP and user authentication... maybe try this AppleScript as a start ( Create this with Script Editor ). Replace username,password and IP with your info:

try
    mount volume "afp://username:password@ip_address/sharename"

end try

Save the script as an application

 File -> Save As -> File Format -> Application

Then go to

Sys Prefs -> Accounts -> Login Items

and add that application to your login items.


I do have a NAS as well, and having switched to Mac about 2 years ago, I found this to be one of the main disadvantages of Mac. Windows is much better for handling network drives. Even on Linux things work out much better than on Mac.

There is a way to automatically map a drive at logon (you can add it to the 'applications' to launch at logon, see for example the explanation here), but that isn't working very well for me (see e.g. the sleep issue below). Other solutions are based on automator scripts, but it is all very clumpsy.

The problems as I experience them:

  • indeed an application, like iTunes or MS Word, doesn't bring up (mount) the network share automatically when it is not mounted.
  • also, when my mac awakes from sleep, sometimes the network mapping is lost (a dialog tells me "server connection interrupted"); sometimes it keeps on working. I then have to wait for about 10 seconds before I can mount the share again.
  • additionally, when using fast user switching the network share is mounted two times because of user permission issues. As a result, shortcuts to the share sometimes become unusable.

Another solution would be to cache all information from the share locally, like you can do on Windows Vista and higher very easily using Windows Sync (or Windows Offline files as it is also called). This gives the added benefit of a backup copy and ability to work offline. However, no such thing is available on Mac (see here).

So, this isn't an answer to your question, but I have done the following as a (bad) workaround:

  • I have put a shortcut to the network share on my desktop. I click it whenever I need to work with files on my NAS.
  • I copied my music files to my local hard drive, on both our macs. A very unsatisfactory solution though since these libraries then go out of sync. (The problem is worsened by iTunes not being able to watch a folder for changes). I am still on the lookout for a good media player for Mac. Amarok was promising, but I don't like their version 2 interface.
  • What concerns photos (which are also on my NAS), I've ditched iPhoto and am using Picasa now, which is able to watch a folder for changes. This way, I have only one photo library.

If there is a better solution, I am very curious for it too...