It’s easy to connect to a network drive in OS X on demand, but if there’s a particular network drive or volume that you use frequently, you may want to have it mount automatically every time you boot your Mac or log in to your user account. This can save quite a bit of time and frustration, especially with Macs that have multiple users or that are rebooted often. Here’s how to automatically mount a network drive in OS X.

Step 1: Connect to the Network Drive & Save Your Login Info
Before you can instruct your Mac to automatically connect to a network drive, you first need to connect to the drive manually and allow OS X to save your user name and password for that drive. To do this, select Finder and choose Go > Connect to Server from the Menu Bar. In the server connection window that appears, enter the IP address or local name of the network drive you’d like to configure to automatically mount.
Click Connect to begin the connection to the network drive. If the drive or volume requires a user account and password, select Registered User and enter the required credentials. Before you press Connect again, however, make sure that Remember this password in my keychain is checked. This will let your Mac save and submit your account name and password when attempting to automatically connect to the network drive. Without it, you’ll be prompted to enter this information each time you log in, eliminating at least half of the purpose of setting up an automatic network drive connection in the first place.
When you’re ready, press Connect a second time and the drive will mount if all information was entered correctly. You can now close any open Finder windows but don’t yet unmount the network drive; we’ll use it next.
Step 2: Add Network Drive to User Login Items
The network drive has been manually connected and the required user account information has been saved. Now it’s time to configure OS X to connect to this network drive automatically when you log in.
Head to System Preferences > Users & Groups. Select your user account from the list on the left and click the Login Items tab on the right side of the window. This shows you all of the apps, scripts, documents, and user services that are configured to launch automatically when your user account logs in.
To add your network drive to this list, simply locate the network drive’s icon on your Desktop, and then drag and drop it into the Login Items list.
By default, whenever a Mac connects to a network drive it opens a Finder window to display the drive’s contents. If you don’t want this to happen with your automatically mounted network drive, just check the Hide box after you add it to the Login Items list. This will allow the network drive to mount quietly in the background, so that it’s ready and waiting for you when you need it.
To test your new setup, either reboot your Mac or log out and then log back in. The exact timing will depend on your network connection and the availability of your network drive, but you should see the drive appear in Finder and your Desktop within a few seconds of logging in to your OS X user account. If you ever want to stop your Mac from automatically connecting to a network drive, just head back to the Login Items tab in System Preferences, highlight the network drive, and click the minus button at the bottom of the list.
Disclaimer: Some pages on this site may include an affiliate link. This does not effect our editorial in any way.
16 thoughts on “How to Automatically Connect to a Network Drive at Login in OS X”
So, I end up with stuff like this
/Volumes/Documents
/Volumes/Downloads
/Volumes/Media
/Volumes/web
/Volumes/Documents-1
/Volumes/Media-1
/Volumes/homes
/Volumes/web-1
It’s kind of messy to have all these mount points under /Volumes, with no visual clue which folder belongs to which NAS..
Is there a way to rename the mount points to your liking, or to put the folders in a subfolder of their own?
E.g. I would like to see the following mount points, whereby Polaris and Blackhole are the names of my NAS’s:
/Volumes/Polaris/Documents
/Volumes/Polaris/Downloads
/Volumes/Polaris/Media
/Volumes/Polaris/web
/Volumes/Blackhole/Documents
/Volumes/Blackhole/Media
/Volumes/Blackhole/homes
/Volumes/Blackhole/web
Possible?
By mounting the shares to a predefined folder in your script.
I would suggest mounting it at Polaris/Documents or POL-Documents, BLA-Documents to save on folder browsing…
Do you know what I’m doing wrong?
Apparently you can only hide a limited amount of volume related login items.
A solution is to put all your network connections into a AppleScript and save it as one application.
Then adding this application to your login items, hide it and that’s it.
If you have trouble compiling this,I would happy to help you. Just reply to this message.
Greets, Bart.
mount volume “[protocol]://[server]/share”
My Windows server script is as follows:
mount volume “smb://server/music”
mount volume “smb://server/pictures/wallpapers”
If you are connecting to a Linux/UNIX share, the protocol should be NFS, Apple shares with AFP.
Feel free to add/customise your script with common Applescript syntax. (delay, if statements, …)
Do note: this implies your user/pw data is already in your keychain. You can include your login data into your script but as a security I don’t want to promote that at all.
If you want it into you keychain, just do a “connect to server” from a Finder window..
Greets,
Bart
https://magicbeansvfx.wordpress.com/2016/02/16/sys-automatically-mount-server-using-applescript/
Check out this solution which seems to work pretty well!
http://www.macdrifter.com/2014/03/auto-mount-disks-with-controlplane.html
Is there ANY way to just simply mount the NAS and make it accessible to all users without having to have several seperate mounts and permission issues?
Anyone have the same problem?
The script:
— mount nas drives
mount volume “afp://nas.local./data”
mount volume “afp://nas.local./media”
mount volume “afp://nas.local./web”
— close finder windows
tell application “Finder”
close every window
end tell
New issue:
I only want the drives to map when I’m on the office Wifi.
When at home it fails because it doesn’t allowed time to get the VPN opened. Sometimes I’m doing personal biz and don’t want to connect the VPN and drives.
For now I’ve made an alias on the desktop for the script. I can click on it when I get to work. But wish it was automatic.
Like if it detected my being on a specific Wifi it would run the script.
http://forums.macrumors.com/showthread.php?t=1640860
Implemented it and will see the next time I’m at work.
Got to “Finder > Preferences > General” and under “Show these items on the desktop:” make sure “Connected servers” is checked – else the various drives/servers will not show on the desktop, hence you will not be able to drag them into the “Login Items”
Comments are closed.