Tuesday, January 29, 2013

Hyper V virtual machine based Active Directory Domain

Bottomline:  Cannot run an Active Directory Domain on 169.254.x.x. address range!

I was recently trying to build a self-contained enterprise Windows environment on a powerful laptop to so I can take it with me for demo and work on the road.  I decided that it'd be a Windows 2012 Hyper V build with a VM as the Active Directory Domain Controller.  The host and additional VMs would join this domain.  So I installed Windows 2012 as the host on the laptop, and went on to create the first Windows 2012 VM as the Domain Controller.  Because I wanted the entire envrionment to be self-contained, I create a Hyper V Internal Virtual Network.  In both the DC VM and the host, I set the IP as static 169.254.1.x.  Installed ADDS and DNS, and Dcpromo'd the VM wihtout any problem.  From there, nothing worked. When I tried to join the host to the domain, I kept getting "The specified domain either does not exist or could not be contacted", and dcdiag.exe on the domain controller VM resulted in ._mstsc. could not be resolved to an IP address.  I noticed that the domain controller's own A record was missing but a manually added one kept getting deleted.  There are of course tons of information out there regarding these problems.  None worked for me.

After about one week of re-do ADDS, DNS, and dcpromo a dozen times, it finally hit me.  There was nothing wrong with DNS, which is usually the cause for all these problems.  The root problem, was in the IP addresses I used.  Since Hyper V automatically assigned the 169.254.x.x addresses in Internal Virtual Network, I did not used them.  This was the BIG mistaken.  169.254.x.x is special.  How special?  there are plenty of information out there about how special they are.  The point it, an AD domain cannot run properly on this because DNS gets completely confused.  The direct problem is that DNS cannot register the domain controller's own A record.  As soon as I changed the static IP of the domain controller and the host to 192.168.1.x, joining the domain immediately worked!