Setting Up Hyper-V on Windows: Virtual Networking and VM Deployment Guide

Hyper-V is Microsoft’s native Type-1 hypervisor built directly into Windows. Whether you are building a local dev environment, testing new operating systems, or setting up dedicated homelab services, Hyper-V offers bare-metal virtualization performance without needing third-party hypervisors like VMware Workstation or VirtualBox.

This comprehensive guide covers how to enable Hyper-V on Windows, configure virtual switches for networking, and deploy both Windows and Linux virtual machines.

Prerequisites & System Requirements

Before enabling Hyper-V, verify that your host system meets the following requirements:

  1. Windows Edition: Windows 10/11 Pro, Enterprise, or Education (Windows Home does not support the native Hyper-V hypervisor role).
  2. Hardware Virtualization: Intel VT-x or AMD-V / SVM mode must be enabled in your computer’s BIOS/UEFI settings.
  3. CPU Support: 64-bit processor with Second Level Address Translation (SLAT).
  4. Memory: Minimum 4 GB RAM (8 GB to 16 GB+ strongly recommended).

Verification

To check if your system is ready, open Command Prompt and run:

DOS

systeminfo

At the bottom of the output, under Hyper-V Requirements, ensure all parameters display Yes.

Step 1: Enabling Hyper-V on Windows

Hyper-V can be enabled using either the Windows Graphical Interface (GUI) or PowerShell.

Option A: Via Windows Features (GUI)

  1. Press Win + R, type optionalfeatures, and press Enter.
  2. Scroll down to find Hyper-V.
  3. Check the box for Hyper-V (ensuring both Hyper-V Management Tools and Hyper-V Platform are selected).
  4. Click OK, wait for Windows to apply the changes, and click Restart now.

Option B: Via PowerShell (Fastest)

  1. Right-click the Start menu and select PowerShell (Admin) or Terminal (Admin).
  2. Run the following command:PowerShellEnable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
  3. Type Y when prompted to restart your computer.

Step 2: Setting Up Virtual Switches (Networking)

Hyper-V uses Virtual Switches to connect Virtual Machines (VMs) to networks. To manage or create virtual switches, launch Hyper-V Manager from your Start Menu and open Virtual Switch Manager from the right-hand Actions pane.

Understanding Virtual Switch Types

Switch TypeHost AccessLAN / Internet AccessOther VMs AccessTypical Use Case
ExternalYesYesYesVMs that need Internet and home network IP addresses (DHCP from router).
InternalYesNoYesPrivate testing labs where the host needs to communicate with VMs, but VMs are isolated from the router.
PrivateNoNoYesStrictly isolated sandbox labs where VMs only speak to each other (no host access).

How to Create an External Virtual Switch

To give your virtual machines access to the local network and the internet:

  1. In Hyper-V Manager, click Virtual Switch Manager… in the Actions panel.
  2. Select New virtual network switch on the left.
  3. Choose External and click Create Virtual Switch.
  4. Name the switch (e.g., External-Bridge).
  5. Under Connection type, select your physical network adapter (Ethernet or Wi-Fi).
  6. Ensure “Allow operating system to share this network adapter” is checked so your host computer retains internet access.
  7. Click Apply and OK.

Note: Your host network connection may briefly drop for a few seconds while the virtual bridge adapter is initialized.

Step 3: Creating & Installing a Windows Virtual Machine

Step 3.1: VM Creation Wizard

  1. In Hyper-V Manager, click New > Virtual Machine…
  2. Name and Location: Enter a name (e.g., Windows11-Lab) and optionally specify a storage path on your fast SSD/NVMe drive.
  3. Specify Generation: Select Generation 2 (Required for modern 64-bit OSs, UEFI, and Secure Boot).
  4. Assign Memory: Set Startup RAM to 4096 MB (4 GB). Check Use Dynamic Memory for this virtual machine.
  5. Configure Networking: Select your newly created External-Bridge switch.
  6. Connect Virtual Hard Disk: Select Create a virtual hard disk, set a name, and allocate a size (e.g., 64 GB dynamically expanding VHDX).
  7. Installation Options: Select Install an operating system from a bootable image file and browse to your downloaded Windows ISO file.
  8. Click Finish.

Once the virtual machine is created, you can adjust resources as needed.

Step 3.2: Enable TPM & Launch

If installing Windows 11, Trusted Platform Module (TPM) is required:

  1. Right-click the newly created VM and open Settings.
  2. Go to Security on the left menu.
  3. Check Enable Security Shield and Enable Trusted Platform Module.
  4. Click OK.
  5. Right-click the VM, click Connect, then click Start (Green power button).
  6. Press any key quickly when prompted to boot from CD/DVD and complete standard Windows setup.

Step 4: Creating & Installing a Linux Virtual Machine (Ubuntu)

Setting up Linux in Hyper-V is straightfoward, but requires a tweak to Secure Boot settings when using Generation 2 VMs.

Step 4.1: VM Setup

  1. Open New > Virtual Machine… in Hyper-V Manager.
  2. Name the VM (e.g., Ubuntu-24.04-Server).
  3. Select Generation 2.
  4. Allocate 2048 MB or 4096 MB RAM with Dynamic Memory enabled.
  5. Select External-Bridge under Network Connections.
  6. Create a VHDX virtual hard disk (e.g., 25 GB to 40 GB).
  7. Attach your downloaded Linux ISO (e.g., Ubuntu Desktop or Server ISO).

Step 4.2: Critical Security Setting for Linux

Before starting the VM:

  1. Open VM Settings… > Security.
  2. Under Secure Boot, either:
    • Keep Secure Boot checked, but change the Template dropdown from Microsoft Windows to Microsoft UEFI Certificate Authority.
    • Or, uncheck Enable Secure Boot entirely if your specific Linux distro lacks signed bootloaders.
  3. Under Processor, increase Virtual processors to at least 2 Cores.
  4. Click Apply and OK.

Step 4.3: OS Installation

  1. Click Connect and Start the virtual machine.
  2. Choose Try or Install Ubuntu from the GRUB menu.
  3. Follow the installation wizard prompts for language, storage partitioning, username, and password.
  4. Reboot the VM upon completion and unmount the ISO from the Virtual CD Drive under the Media menu top-bar.

Hyper-V Optimization & Best Practices

  1. Enhanced Session Mode: Ensure Enhanced Session Mode is enabled in Hyper-V Settings to enable clipboard sharing, drive redirection, and dynamic screen resizing for Windows VMs.
  2. Dynamic Memory Tuning: For production services or home lab nodes, set a fixed RAM minimum/maximum range in VM Settings to prevent one active VM from exhausting the physical host’s memory pool.
  3. Exclude VHDX Folders from Antivirus: Add your Hyper-V storage directory (where .vhdx files reside) to host Real-Time Antivirus exclusions to avoid continuous I/O overhead and performance degradation during disk reads/writes.