Network Configuration Prerequisites
The most common reason for connection failures in this scenario is misconfigured networking within VirtualBox. By default, many virtual machines use NAT (Network Address Translation), which isolates them from other VMs on the host machine. To allow the Domain VM to see and communicate with the Windows Server 2019, they must share a common network segment.
You need to adjust the network adapter settings for both the client VM and the server VM. Navigate to the settings of each virtual machine and select the Network tab. Change the Attached to dropdown menu from NAT to either Internal Network or Host-only Adapter. If you choose Internal Network, create a new network name, such as internal-net, and ensure both VMs use this exact name. This ensures they are on the same logical switch inside the hypervisor.
If you prefer using a Host-only Adapter, verify that the VirtualBox Host-only Ethernet Adapter is enabled in your host operating system’s network settings. Assign static IP addresses manually to both VMs if DHCP is not functioning correctly between them. For example, set the server to 192.168.56.10 and the client to 192.168.56.11 with a subnet mask of 255.255.255.0.
DNS and Name Resolution Setup
Active Directory relies heavily on DNS for locating domain controllers. Even if the network cables are virtually connected, the Domain VM will fail to find the server if it cannot resolve its name. You must configure the DNS settings on the Domain VM to point directly to the IP address of the Windows Server 2019.
On the Domain VM, open the network connections panel and locate the active Ethernet adapter. Right-click and select Properties, then double-click on Internet Protocol Version 4 (TCP/IPv4). In the Preferred DNS server field, enter the static IP address of your Windows Server 2019. Leave the Alternate DNS server blank unless you have a secondary controller.
On the Windows Server side, ensure that the DNS Server role is installed and running. The server should automatically create a forward lookup zone for your domain (e.g., example.local). Verify that the A record for the domain controller exists in this zone. If the records are missing, you may need to restart the DNS service or flush the cache on the client side using the ipconfig /flushdns command.
Firewall and Service Verification
Windows Server 2019 includes a robust firewall that can block incoming requests from other machines by default. Before attempting to join the domain, you must ensure that necessary ports are open. Key services like LDAP (port 389), Kerberos (port 88), and RPC (dynamic ports) must be accessible.
Check the Windows Firewall status on the server. It is often easiest to temporarily disable the firewall during the initial setup to rule out blocking issues, though this is not recommended for production environments. Alternatively, create inbound rules specifically allowing traffic from the client VM’s IP range. Ensure that file and printer sharing is enabled for Private networks on the server, as some discovery protocols rely on SMB traffic.
Verify that the Active Directory Domain Services are fully initialized. Open Server Manager and confirm that the AD DS role is healthy. Run dcdiag in the command prompt to check for any replication or connectivity errors within the domain structure itself.
Joining the Domain
Once networking, DNS, and firewalls are correctly configured, you can proceed to join the Domain VM to the domain. On the client machine, go to System Properties and select Change Settings under the Computer Name tab. Click Change and select Domain instead of Workgroup. Enter the full domain name exactly as it appears in the Active Directory Users and Computers console.
You will be prompted for credentials. Use an account that has permission to join computers to the domain, typically the Administrator account or a dedicated enterprise admin. If successful, you will receive a welcome message confirming that you have joined the domain. Restart the Domain VM immediately after joining.
If you encounter errors such as "The specified domain either does not exist or could not be contacted," revisit the DNS configuration. Most join failures stem from the client pointing to the wrong DNS server or the DNS server not having the correct SRV records for the domain controller. For more detailed installation guidance, you might also want to review Windows Server Installation with VirtualBox to ensure the base image was configured correctly.
Troubleshooting Common Errors
When the join process fails, specific error codes can guide your diagnosis. Error 1355 usually indicates a DNS resolution issue where the client cannot find the domain controller. Error 5719 suggests that the computer account password is out of sync, which can happen if the server was restored from a snapshot incorrectly.
Always ensure that the time synchronization between the client and server is accurate. Kerberos authentication requires time differences to be less than five minutes. If the times are skewed, enable NTP synchronization on the client to point to the server’s time source.
Frequently Asked Questions
Why can't my Domain VM ping the Windows Server?
This is almost always due to network adapter configuration mismatches. Ensure both VMs are attached to the same Internal Network name or Host-only Adapter in VirtualBox settings. Check that their IP addresses are in the same subnet and that no host-level firewall is blocking ICMP traffic.
What is the difference between Internal Network and NAT Private Pool?
An Internal Network creates a closed switch visible only to VMs assigned to it, ideal for isolated lab environments. NAT Private Pool allows VMs to talk to each other but also provides outbound internet access via the host. For domain joins, Internal Network is preferred to prevent accidental exposure to the outside world.
How do I fix error 1355 when joining the domain?
Error 1355 means the domain could not be contacted, which points to a DNS failure. Verify that the client’s primary DNS server is set to the Windows Server’s IP address. Also, ensure the DNS Server role on the host is running and has created the necessary SRV records for the domain.
Can I use a Host-only Adapter instead of Internal Network?
Yes, a Host-only Adapter works well for this purpose. It creates a private network between the host and the VMs. Just ensure that the Windows Server’s firewall allows traffic from the host-only subnet, as some security policies restrict access from host interfaces by default.
Do I need to install any additional drivers on the VMs?
While not strictly required for basic networking, installing VirtualBox Guest Additions improves performance and enables features like shared folders. However, the standard Microsoft-provided network drivers included in Windows Server and Client OS versions are sufficient for establishing a domain connection.