Samba 4 is a good bit of software. If only that last few tweaks could be done to finish it and the documentation off it would be great software. I have found lot of ways to set up Samba4 as a AD DC most of which fail to work only this one series of steps worked. Samba4 configuration is really really flaky! The official Samba documentation is getting better and beginning to cover some of the configuration pitfalls.
For this how to we are building on some of my other howtos.
In this part we will connect a Linux machine to the domain and then login with users configured with Active Directory. Therefore domain users will always have the same UID and GIDs regardless of the machine they log into.
Updated for Ubuntu 14.04-3 LTS. If you are a home user and your network has grown such that you are tired of using all static IP addresses and having to configure the /etc/hosts files by hand, then use the great tool dnsmasq. See my How to set up dnsmasq. Dnsmasq is so much simpler to setup and maintain than bind9.
I find the simplest way to install Ubuntu with MATE as the desktop with the minimum I can get away with is to start with the server ISO. Yes, I know there are smaller initial downloads when using the netboot image but that means you need to set up the whole net booting server system. That seems to be over kill and involves a lot more downloading and work. Especially when you are only going to use it once.
The resulting Ubuntu server installation takes about 1.5G of disk space. With MATE it goes to 2.5GB up to 4GB for the full Ubuntu install.