If you are writing applications or scripts which install volumes or printer shares offered by a Windows Server on a Mac OS X Client, this could be the perfect confusion. It made me nearly crazy because with every combination of the two companies‘ systems things work differently. In fact, the SMB URL has to be adapted to each combination.
Below you find a table with each combination’s URL (directly tested in praxis and not taken from some theoretical manual). Examples are below the table.
Syntax Combination Table
Mac OS X | Windows Server | SMB URL |
---|---|---|
10.4 | 2003 | smb://[<username>:<password>@]<domain>/<hostname>[:<port>]/<sharename> |
10.5 | smb://[<username>:<password>@]<domain>/<hostname>[:<port>]/<sharename> | |
10.6 | smb://[<domain>;][<username>:<password>@]<hostname>[:<port>]/<sharename> | |
10.7 | smb://[<domain>;][<username>:<password>@]<hostname>[:<port>]/<sharename> | |
10.8 | smb://[<domain>;][<username>:<password>@]<hostname>[:<port>]/<sharename> | |
10.4 | 2008 | smb://[<username>:<password>@]<domain>/<hostname>[:<port>]/<sharename> |
10.5 | smb://[<username>:<password>@]<domain>/<hostname>[:<port>]/<sharename> | |
10.6 | smb://[<username>:<password>@]<domain>/<hostname>[:<port>]/<sharename> | |
10.7 | smb://[<domain>;][<username>:<password>@]<hostname>[:<port>]/<sharename> | |
10.8 | smb://[<domain>;][<username>:<password>@]<hostname>[:<port>]/<sharename> |
Values in []-brackets are optional (like the port number); <>-brackets enclose a variable value and have to be replaced with their variable label. Mac OS X 10.8 is not tested, yet. I’ll update the post in a few days when I’ll the possibility to check under Mountain Lion. Update: Mountain Lion settings are tested now and they work.
Examples
smb://mydomain;john.doe:nicepassword@printerhost:139/colorprinter
smb://john.doe:nicepassword@mydomain/printerhost:139/colorprinter
smb://john.doe:nicepassword@printerhost:139/colorprinter
(without domain)
smb://john.doe:nicepassword@printerhost/colorprinter
(without domain and port number)
smb://printerhost/colorprinter
(no domain, user and port number)
6 Kommentare
Hello Mike,
Thx for the nice overview. Are you sure that Os X support SMB? I tried to use an external HDD on my network switch but can’t connect from OS x 10.8 but win 7 works.
So i read that 10.8 doesn’t support smb1 (only a own version of Apples smb2).
Is there any hint i can’t find?
Greetings from germany
Hi,
yes I’m sure that SMB is supported. Surely there are some bugs in Apple’s own implementation (SMBX) compared to SAMBA which they’ve used before. But in general it’s compatible and I’ve experienced no problems so far.
Mostly it’s a problem of addressing correctly; finding the right URL syntax could be tricky. Maybe you could send me what Windows shows as SMB URL and than we can find the right syntax for Mountain Lion.
Greets
Mike
Thank you! This has been a bear to get working reliably again- 10.8 can be quite picky
That’s right. It took me several hours to figure every combination out.
If you do not want to supply your password, or you want to store the link in the Connect To Server window sans your cleartext password, just omit the password, but not the (:) colon. In 10.5/10.6, you could just have username@servername.
smb://username:@servername/sharename
I’ve been connecting using this for some time just using the FQDN instead of declaring the domain as shown above. Lots of options.
If you’re curios about implementation details and want to know the difference between cifs:// and smb://, take a look at Developer SMB documentation.
Nice blog, Mike! (google took me here 😉
Cheers, Jan