16

How to Automatically Connect to a Network Drive at Login in OS X

Posted by Jim Tanous on November 16, 2014
osx-yosemite-network-drive

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.
osx-connect-to-server
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.
osx-remember-password-network
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.
osx-login-items
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.

16 thoughts on “How to Automatically Connect to a Network Drive at Login in OS X”

Clint Wire says:
I think that my computer is trying to connect to the server before my wifi connection is established, and it states that there was a problem connecting to the server. Is there any way to fix this?
Reply
ViVi says:
This same problem on my Sierra.. If I mount network drive manually after few seconds it’s works fine, but first I see information about problem with network..
Reply
Carl Seghers says:
When I mount my NAS like in step 1, it proposes the list of root folders on the NAS… All the folders I select are mounted separately under /Volumes.. Thing is, I have two NAS’s, and I want them both mounted automatically, and they have both kind of the same root folders.. Adding the second NAS creates the same mount points but with a ‘-1’ suffix..
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?
Reply
Bart || Project IT says:
Makes me look like a one trick pony but you can solve this with an AppleScript.
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…
Reply
lusher00 says:
Every once in a while after I select the drive to mount it just spins. The system is still responsive but I can’t cancel the mount and it never mounts, it just spins. What process do I need to kill so I can start over?
Reply
Ralph C. Quinones-Alvarez says:
I am trying to load 4 volumes. Only the first 2 on the login list load. After that the remaining 2 volumes get changed to the be the same volume as the #2 on the list. So I end with 2 volumes loaded.
Reply
we7ee says:
I try to hide the Finder window (checked hide) but the finder window still open up!?!
Do you know what I’m doing wrong?
Reply
Ronald Gibson says:
same here
Reply
Paul Bredenberg says:
Same here
Reply
Bart || Project IT says:
I had the same problem.
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.
Reply
Steve Dutton says:
I would like to do this via Applescript and could use some help. I had been using Automator previously, but when I updated to Sierra, it no longer works. Part of my problem is that I store my iTunes folder on one of the NAS shares (Multimedia) that I used to mount using Automator. Now with Sierra, it appears that the OS automatically mounts the Multimedia Share that contains the iTunes folder. Since the NAS drive / Multimedia Share has been “signed in” upon login (from the Keychain), the only way I’ve been able to mount the other shares is to manually double click on them from the Shared Devices Sidebar list . . . any process of mounting triggers that particular Share’s login page, which then rejects the User / Password saved in Keychain (probably because it’s already signed in). Not sure if this is desirable, but one way around this is to somehow prevent the Multimedia Drive from being mounted at login, which would then allow me to mount multiple shares through the Automator process again.
Bart || Project IT says:
I would recommend using Applescript as follows. (Disable other stuff like automator to be sure nothing is interfering)
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
Craig Jacobs says:
This does not work reliably if you stay logged in all the time and your machine sleeps or whatever. eventually the share will go away and in some cases can not be remounted without a reboot. This used to work in 10.6, but ever since 10.7 or 10.8 mounting server drives is simply unreliable. The web is full of complaints about this issue. Apple doesn’t acknowledge nor care apparently since this has been going on for over 4 years now.
Reply
Carl says:
Hi, how can I download NAS (Network Attached Storages) to my computer? I’ missing it from mine Finder. Is there a firmware to download from? Any ideas how to do this? Carl
Reply
Gabriel Tortelli says:
Hi! I used this in the past, now how do I UNDO it? I go to ‘users & groups’ and I can’t see the volume there anymore.
Reply
Alan Short says:
I’m using this method to mount a NAS volume, however the Hide option doesn’t work. The Finder window still appears at login. Any ideas how to stop this, and to really mount quietly?
Reply
BlueLightAlarm says:
I’m getting the same thing. It’s not a huge problem but is a bit of an inconvenience :-/
Reply
Jack Hughes says:
I’ve written an AppleScript to get around this problem. I hope it helps!
https://magicbeansvfx.wordpress.com/2016/02/16/sys-automatically-mount-server-using-applescript/
Chloe Milhous says:
Thank you so much for this tip! I’ve been trying to figure out how to do this for days, and dragging and dropping never occurred to me. Thanks for making my job a bit easier!
Reply
Barry says:
I’m having the same problem… finder opens on start even though I’ve selected hide.
Reply
Michael says:
same problem here. I guess there are some real apple fanboys that can explain why this is not a problem that need to be fixed
Reply
Philip Smith says:
Same here
Kidsnd274 says:
The window doesn’t hide even though I checked hide.
Reply
EricSGoldstein says:
This is a good idea, but it only helps if you reboot your mac..
Check out this solution which seems to work pretty well!
http://www.macdrifter.com/2014/03/auto-mount-disks-with-controlplane.html
Reply
Matt Richards says:
The problem that I have is when I try to auto-mount my Synology NAS server, the mount will conflict with other profiles. Depending on which profile logged in, the re mote directory name will change. This is especially problematic for iTunes as it makes my content continuously unavailable because the remote directory has “moved.” When I have the drive mounted in one profile, it is not accessible with the same mount in any other shared profiles.
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?
Reply
flink41 says:
If I do this in Yosemite with multiple network shares it won’t work. Only one network share will be mounted after login and the multiple network shares in Login Items are all the same.
Anyone have the same problem?
Reply
Serena H says:
I have this exact problem! I have multiple network shares I want opened. I’m hoping someone would have the solution for this!
Reply
Patrick Smulders says:
So strange. It worked alright with Yosemite. 2 Drives got connected. Recently I changed something and now I’m stuck with this stupid problem too. Solutions are welcome.
Reply
Patrick Smulders says:
Now I found out it’s not me, but OS X, I stopped trying and went for a different solutions which I share here. It’s a very simple applescript that connects the drives and closes the finder windows. With me it works. Adjust it for your own drives and then ‘export’ it as a programma. Put the programme in login items.
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
Ganja Grynch says:
I found that the shared items disappear from the finder list once you add a share. As stupid as this sounds, you have to add a share to the login items, apply it, close preferences, go back in mount another, repeat… its clear some sort of bug, but it took me about an hour to figure out how to get 4 volumes to mount at login
Lucas Otten says:
This worked great.
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.
Patrick Smulders says:
Lucas, I have no need for it myself, but was curious wether applescript has these possibilities. I found this thread, which seems a good starting point for your situation:
http://forums.macrumors.com/showthread.php?t=1640860
Lucas Otten says:
I actually ran across that yesterday.
Implemented it and will see the next time I’m at work.
Andrew Duncan says:
You forgot to mention before you start the “connect to server” to do the following:
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”
Reply
Chris Monteiro says:
You can drag them from Finder.
Reply

Leave a Reply

Your email address will not be published. Required fields are marked *


Disclaimer: Some pages on this site may include an affiliate link. This does not effect our editorial in any way.