Years ago I set up a share on my Mac’s Media hard drive so that I could share the iTunes files with MythTV. (Note that I did this before MythMusic was ruined – not that it was great before but at least it was usable.) Now, various upgrades later, the CIFS share is no longer visible on MythTV. The share root shows up but nothing shows up inside. Even though MythMusic is no longer pleasant to use, it may be again someday. (Or may already be as of this writing but I haven’t yet updated MythTV to get the improvement). And it does fulfill a purpose occasionally. So I wanted to get it working again.
Recapping, I had previously set up CIFS. I had my auto.master file with the following line at the end:
/cifs /etc/auto.cifs --timeout=60 --ghost
And my auto.cifs file looks like this (the “###” take the place of the actual IP address for posting purposes – not that internal IP addresses matter much but just practicing safe posting):
iTunes -fstype=cifs,rw,guest ://192.168.###.###/iTunes
Somewhere in my digging, I came across the suggestion that I should get the full details of the problem by looking in the syslog file. Here’s my command with a tail so that I wouldn’t be filling up the screen with all of the past failures:
grep cifs /var/log/syslog | tail
Then here’s the error command I was getting:
cifs_mount failed w/return code = -22
I eventually found a very useful post at Stack Overflow that had a number of useful tips. The first point is that “-22” is somewhat of a generic error. But deeper in there, somebody posted that they discovered an issue with MacOS specifically. Ah-ha. That commenter said I’d need to add these parameters: nounix,sec=ntlmssp
. So I tried that and my log entry changed to a -22 to a -13. Well, I think that’s progress.
I modified it again to remove guest and add in username and password and that worked. Okay, so we know we can connect now. Great news. But not only do I not want to store my password in the file, I also don’t want to need to use my user to connect. So I checked the Mac and confirmed that the guest account is active and is able to be used to connect via share. (You can see that in the Users and Groups control panel on the Mac Settings.)
I wasn’t smart enough to figure out how to undo the successful login to go back to testing the guest so I had to reboot.
Now, rebooted, and back to the guest failure, I decided to try actually specifying the username=guest instead of using guest as a keyword. And that worked! No password needed for username=guest. Therefore, my working line from auto.cifs is:
iTunes -fstype=cifs,nounix,sec=ntlmssp,username=guest ://192.168.###.###/iTunes