Verbatim copy from http://www.fixedbyvonnie.com/2015/04/how-to-setup-an-active-directory-domain-controller-in-virtualbox/#.WeXhhWf6Uxl
How to setup an Active Directory domain controller in VirtualBox
Posted on April 20, 2015 by vonnie — 4 Comments
Over the next three days I’m going to show you how to setup Active Directory and join a PC to your new domain but I want you to know this isn’t something you can learn by reading. You need to do it.
You need to sit in front of a real Windows Server 2012 machine. You need to join a real Windows workstation to the domain. You need to interact with the software.
But how can you realistically do this? Well there are two options; no wait – three options:
You could completely abase yourself by buying your boss’s children Christmas presents so he would be more amenable to letting you setup a lab in the office.
You could cough up a butt load of money to buy real equipment
You could setup a free virtual environment on your computer in a completely isolated network. Then you could install Windows 8.1 and Windows Server 2012 virtual machines and configure a virtual switch to connect both computers.
Are you with me on option 3? I hope so! Let me show you how simple it is to pull this off.
“Simple” and “quick” aren’t synonyms. So although it’s easy to get going it will take a few hours to download all the files and configure your virtual environment.
Let’s get started.
If our virtual Active Directory Domain controller were a big juicy burger we would need a few ingredients to make it:
Windows 8.1 Pro
Windows Server 2012 R2
First, download and install Virtualbox on your host machine. Keep all the defaults. The install should zip by in seconds. This is the bun for our proverbial burger.
Filch Windows 8.1 Pro
Next, we need to obtain a real Windows 8.1 Pro ISO image. You can download the Windows 8.1 Pro media directly from Microsoft. In fact, if you can actually legally download every version of Windows for free. Consider this the lettuce and tomatoes.
Grab Windows Server 2012 R2
You can get the Windows Server 2012 R2 iso directly from the Microsoft Evaluation Center. Just signup and download. This is the 1/4 pound of grass fed organic beef. Without this our Active Directory burger is nothing.
pFSense will be the virtual router that gives us the liberty to connect our internal VirtualBox guest machines to the internet. pFsense is our special sauce.
Completing the above four steps could take several hours because of the sheer size of the Windows ISO files. These files are gargantuan (4GBs per file) so make sure you have ample space on your hard drive before you start the download frenzy.
Once you have all the ISOs on your computer we can setup the virtual machines.
Configuring the Virtual Machines
Setting up Windows 8.1 Pro in VirtualBox is almost identical to setting up Windows 10 in VirtualBox. The only difference is that under the Network tab in your VirtualBox Settings, Adapter 1 must be set to Internal Network. The name should also match for all hosts participating in the same internal network. I recommend the default intnet.
The internal network adapter names must match on your VirtualBox hosts
To setup your virtual machines, click the prickly blueNew button in the Oracle VM VirtualBox Manager and pick your OS version and memory size. Leave the Hard drive defaults alone and click Create.
Windows Server 2012 Virtual Machine
Click Create again on the next screen to keep all the defaults for the file size and physical hard drive type.
VirtualBox setting defaults
After creating the image, select it and choose Settings from the Oracle VM Virtualbox Manager screen.
Pick the Storage tab, and under the Storage Tree you should see a CD icon. We need to browse to the ISO we downloaded earlier so that the Virtual Machine will boot to it just like a real machine would boot to a physical CD.
Adding the ISO to VirtualBox
Now you can go through the installation just like a normal install. Install Windows 8.1 Pro in the same fashion.
After you have both operating systems installed you’re ready to setup pFSense.
Making sense of pFSense in VirtualBox
Getting pfSense to work in VirtualBox is basically the same except for a few differences:
Under Settings > System > Motherboard the Base Memory should be set to 256 MB. As you can see pFsense doesn’t need a lot of memory: 256 MB is sufficient.
pFSense in VirtualBox
Next, under the Network tab under Adapter 1, make sure it’s enabled and attached to your Bridged Adapter. This will be come your WAN (internet facing) interface in pfSense.
Setting the network settings for pFsense in VirtualBox
Then boot up the virtual machine and press Enter on the boot screen
boot up pfSense
Quickly press “i” to dive into the Installer setup.
Enter the pFsense Installer
In the blue Configure Console screen, choose .
Go with the
Quick and easy pfSense
Go ahead and erase the Virtual Disk. There’s obviously nothing on it.
Erase the virtual disk
Choose the Standard Kernel
Use the Standard Kernel
Then once the installation finishes, eject the virtual CD and reboot.
Eject the pFsense ISO
Boot to the main screen and skip the question about setting up VLANs.
Right now, we need to assign our interfaces so press 1.
You’ll be asked to enter the WAN and LAN interface names. Use em0 and em1 respectively. em0 should correspond to your bridged virtualbox interface.
em0 and em1 for pfSense
Great, when this finishes press the number 2 to configure the IP subnet for the LAN.
I used 10.0.0.254 with mask 255.255.255.0 (24 bit mask).
Configuring the adapters in pFsense
There’s no need to enable DHCP or revert to HTTP so just press enter to skip passed those options.
We’re done with our pFSense setup! Leave it running and minimize the virtual machine window.
Setting IP addresses on the Windows guests
Now we’re ready to configure the static IP addresses on our Windows guest machines.
Open up the Network Connection settings in your Windows Server 2012 machine and configure the following settings for your Internet Protocol Version 4 (TCP/IPv4) item:
Windows Server 2012 settings for VirtualBox
The DNS should be 127.0.0.1 since we’re going to use the server itself as the DNS server.
On the Windows 8.1 Pro host, set the network settings as follows:
Windows 8.1 IP Settings
Also notice the DNS server is set to the IP of our Windows 2012 Server: 10.0.0.11.
Now as long as both machines have network adapters set to Internal Network with the same name, you’ll be able to communicate.
Let’s just kick off a ping to verify…
Pinging the domain controller
Tomorrow starts your adventure setting up a Windows Server 2012 Active Directory environment.
You now have everything you need to follow along. You can do this. You will do this. I believe in you.