Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Automatically reconnect to a Samba share at login Network
At work I have a G4 and a P3 in my office. My P3 has most of my existing Java code on it, including a working connection to a CVS server. Now that I'm developing some Java on my Mac, I need to access my P3's files constantly. However, when I restart or log out of my G4 at night and log back in the next day, I'm naturally disconnected from a share to which I connect (the share is set up on the P3 and I connect to it via the G4).

So, here's how you can get OS X to reconnect to a Samba share at login:
  1. Connect to the server (Cmd+K in the Finder, continue through the steps until you have it mounted on the Desktop)
  2. Open System Preferences and go to Login Items.
  3. Drag the shared folder from the desktop to an empty spot in the list of login items.
If all is well then it show up as the share name with the kind "Folder." It might pop up as a new Finder window at login, and checking Hide might hide the entire Finder, but it's better than nothing.

[robg adds: I thought we had a hint on this already, but my searches came up empty ... so here it is!]
    •    
  • Currently 3.67 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (3 votes cast)
 
[28,511 views]  

Automatically reconnect to a Samba share at login | 16 comments | Create New Account
Click here to return to the 'Automatically reconnect to a Samba share at login' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Automatically reconnect to a Samba share at login
Authored by: Gonzonia on Jun 26, '03 11:08:59AM

I think this hint was somewhere. I never got it to work myseld. I've added an applescript to the login items instead...
Save as an app and place in the login items...Works great (unless I'm not on my network)


tell application "Finder"
mount volume "smb://<WORKGROUP>;<USER>:<PASSWORD>@<MACHINE>/<SHARE>"
end tell



[ Reply to This | # ]
Automatically reconnect to a Samba share at login
Authored by: chrisleuty on Jul 01, '03 03:53:43AM

I couldn't get this format to work so I tried this instead - with success:

tell application "Finder"
mount volume "smb://<USER>:<PASSWORD>@<MACHINE IP NAME OR NUMBER/<SHARE>"
end tell



[ Reply to This | # ]
A word of warning
Authored by: sebastienb on Jun 26, '03 11:41:10AM

I was doing this for a while under 10.1x and came across some odd inexplicable problems, like some preference panes not loading and such. Once I removed the share I was connecting to from the login items, everything returned to normal.

As I've said this was under 10.1x, and I had the item set as 'hidden' on login; haven't tried it under Jaguar at all.



[ Reply to This | # ]
Automatically reconnect to a Samba share at login
Authored by: jb72 on Jun 26, '03 03:44:25PM

You can also make a url in Safari (include name & pass in the address,) drag it to the desktop, then add it to login items. This tends to mount the server faster, and doesn't pop up a folder window.



[ Reply to This | # ]
Automatically reconnect to a Samba share at login
Authored by: mrpresident47 on Jun 26, '03 06:05:57PM

please give an example URL.



[ Reply to This | # ]
URL format for samba shares
Authored by: ethomas on Jun 27, '03 04:35:16AM

The url should be in the same format as the one shown in the first comment by Gonzonia:

smb://<WORKGROUP>;<USER>:<PASSWORD>@<MACHINE>/<SHARE>

<WORKGROUP> can be left out if it's not required. <SHARE> can also be left out, but you'll get a dialogue box requesting you to pick a share if you don't specify one, which defeats the object of automatically logging in like this!



[ Reply to This | # ]
URL format for samba shares
Authored by: toddsnc on Jun 28, '03 11:21:32AM

i tried this in Safari (1.0 v85) and got the message 'Cannot go to "smb://<your text here>" because Mac OS X doesn't recognize addresses beginning with "smb:"' Any other ideas?



[ Reply to This | # ]
URL format for samba shares
Authored by: dfbills on Jun 30, '03 12:13:04PM

I'm seeing the same thing.



[ Reply to This | # ]
Samba problems when network connection is lost
Authored by: DelVach on Jun 27, '03 03:50:47PM

I recently got a 17-inch Powerbook which has replaced my home Quicksilver 733, and work AGP graphics 400 (Sawtooth?).

When I'm at home I use MacSFTP for accessing the development server and editing files with BBEdit. In the office I mount the drive via Samba. Everything is copasetic unless I make the mistake of not ejecting the Samba volume before putting the system to sleep and disconnecting from the network. I get home, wake the machine up, and have to wait FIVE TO TEN MINUTES for the beachball to stop. I usually end up doing a hard reboot in this situation, as it seems like the only solution. The Finder becomes 100% unresponsive, and essentially freezes the system.

I am PRAYING that Panther will do a better job of handling these sort of network issues, because it's just rediculous. I try to remember to eject the drive, but sometimes I forget and pay the price.

Any thoughts or common experiences?



[ Reply to This | # ]
Samba problems when network connection is lost
Authored by: toddsnc on Jun 28, '03 11:18:19AM

I don't know where the problem lies (SAMBA or higher), but the exact same thing happens to me. it's usually faster just to restart the machine than wait. this is my #1 peeve (#2 is that CUPS printing to a Windows machine is still flaky at best) with the current OS.



[ Reply to This | # ]
More problems with lost connections
Authored by: ryangreenberg on Jun 30, '03 12:28:44PM

This problem isn't isolated to Samba shares, at least for me. I have this same problem with Apple File Sharing volumes. At first I kept trying to relaunch the Finder which typically turned into a reboot, but it really does just lock up for several minutes, disconnect from the volume, and return to normal.

This really is unacceptable--avoiding these kinds of lockups and problems are the reason I want to use OS X. It's especially a pain in the rear remembering to disconnect from all volumes before I put my PowerBook to sleep and move from home to office. When I forget--there's a locked up Finder for at least 5 minutes. Maybe someone can start a forums thread on solutions?



[ Reply to This | # ]
Automatically reconnect to a Samba share at login
Authored by: ptevans on Jul 01, '03 05:24:51PM

I did it like this:

Connect to the server, add your pass to the keychain.

Your share will now be mounted on the desktop.

Create an alias of the share.

Go to the Finder->Preferences

Deselect "Show connected servers" on desktop

Rename the alias on the desktop to whatever you please, you will now effectively be your share.



[ Reply to This | # ]
Automatically reconnect to a Samba share at login
Authored by: r_barish on Jul 06, '03 12:41:33AM

Of all the things I have read and tried this solution was so simple I could not believe it. It works great. I guess KISS is always applicable.



[ Reply to This | # ]
Automatically reconnect to a Samba share at login
Authored by: defrogger on Jul 30, '03 11:03:45AM

I cant get this to work, When I restart the Alias is there but when I double click on it, it asks for the password, this is fine. But when I type the password in I get a message saying "the alias could not be opened, because the original item cannot be found"
If I goto to finder and connect to the server then the alias works.
But im trying to get the share to come up at login automatically. Ive tried some of the above hints but I havent been able to get those to work either.



[ Reply to This | # ]
Clarification of the URL hint
Authored by: trekan on Aug 12, '03 08:57:47AM
Write the smb (or afp) url in the address line like this:

smb://username:password/serveripaddress/sharename

Drag the icon on the left of the address to the desktop. Now you see a URL document, which you drag into the login items window.

[ Reply to This | # ]
Clarification of the URL hint
Authored by: ashique on Aug 23, '04 11:56:14AM

what if I want the share to be mapped under different user/pass ? If I want the system to prompt for a user/pass on every login how do I do that?



[ Reply to This | # ]