Permanent SMB share connection

How do I create a "permanent" SMB share connection? That is, a connection that is automatically (re)established each time the machine boots and/or after network failiure. Thanks

iMac, Mac OS X (10.5.1)

Posted on Nov 19, 2007 4:05 PM

Reply
9 replies

Nov 20, 2007 5:11 AM in response to rswc90

That thread is about not being able to browse for SMB servers and shares. There is a lot of talk and experiments there but no real and generally working solutions, especially not in 10.5.1.

My question here is about establishing a permanent SMB share connection. Such a connection is reestablished automatically when the computer boots and/or you login and also after a network failure. In other os (e.g. boot camp) you do that simply by checking a checkbox when you connect.

Thanks/Mikael

Nov 20, 2007 6:07 AM in response to Mikael Hakman

I may be missing your boat, so please excuse if I am. I have been following all this because after I upgraded from Tiger to Leopard, none of MY NETWORK computers showed up in Finder like they did in Tiger. I still have to go to "connect to" each time I reboot. I am not talking about boot camp or parallels. Just pure & simple turn on and click connections.

Again, sorry if I do not understand.

Nov 20, 2007 9:20 AM in response to rswc90

Nothing to be sorry for, I have the same problem as you too and I have been following that other thread too. Not being able to see the servers in Finder is very irritating. However I also need a way to establish a permanent connection - this is required in iTunes when the files are on a network share, among other things. It is also required in order to run some other applications, automated UNIX utilities in particular. Thanks/Mikael

Nov 23, 2007 6:52 PM in response to Mikael Hakman

I can't get any SMB connection to work at all. It worked fine under tiger, but with leopard (both upgrade and clean install) can't get anything on smb (occasionally I can mount and copy some files to it, but can see them in the directory)

But, anyway... to sort of answer the question of the original post. Assuming you can actually make SMB connections...

If you want a permanent smb connection that mounts on boot/login, the following steps should work. It works for my afp connections.

open terminal.
type "su" to get super user privileges (You may have to enable this first), then:
cd /var/db/dslocal/nodes/Default/
mkdir mounts
cd mounts
pico

once pico opens paste the following and then edit for your own configuration:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>dir</key>
<array>
<string>/Network/SHARENAME</string>
</array>
<key>generateduid</key>
<array>
<string>0000000-0000-0000-0000-000000000000</string>
</array>
<key>name</key>
<array>
<string> IPADDRESS:/SHARENAME</string>
</array>
<key>opts</key>
<array>
<string>url==smb://WORKGROUP;login:password@IPADDRESS/SHARENAME</string>
</array>
<key>vfstype</key>
<array>
<string>url</string>
</array>
</dict>
</plist>

Let us know if that works okay for you.

Nov 24, 2007 7:35 AM in response to rswc90

Directions will follow, but first the warning...

After typing the su command and entering the correct password every command you type is executed with permissions of the superuser until such point as you type the command "exit" or simply close the terminal window. That means you can do anything at the command line, up to and including erasing the entire boot drive or any other attached drive (If you type the command to do it). Point being, you must be very careful, and I don't want to be blamed if something goes wrong. You should always have a recent backup of your important files, whether you're tinkering or not.

The superuser (root) is disabled by default (for the aforementioned reason) , this is why you were unable to get the password correct previously. To enable it, open Directory Utility (in the utilities folder), then click the lock at the bottom of that window. Enter your account password. Then go to the edit menu and select "Enable root user". Enter a password to use as the root password.

You then will be able to use that password after typing "su" in the previous instructions.

I'll also note here, since you've likely never used pico, that after you make the edits to the .plist file, you press control-o to save the file (CONTROL, NOT the command key) and control-x to exit pico.

You might do well to find other instructions on the net for pico, though it is pretty simple.

It will ask you what to save the file as after you hit control-o, you should be able to name it whatever you want, as long as you end the name with ".plist".

Nov 24, 2007 5:37 PM in response to jecarr2

Many thanks Jecarr2. It works…for the first user to login after reboot. It is not accessible to other users who login afterwards, whether the first user logged out or not. The mount point is owned by this first user and is accessible only to the owner (file mode 0700). The other users can see the share but it is empty in Finder and not accessible in Terminal. You can achieve the same effect by an entry is fstab (which is referred in auto_master). Actually fstab/auto_master solution is even better because it mounts the share on the desktop as a volume, but still accessible only the first logged in user.

I even tried executing mount_smbfs directly in Terminal and specifying file/dir mode 0755 which should make the share accessible to all users. The share appears in Finder but is empty there. Both mount point and the files get correct mode but they somehow are accessible only to the root, which you have to be when you execute the mount command. As soon as you leave su, the ls command doesn’t show any files, whereas under su it clearly shows that all users have read/execute access. Amazing.

Thanks/Mikael

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Permanent SMB share connection

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.