Connecting with Samba to a Windows Share returns "NT_STATUS_DUPLICATE_NAME"

The NetBIOS name of the windows machine is something different

That's your problem. It's easily fixed by a registry hack on the Windows machine. See http://support.microsoft.com/kb/281308 for the details.

Update

The original support article linked above has disappeared (thanks Microsoft). The new article is SMB file server share access is unsuccessful through DNS CNAME alias.

Joril also points out that a server can have multiple NetBIOS names. This is done by editing the registry key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters\OptionalNames

and adding the extra names.


You're probably getting that error because the Windows machine doesn't understand itself to be identified as what you're connecting to it as. (Using a wrong auth information changes the error because this issue doesn't crop up until later in the connection process.)

Try connecting to it as its IP number, not windows-machine. If that works, it confirms that the name thing is what's going on, and you can resolve it either by making the PDC understand itself to be windows-machine or by just using the IP number.