Jump to content

Lion and SMB Workgroup Problem


Unequipp
 Share

15 posts in this topic

Recommended Posts

Hi!

 

There is a very naughty problem with Lion, it didn't happen in Leopard or Snow Leopard. I used to map my Mac OS's home folder in Windows 7. It worked fine, everything was great.

 

But now Lion just "forgets" WORKGROUP settings in System Preferences->Network->Advanced->WINS. And if it just forgot, it would be more or less fine. But even after entering NetBIOS name and Workgroup and pressing Apply, it doesn't remember it! I open the dialog again, and the fields are empty again.

 

But after some time, about a minute it may "remember" the settings. Here's what it looks like: you set the settings, press Apply, but after opening the dialog, the fields are empty. Then after one minute you open the dialog again, and your entered data is here...

 

When Lion finally sets the Workgroup, I can easily access my folders from Windows 7. But without "remebered" workgroup Windows just asks for credentials, and though username and password on Mac and Windows matches, it doesn't let me in.

 

This problem drives me mad, that is absolutely uncomfortable.

 

I know that I'm not the only one who encountered this problem. I've searched a lot of forums, but no one has a solution...

 

Please, can you tell if there is some guess or solution to this:

1) What is the source of the problem? Nothing of this happened earlier - in Leopard or Snow Leopard

2) Maybe I need to reinstall Samba instead of a new version built-in Lion?

3) Maybe I can somehow make a script to run on boot?

4) And maybe I can somehow turn off authentication in Windows?

 

Or something? I'm lost.

 

Could you please describe your guesses?

 

Short summary:

 

It is probably better to turn off Apple's File Sharing and install samba3, like C.44 described in Post #5.

Still there is a problem with automatic launch of the samba service. You can solve this after reading Post #9, Post #11, Post #12.

 

+ very stable version of samba

+ works flawlessly with Windows, Dune HD Players and so on

+ fully automatic

- requires some terminal work

- samba configuration is performed in text editors (though it is pretty simple).

 

You can also do like Noam AA told: after system reboot go to Sharing to disable File Sharing and then enable it back. Pluses and minuses here are reversed.

Link to comment
Share on other sites

there is a problem with smb sharing and some reported they can't even enter as guest account

 

as for the problem of group setting, i too encountered a problem where changes i made didn't take place.

the only 'workaround' i found, was to disable SMB Sharing, restart, make the group changes, then apply SMB sharing once again.

it seems like there is some kind of conflict when SMB sharing is on, setting doesn't always take place.

Link to comment
Share on other sites

Noam AA,

Thank you for your reply!

 

I started doing like you said:

1) Before system shutdown I go to System Preferences, and turn off Sharing->File Sharing

2) I reboot or shutdown

3) When the system startups netbios name and workgroup are not "forgotten". I go to system preferences and turn on File Sharing.

 

Maybe anyone knows how to turn Files Sharing on/off from the Terminal so it would be possible to automate these actions?

I tried

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.AppleFileServer.plist

and then

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.AppleFileServer.plist

But it doesn't help.

 

Or nobody uses samba? Or only just few people encounter such problems?

Link to comment
Share on other sites

Apple's version of "SMB" is beyond buggy. I'd even say it is the single worst "feature" in Lion. I had numerous problems trying to get filesharing to work reliably. At first i found out that i had to turn SMB sharing off and on after every reboot. And to top it off windows had nothing but problems reading, accessing and writing to shares. Last night i had enough and disabled Apple's f*cked implementation of Samba all together.

 

Ofcourse i still had to get myself some sort of way to make shares so i installed MacPorts, installed Samba3 and edited the smb.conf file to setup the shares the way i wanted. Should've done that a LONG time ago.

 

Anyway, here's what i did:

1. DISABLE ANY AND ALL FILESHARING. Go to System Preferences > Sharing and disable Filesharing. Then hit options and disable both SMB sharing and remove the check in front of the account associated with it.

 

2. Download MacPorts. Make sure you have XCode installed though, macports install (maybe even itself too) relies on it.

 

3. Go into the Terminal and enter "sudo port install samba3" (without the quotes ofcourse)

 

4. Sit back for a bit, it's a 80-ish mb download

 

5. Once it's done, still in Terminal enter "cd /opt/local/etc/samba3/" (again.. without the quotes)

 

6. Copy the sample "smb.conf.sample" file to "smb.conf" in terminal as well. "sudo cp smb.conf.sample smb.conf" (no quotes again)

 

7. Using your editor of choice (mine is Textmate but any editor will work really) edit the smb.conf file

 

8. Look up the part where it says "workgroup" and set it to your workgroup. Mine was WORKGROUP (be creative huh :()

 

9. Then look up the "server name" bit, set it to what you'd like your mac to show up like in the workgroup. Ideally this is a single word no weird characters and stuff.

 

10. Comment out or erase all the sample shares in the conf file.

 

11. Add this to the bottom of the file

[TV]
comment = TV
path = /Volumes/MyBook/TV Shows
available = yes
guest ok = yes
create mask = 644
directory mask = 755
read only = no

 

Should be pretty self-explanatory right ? [TV] is the name of the share as it shows up to other networkusers. The comment can be anything really. Path is the bit where you set the folder that you want to share. Available enables or disables the share. Guest Ok is where you enable or disable guest access (read only). Create Mask is the bit that determines what permissions will be attached to new files networkusers create. Directory Mask is where you set the permissions to this particular folder (and all subfolders/files). Read only... well you'll figure that out.

 

12. All that is left is starting the smbd and nmbd daemons. In Terminal enter "sudo /opt/local/sbin/smbd -D && sudo /opt/local/sbin/nmbd -D".

 

13. You'd think that'd be it, but you'd be very wrong too. You still need to set a smb password to an EXISTING user account on your mac. In Terminal again "sudo /opt/local/bin/smbpasswd -a username".

 

14. Now you're done. You will finally have a reliable way to access your shares from other computers on your network.

 

15. Well not entirely. You will either have to restart the smbd and nmbd daemons manually after every reboot or put the file i attached to this post ("com.imac.samba3.plist.txt") into your /Library/LaunchAgents/ and remove the ".txt" extension (forum doesn't allow ".plist" uploads so i added ".txt"). That should launch both daemons on startup. I say "should" because i haven't yet tried it myself (i hate rebooting, courtesy of being pestered by Windows for years on end).

 

Ofcourse i didn't dream this up all by myself so i'll add the two sites i found on Google that pointed me in the right direction:

Manually install Samba on OSX Lion - Sonos Forums

OSX Lion Samba SMB shares broken – XBMC not working | John Large – Technology & life Blog

com.imac.samba3.plist.txt

Link to comment
Share on other sites

Thank you, C.44!

 

That worked! :D

 

I've found such guides about installing samba3, but after installing and running it, Windows kept asking for password. Nobody mentioned your Step #13! And now it works!

 

com.imac.samba3.plist brought kernel panic :P , so I booted to single mode and removed the file!

 

Thank you for this guide!

Link to comment
Share on other sites

is there a way to install Samba3 without installing Xcode? I am not a developer and I really would like to get it installed without it. Also, in case someone might need, here is one of the ways to enable FTP server on Lion. As you might know, Apple removed GUI option of FTP from Sharing pane.

Link to comment
Share on other sites

Thank you, C.44!

 

That worked! :)

 

I've found such guides about installing samba3, but after installing and running it, Windows kept asking for password. Nobody mentioned your Step #13! And now it works!

 

com.imac.samba3.plist brought kernel panic :) , so I booted to single mode and removed the file!

 

Thank you for this guide!

 

No problem, glad it helped someone else besides me. If there's anyone else who experienced a KP with the plist file please let me know so i can remove the file.

 

is there a way to install Samba3 without installing Xcode? I am not a developer and I really would like to get it installed without it. Also, in case someone might need, here is one of the ways to enable FTP server on Lion. As you might know, Apple removed GUI option of FTP from Sharing pane.

 

 

XCode is free on the appstore from what i remember once you have Lion installed. Was for me at least. Without XCode you could try to run with the second link on my previous post. It explains how to get macports via a SVN Checkout and manual setup. Might work too, but i can't promise it will. I luckily had XCode installed already.

Link to comment
Share on other sites

I've figured it out how I can run samba3 almost automatically ;)

 

I have created Automator application. Added AppleScript (Actions->Utilities->Run AppleScript), and added just that:

 

do shell script "sudo /opt/local/sbin/smbd -D && sudo /opt/local/sbin/nmbd -D" with administrator privileges

 

Then I saved this as an application and added it to my login items (System Preferences->Users&Groups->Login Items).

 

It now runs automatically on login, it just asks for your admin password.

Link to comment
Share on other sites

Don't need to install samba

 

Create a file rc.local in /etc/rc.local

add permission 755 to file rc.local ==> chmod 755 /etc/rc.local

add this content to rc.local Archiving

 

#######################

sleep 20

launchctl unload -w /System/Library/LaunchDaemons/com.apple.smb.preferences.plist

sleep 05

launchctl load -w /System/Library/LaunchDaemons/com.apple.smb.preferences.plist

#######################

 

 

Excuse my English I'm using a translator

Link to comment
Share on other sites

  • 2 weeks later...
Don't need to install samba

 

Create a file rc.local in /etc/rc.local

add permission 755 to file rc.local ==> chmod 755 /etc/rc.local

add this content to rc.local Archiving

 

#######################

sleep 20

launchctl unload -w /System/Library/LaunchDaemons/com.apple.smb.preferences.plist

sleep 05

launchctl load -w /System/Library/LaunchDaemons/com.apple.smb.preferences.plist

#######################

 

 

Excuse my English I'm using a translator

 

From what i can see all you basically do is kill the samba version Apple supplied with Lion. While that may work for some it WILL give you problems on windows boxes trying to write or read certain bits. It most certainly did for me anyway.

 

Installing Samba like i described above does not rely on Apple's lacking implementation of their own SMB daemon and installs a genuine Samba daemon that behaves the way we expect it to.

 

As for the Automator suggestion, i discovered that as well when trying to make it easier to launch SickBeard. Basically what you do is open Automator, select Application, find Utilities on the left pane, then "Run Shell Script" on the second (middle) pane, set the Shell dropdown to "/bin/bash" and the Pass Input dropdown to "as Arguments". After that you clean out the script example (completely) and replace it with the commands we used above to start the smb daemon. As a script i simple entered:

sudo /opt/local/sbin/smbd -D password mypasswordgoeshere && sudo /opt/local/sbin/nmbd -D password mypasswordgoeshere

 

After that all you have to do is make it run on login as Unequipp mentioned.

Link to comment
Share on other sites

Yeah, Apple's new implementation of Samba gave me problems with Dune HD Player - it just didn't want to connect. Installation of samba3 solved this problem.

 

Even the update to 10.7.2 from 10.7 didn't touch samba3.

 

C.44,

I tried to follow your latter advice about Automator. Adding

sudo /opt/local/sbin/smbd -D password mypasswordgoeshere && sudo /opt/local/sbin/nmbd -D password mypasswordgoeshere

gave me an error in Automator:

sudo no tty present and no askpass program

I don't know why.

 

But I replaced AppleScript

do shell script "sudo /opt/local/sbin/smbd -D && sudo /opt/local/sbin/nmbd -D" with administrator privileges

which I described in Post #9 with

 

do shell script "sudo /opt/local/sbin/smbd -D && sudo /opt/local/sbin/nmbd -D" password "yourpassgoeshere" with administrator privileges

and it worked fine.

 

The only drawback of this solution is text configuration of samba. But using Textmate or TextWrangler it is not a big problem.

Link to comment
Share on other sites

Thanks for all of your help guys. I do have it working now, but annoyingly I can only connect to samba by keying the IP address in windows explorer (win7-x64). I can't see the computer name in network, and if I try keying the computer name into explorer it just spits back an error that the computer can't be found. I have made the necessary changes in smb.conf (server string = DESKTOP-PC), and both computer are on the same workgroup. Are you guys seeing the computer showing up under network in explorer? Any help?

 

Thanks again...

Link to comment
Share on other sites

  • 3 months later...
  • 4 months later...

is there a way to install Samba3 without installing Xcode? I am not a developer and I really would like to get it installed without it. Also, in case someone might need, here is one of the ways to enable FTP server on Lion. As you might know, Apple removed GUI option of FTP from Sharing pane.

 

I hope this doesn't sound like spamming, but I have made a tool just for this called "SMBUp". It installs samba (macports' version) and provides a basic front-end for creating and managing shares.

 

I found this thread looking for problems with Samba and Lion because, sadly, I am not able to install a newer version than 3.2.15 of Samba without hitting problems. Macports has updated the samba version without fixing a basic problem that exists in Lion where newer versions crash, HARD, if a user has more than 16 groups assigned to his/her user. Sadly in Lion it's pretty easy to be in this situation.

 

Both workarounds existing on the web are useless (one tries to fix the issue by polling groups properly but doesn't work in Lion, the other "cheats" by adding more groups to the variable but this doesn't remove the problem, only postpones it). So I periodically look around for people facing problems with Samba with hopes that these get fixed (I don't have the technical chops to do it myself, as trying to wade into the Samba code has been known to drive much saner minds than mine quivering piles of mumbling flesh ;) ).

 

When I see threads that point to Macports I tend to peddle SMBUp but not for the front-end itself (it's donationware and most people don't donate, so I'm not really in it for the money) but because it installs Samba bypassing all needs for Macports.

Link to comment
Share on other sites

 Share

×
×
  • Create New...