This project provides a step-by-step guide to building an Active Directory home lab with Oracle VM VirtualBox.
Make sure to download the files above ahead of time. Open "Media Creation Tool" to create the Win10 ISO file.
- Active Directory
- PowerShell
- CMD
- Open Oracle VirtualBox, click "new" and choose a name for your VM. "DC" was chosen for convenience. Select the location of the ISO-image along with the edition.
- Allocate enough hardware resources to your VM.
- Continue the rest of the installation.
- It’s helpful to enable copy/paste and drag/drop between your computer and the VM. You can do this by going to Settings and then the Advanced tab.
- Configure this DC with two network adapters: one for Internet access and one for the internal network. Additional network adapters can be added in the Network settings.
- Choose your language and time.
- Choose "Windows Server 2019 Evaluation with Desktop Experience".
- Continue, then choose "Custom" installation.
- Choose storage for the installation.
-
Continue the installation process. It may take a while & restart during the process. Be patient and let it finish.
-
Once it's done, setup a password for the Admin account.
-
Logging in requires pressing Ctrl + Alt + Delete. Since this can be difficult in a virtual machine, use the top toolbar: Input → Keyboard → Insert Ctrl + Alt + Delete.
-
To enhance the overall user experience, including improved mouse behavior and display resizing, install the Guest Additions CD via the Devices menu in the upper-left corner of the VM window.
-
Using File Explorer, navigate to This PC and double-click VirtualBox Guest Additions.
- Launch Windows-Additions-amd64 and proceed through the installation wizard, selecting Next for each step. Once done, manually reboot the VM and restart it in VirtualBox.
-
Right click the Start icon, then choose System from the menu.
-
Rename this VM to DC so it's easier to identify.
-
Go to Control Panel → Network and Internet → Network Connections. You should see two NICs (e.g., Ethernet 1, Ethernet 2). Let’s figure out which is for Internet and which is for the internal network.
-
Open Ethernet 1, click Details, and note the IPv4 DNS Server, which displays the router’s IP address. The presence of an IPv4 address and a standard subnet mask (255.255.255.0) indicates that this NIC is used for Internet connectivity.
-
Rename the NIC to "xINTERNET" for easier identification.
-
Rename the second NIC to something like _INTERNAL for easier identification.
-
To configure the Internal NIC, double-click it, select Internet Protocol Version 4 (TCP/IPv4), and assign the specified addresses.
- Depending on the network architecture, IP addresses may vary. For this setup, assign the following to the Internal NIC:
- IP: 172.16.0.1
- Subnet: 255.255.255.0
- Default gateway: (leave blank)
- DNS: 127.0.0.1 (loopback; DC acts as its own DNS and serves connected clients)
- In this step, Active Directory and Domain Services will be installed. Active Directory Domain Services (AD DS) is a Microsoft technology designed to manage users, passwords, and network file access efficiently while maintaining security.
-
Go to the Server Manager
-
Open Add Roles and Features, and choose the server from the list (in this case, the only server is named DC).
- Click the Active Directory Domain Services option.
-
Continue and complete installation.
-
With Active Directory installed, the next step is to create the domain. Click the flag notification, then choose Promote this server to a domain controller.
- Click the add a new forest option and provide your desired domain name.
- Specify a password for Directory Services Restore Mode (DSRM), which will be required for any future restoration of Active Directory.
-
Continue clicking Next until the Install button is displayed, then select Install. The installation may take several minutes, after which the server will restart automatically.
-
After the server restarts, log in and We will create a dedicated administrative account to use instead of the built-in Administrator account.
-
Open the Start menu, navigate to Windows Administrative Tools, and choose Active Directory Users and Computers.
-
Click your domain name → New → Organizational Unit.
- Name the OU something like _ADMINS
- Create a new user under the OU that was just created.
- Provide the First Name, Last Name, and User logon name. Administrative accounts typically follow a special naming convention, such as prefixing the username with “a-”.
- Set a password and continue.
- To assign the user to the Domain Admins group, right-click the account, select Properties, navigate to Member Of, click Add, enter Domain Admins, click Check Names, and confirm by pressing OK.
- After clicking Apply, ensure that the user has been added to the Domain Admins group, then select OK to finish.
- Sign out and Login as the new user.
- The objective of this configuration is to enable clients on the internal virtual network to access the Internet through the Domain Controller (DC).
-
Go to the Server Manager in the start menu.
-
Open Add Roles and Features, proceed through the wizard until the Server Roles page, and then select Remote Access.
- Click Routing
- After the installation finishes, close the window, then select Tools in the top-right corner and open Routing and Remote Access.
- The Routing and Remote Access control panel will open. Right-click the server (DC) and choose Configure and Enable Routing and Remote Access.
- Click Next, then choose Network Address Translation (NAT).
- Choose the public interface (having named your NICs earlier helps) and click Next.
- The configuration is complete. The next step is to configure the DHCP server for the client VM.
- The DC will now distribute IP addresses automatically, enabling the client VM to access the Internet.
- Open Add Roles and Features, proceed through the wizard by clicking Next, and select the DC server. On the Server Roles page, select DHCP Server, click Add Features, then continue with Next and click Install.
-
Once complete, click close.
-
Now navigate to tools and DHCP.
-
To define the IP address range for clients, click IPv4 and choose New Scope.
-
Enter a descriptive name for the scope; using the IP range can make it easier to identify. Then click Next.
- Configure the IP address scope according to the lab diagram. Set the subnet mask length to 24, allowing for 254 available hosts, then click Next.
- Lease duration is how long an IP is assigned to a device. For a lab, it can be anything. In production, it depends on the environment. Set it and click Next.
- Click Configure Options, and proceed by selecting Next.
- Enter the DC’s IP as the router, click Add → Next.
- Ensure that the DC’s IP address appears in the list, then proceed by clicking Next.
- Activate the scope and continue.
- Authorize the DHCP server and refresh the domain to verify proper operation.
- The setup is complete. The next step is to execute the PowerShell script to add roughly 1,000 users to Active Directory.
- This PowerShell Script will add approximately 1k users to Active Directory.
- With Copy/Paste and Drag/Drop enabled, copy the PowerShell script from your computer into the DC VM.
-
Add your name to the names.txt file then save it.
-
Open Start → Windows PowerShell ISE, right-click More, and choose Run as Administrator.
-
Select Open from the top-left menu in PowerShell ISE. Locate the PowerShell script in the folder on the Desktop and open it.
- Run Set-ExecutionPolicy Unrestricted in PowerShell and select Yes to All. This allows scripts to run in our lab environment.
- Go to the folder containing the PowerShell script.
- Navigate to the folder containing the PowerShell script, and execute it by clicking Play on the PowerShell ISE toolbar.
- Complete! Verify the accounts in Server Manager → Active Directory Users and Computers.
- The next step is to create a new virtual machine and configure it to connect to the private network.
- Open Oracle VM VirtualBox, select New, enter CLIENT1 as the VM name, choose the correct version, and click Next to configure the hardware settings.
- After setting up the VM, right-click it, open Settings, navigate to the Network tab, and configure Adapter 1 to use Internal Network rather than the default NAT.
-
Once done, start the VM.
-
Complete the installation and skip the product key.
- Choose Windows 10 Pro then continue.
-
Wait for the installation to finish. Be patient!
-
Set your region and language, then select Continue with limited setup.
-
Provide a username and skip the password during setup.
-
It is recommended to disable all optional settings at this stage.
- With the VM operational, assign it an appropriate name and configure it to join the domain.
-
To rename the computer, right-click Start and select System.
-
Navigate down and select Rename this PC (Advanced).
- Select Change, provide the desired computer name, and configure the system to join the domain.
- Enter username and password.
- The PC has successfully joined the domain! Now, reboot the computer to apply the changes.
Special thanks to Josh Madakor for his excellent AD home lab tutorial on YouTube! Video Here