After setting up the samba make sure you add root
smbpasswd -a root
If you get the above error try this:
smbpasswd -a -m $machinename
(the machine you are trying to join to the domain)
you might get the error the group ‘machines does not exist.
try again now you should be able to add the machine name and join the doamin.
Look at the /var/log/samba/log.machinename for more details of the errors you get.