Hyper-V on Windows Server: Creating and Managing Virtual Machines

Hyper-V is Microsoft’s native hypervisor, included with Windows Server as a role that turns a physical server into a platform for running multiple virtual machines. It is the same technology that powers Microsoft Azure’s infrastructure, and it is available at no extra cost on any Windows Server license. This guide covers the practical steps to install Hyper-V, create a virtual machine, configure networking and storage, and manage VMs efficiently — all without third-party tools.

Hardware Requirements for Hyper-V

Before enabling Hyper-V, verify that your server hardware meets the requirements:

  • A 64-bit processor with second-level address translation (SLAT)
  • VM Monitor Mode extensions (Intel VT-x or AMD-V)
  • Minimum 4 GB of RAM (8 GB or more recommended for production workloads)
  • Virtualization technology enabled in the BIOS/UEFI

You can check these conditions with a single PowerShell command: Get-ComputerInfo -Property "HyperV*". If the output shows HyperVRequirementVirtualizationFirmwareEnabled : True, you are ready to proceed.

Installing the Hyper-V Role

Install Hyper-V using PowerShell for the fastest path:

Install-WindowsFeature -Name Hyper-V -IncludeManagementTools -Restart

The server will reboot once. After the restart, Hyper-V Manager is available under Administrative Tools or via virtmgmt.msc. For Server Core editions, use Get-VM and other Hyper-V PowerShell cmdlets to manage VMs from the command line.

Creating a Virtual Switch

Before a VM can communicate on the network, it needs a virtual switch. Hyper-V offers three types:

  • External: Binds to a physical NIC, allowing VMs to access the physical network. This is the standard choice for production VMs that need internet access.
  • Internal: Allows communication between VMs and the host, but not the physical network.
  • Private: Only allows communication between VMs on the same host.

Create an external switch via PowerShell:

New-VMSwitch -Name "ExternalSwitch" -NetAdapterName "Ethernet0" -AllowManagementOS $true

The -AllowManagementOS $true flag ensures the host retains its own network connectivity through the same physical NIC.

Creating a Virtual Machine

With the switch in place, create a VM with the following PowerShell command:

New-VM -Name "WebServer01" -MemoryStartupBytes 4GB -BootDevice VHD -VHDPath "D:\VMs\WebServer01\Virtual Hard Disks\WebServer01.vhdx" -Generation 2 -SwitchName "ExternalSwitch"

Generation 2 VMs support UEFI boot, Secure Boot, and larger disk sizes. They are the recommended choice for all modern Windows Server guest operating systems. After creating the VM, mount an ISO to install the OS:

Set-VMDvdDrive -VMName "WebServer01" -Path "D:\ISOs\WindowsServer2025.iso"
Start-VM -Name "WebServer01"

Connect to the VM console via VMConnect (Hyper-V Manager) or the Connect-VM cmdlet to complete the OS installation.

Storage Configuration and Checkpoints

Hyper-V supports two virtual disk formats: VHD (up to 2 TB) and VHDX (up to 64 TB, with 4 KB sector support and better crash resilience). VHDX is the recommended format for production use. You can create fixed-size disks for performance-critical workloads or dynamically expanding disks for flexibility.

Checkpoints (formerly snapshots) let you revert a VM to a known state. Use production checkpoints with Hyper-V’s Volume Shadow Copy Service (VSS) integration for consistent backups:

Checkpoint-VM -Name "WebServer01" -SnapshotName "BeforeUpdate"

Be aware that each checkpoint creates an AVHDX differencing disk. Prolonged use of checkpoints without merging degrades performance. Use them for quick rollbacks before patches, then merge or delete them once confirmed stable.

Resource Management and Dynamic Memory

Dynamic Memory allows Hyper-V to allocate RAM to VMs on demand, improving overall host utilization. Configure it with a startup amount, a minimum, and a maximum:

Set-VMMemory -VMName "WebServer01" -StartupBytes 2GB -MinimumBytes 1GB -MaximumBytes 8GB -DynamicMemoryEnabled $true

For CPU, use Set-VMProcessor to assign virtual cores. A general rule is to assign one virtual core per physical core, then monitor performance and adjust. Over-committing CPU (more virtual cores than physical cores) is acceptable for bursty workloads, but avoid over-committing memory on production hosts.

Managing VMs Remotely

Hyper-V supports remote management via PowerShell remoting (WinRM) and Hyper-V Manager over the network. Enable the firewall rules on the host:

New-NetFirewallRule -DisplayName "Hyper-V Management" -Direction Inbound -Protocol TCP -LocalPort 5985,5986 -Action Allow

Then connect from a remote machine using Enter-PSSession -ComputerName HostServer and run Hyper-V cmdlets. For a centralized management experience across multiple hosts, consider Windows Admin Center, which provides a browser-based dashboard for Hyper-V, failover clustering, and storage.

Summary

Hyper-V turns a single Windows Server into a powerful virtualization platform capable of running multiple isolated workloads. Creating VMs, configuring virtual switches, managing storage, and controlling resources are all manageable through PowerShell or Hyper-V Manager. For organizations that need to maximize hardware utilization while maintaining isolation between workloads, Hyper-V is a cost-effective, built-in solution. If you are evaluating Windows VPS hosting options instead of running your own Hyper-V server, compare Windows VPS plans on our comparison table to see which provider fits your workload requirements.

Leave a Comment