Setting up a Domain in Hyper-V with External Switches for 3 VMs: One DC, One File Server, One Workstation (Intending to Deploy Ubuntu VM in Future)

Abstract: Resolves Active Directory domain setup in Hyper-V by configuring external switches and static IPs for a DC, file server, and workstation.

Created: 2026-10-22 by

Establishing an Active Directory domain in Hyper-V requires configuring a virtual external switch to bridge VMs with the physical network. You must create the switch, assign static IPs to your Domain Controller and File Server, promote the DC, and use System Properties—not sysprep—to join the workstation. This setup ensures proper DNS resolution and network connectivity for all three initial machines.

Creating the External Virtual Switch

The foundation of your domain infrastructure is a virtual switch that allows your virtual machines to communicate with each other and the outside world. In Hyper-V Manager, navigate to Virtual Switch Manager on the right-hand panel. Select New virtual network switch and choose External. This type of switch binds directly to a physical network adapter on your host machine, enabling NAT or bridged networking depending on your router configuration.

Name the switch something identifiable, such as DomainSwitch. Ensure you check the box labeled Allow management operating system to share this network adapter. This critical step permits the host computer itself to retain internet access while the switch is active. If you do not enable this, your host PC will lose network connectivity until you disable or delete the switch.

Once created, verify the switch appears in the list. You will need to attach this switch to every VM that requires network access, including the future Ubuntu instance. For internal-only communication between VMs without internet access, you would instead create an Internal switch, but for a functional domain environment with updates and external resources, External is required. See Making a Virtual Internal NAT Switch Work for Hyper-V VMs if you later need isolated testing environments.

Configuring the Domain Controller

Deploy your first VM, which will serve as the Domain Controller (DC). Install Windows Server (e.g., 2019 or 2022) and connect it to the DomainSwitch. Before installing any roles, you must configure a static IP address. DHCP can cause issues during the initial promotion process if the lease changes unexpectedly.

Open Network Connections, right-click the Ethernet adapter, and select Properties. Choose Internet Protocol Version 4 (TCP/IPv4) and click Properties. Set a static IP address, such as 192.168.1.10, with a subnet mask of 255.255.255.0. The default gateway should be your physical router’s IP (e.g., 192.168.1.1). Crucially, set the Preferred DNS server to 127.0.0.1 or its own static IP. A domain controller must point to itself for DNS resolution during promotion.

Next, open Server Manager and add the Active Directory Domain Services role. After installation, run the prompt to promote this server to a domain controller. Choose Add a new forest and provide a root domain name, such as localdomain.local. Follow the wizard to completion. Once finished, the server will reboot. Verify that you can ping the loopback address and resolve the domain name.

Setting Up the File Server

Create your second VM for the file server. Connect it to the same DomainSwitch. Install Windows Server or a standard Windows OS version. Like the DC, assign a static IP address, such as 192.168.1.11. Configure the DNS server to point to the Domain Controller’s IP (192.168.1.10). This ensures the file server can locate domain services.

At this stage, the file server is likely still in a workgroup. You cannot fully utilize domain features until it joins the domain. However, you can prepare shared folders now. Create a directory structure, right-click the folder, select Properties, go to the Sharing tab, and configure permissions. Note that full domain-based permissions will only apply after the join operation. For more details on network adapter configurations, refer to Creating Hyper-V Virtual Ethernet Adapter.

Joining the Workstation to the Domain

The third VM represents a client workstation. Install Windows 10 or 11 Pro/Enterprise (Home editions cannot join domains). Assign it a static IP like 192.168.1.12 and set its DNS to the DC (192.168.1.10). To join the domain, do not use sysprep, which is intended for generalizing images before deployment, not for joining existing systems to a domain.

Instead, press Windows Key + R, type sysdm.cpl, and hit Enter. This opens the System Properties dialog. Go to the Computer Name tab and click Change.... Under Member of, select Domain and enter your domain name (e.g., localdomain.local). Click OK.

You will be prompted for credentials; use an account with administrative privileges on the domain controller. Upon successful authentication, you will receive a confirmation message. Restart the workstation. After reboot, you can log in using domain credentials (format: DOMAIN\Username or [email protected]). This completes the core trio of your infrastructure.

Future Ubuntu Deployment

When deploying your Ubuntu VM, connect it to DomainSwitch. While Ubuntu does not natively join Active Directory without additional tools like sssd or , it can participate in the network immediately. Ensure its network settings are configured via Netplan or NetworkManager to obtain an IP via DHCP or a static assignment within the same subnet. It will communicate with the Windows servers for file transfers or SSH access, expanding your lab capabilities.

Frequently Asked Questions

Can I use DHCP for the Domain Controller?

No, you should never assign a static IP to a Domain Controller. While some guides suggest otherwise, best practice dictates that the DC must have a static IP to ensure consistent DNS registration and reliable service availability. DHCP leases can change, causing replication failures and authentication errors across the domain.

Why does my workstation fail to join the domain?

The most common cause is incorrect DNS configuration. The workstation must point to the Domain Controller’s IP as its primary DNS server. If it points to the router or an external DNS provider, it cannot locate the domain controllers. Verify this in the network adapter properties before attempting the join again.

Is sysprep necessary for joining the domain?

No, sysprep is used to generalize a Windows image for cloning or mass deployment. To join an existing running system to a domain, use the System Properties dialog accessed via sysdm.cpl. Using sysprep at this stage would reset the computer name and remove drivers, which is counterproductive for a single join operation.

How do I handle IP conflicts in Hyper-V?

Ensure each VM has a unique static IP address within the same subnet. Avoid assigning IPs that fall within your physical router’s DHCP range to prevent conflicts with other devices on the network. Check your router’s DHCP scope and exclude the static IPs you assign to your VMs.

Can I access the domain from outside the virtual switch?

Yes, because you selected an External switch, your VMs are bridged to the physical network. Any device on the same physical LAN segment can reach the VMs if firewall rules allow it. Ensure Windows Firewall on the DC and File Server permits SMB and LDAP traffic from trusted subnets.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More