# Install Hyper-V on Windows Server 2025: Switches and First VM

Source: https://srvscripts.com/guides/install-hyper-v-windows-server-2025/
Updated: 2026-10-06
Publisher: srvScripts (https://srvscripts.com/)

**Short answer:** On Windows Server 2025, install Hyper-V with `Install-WindowsFeature -Name Hyper-V -IncludeManagementTools -Restart` (or Add Roles and Features in Server Manager), then create an external virtual switch with `New-VMSwitch`, set default VM and disk folders with `Set-VMHost`, and build your first generation 2 VM with `New-VM`. The host needs a 64-bit CPU with SLAT, virtualization and DEP turned on in firmware, and enough RAM for the host plus every VM you plan to run at once.

Commands checked against the official documentation (linked below) on 6 October 2026; not yet run on our lab servers.

## Check the hardware before you install

Hyper-V needs more than the general Windows Server minimums. Microsoft lists these as hard requirements for running the hypervisor:

- A 64-bit processor with second-level address translation (SLAT): Intel EPT or AMD RVI/NPT.

- VM Monitor Mode extensions and hardware virtualization (Intel VT or AMD-V) turned on in BIOS/UEFI.

- Hardware-enforced Data Execution Prevention turned on (Intel XD bit, AMD NX bit).

- At least 4 GB of RAM, but in practice plan for the host plus the sum of all VMs that run at the same time.

The quickest check on a server that does not yet run Hyper-V is `systeminfo`. Scroll to the Hyper-V Requirements section: every line should say `Yes`. If you see `A hypervisor has been detected. Features required for Hyper-V will not be displayed.`, a hypervisor is already running (Hyper-V itself, or the box is already a VM).

```
systeminfo.exe | Select-String -Pattern "Hyper-V" -Context 0,5
```

If you plan to run Hyper-V inside another hypervisor (nested virtualization for a lab), the outer hypervisor must expose virtualization extensions to the VM. On a Hyper-V parent that is `Set-VMProcessor -VMName <name> -ExposeVirtualizationExtensions $true`, run while the VM is off.

## Install the Hyper-V role with PowerShell

Open PowerShell as Administrator. On the server itself:

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

To install on a remote server, add `-ComputerName`:

```
Install-WindowsFeature -Name Hyper-V -ComputerName HV01 -IncludeManagementTools -Restart
```

The server reboots once the role is in. On Server Core, `-IncludeManagementTools` installs only the Hyper-V PowerShell module; manage the host with Hyper-V Manager from a Windows 11 admin workstation (see [Install RSAT on Windows 11](/guides/install-rsat-on-windows-11/)) or from Windows Admin Center.

After the reboot, confirm the role state:

```
Get-WindowsFeature -Name Hyper-V*
```

### Install with Server Manager instead

- Server Manager > **Manage** > **Add Roles and Features**.

- Choose **Role-based or feature-based installation** and pick the target server.

- Tick **Hyper-V** and accept **Add Features** for the management tools.

- On the **Create Virtual Switches** page you can create an external switch now, but we prefer to skip it and create switches with PowerShell afterwards so the adapter choice is explicit.

- On **Virtual Machine Migration** leave live migration off unless this host is joining a migration pair; on **Default Stores** point to your VM data volume (not C:).

- Tick **Restart the destination server automatically if required** and click **Install**.

Running VMware Workstation or VirtualBox on the same machine as Hyper-V is a desktop scenario, not a server one. Once the Hyper-V hypervisor is running, those products may fail to start VMs or run them unreliably.

## Set default storage paths and plan the disk layout

By default Hyper-V puts VM configuration under `C:\ProgramData\Microsoft\Windows\Hyper-V\Virtual Machines` and disks (including checkpoint AVHDX files) under `C:\ProgramData\Microsoft\Windows\Hyper-V\Virtual Hard Disks`. Change that before you create anything, so the OS volume never fills with VHDX growth:

```
# Example: a dedicated data volume D:
New-Item -ItemType Directory -Path 'D:\Hyper-V\Virtual Hard Disks' -Force | Out-Null
Set-VMHost -VirtualMachinePath 'D:\Hyper-V' -VirtualHardDiskPath 'D:\Hyper-V\Virtual Hard Disks'
Get-VMHost | Select-Object VirtualMachinePath, VirtualHardDiskPath
```

Storage rules that save trouble later:

- **Use VHDX, not VHD.** VHDX supports disks up to 64 TB and is what generation 2 VMs boot from.

- **Dynamic or fixed.** Dynamically expanding disks save space but can overcommit the volume. Fixed disks allocate everything up front. On a busy SQL or file VM, fixed avoids surprises; on a lab, dynamic is fine. Whatever you choose, monitor free space on the volume, because a full volume pauses running VMs.

- **Leave room for checkpoints.** Every checkpoint and every backup-created checkpoint writes an AVHDX file next to the disk. Merging needs free space too. See [Hyper-V checkpoint merge failed](/guides/hyper-v-checkpoint-merge-failed/) for what happens when it runs out.

- **Antivirus exclusions.** Exclude the VM folders, VHDX/AVHDX files and the Hyper-V processes as Microsoft recommends (linked below). Locked files are a common cause of failed merges.

Create a disk on its own if you want to attach it later:

```
New-VHD -Path 'D:\Hyper-V\Virtual Hard Disks\app01-data.vhdx' -SizeBytes 200GB -Dynamic
```

## Create virtual switches

Hyper-V has three switch types:

| Type | Who can talk | Typical use |
| --- | --- | --- |
| External | VMs, the host (optional) and the physical network | Production VMs that need LAN or internet access |
| Internal | VMs and the host only | Host-only labs, NAT setups |
| Private | VMs on the same switch only | Isolated test networks |

List the physical adapters first and note the exact name of the one you want to bind:

```
Get-NetAdapter | Sort-Object Name | Format-Table Name, InterfaceDescription, Status, LinkSpeed
```

Create an external switch. Passing `-NetAdapterName` makes it external automatically:

```
New-VMSwitch -Name 'External-LAN' -NetAdapterName 'Ethernet 2' -AllowManagementOS $true
```

Binding a switch to the adapter you are connected through drops your session for a few seconds while the host IP moves to the new virtual adapter. On a remote server, use a second NIC for the switch, or run the command from the console or iLO/iDRAC.

Set `-AllowManagementOS $false` if the host has a separate management NIC and you want the switch to carry VM traffic only. Internal and private switches need only a type:

```
New-VMSwitch -Name 'Lab-Internal' -SwitchType Internal
New-VMSwitch -Name 'Lab-Private' -SwitchType Private
```

If VM traffic runs on tagged VLANs, set the VLAN on each VM network adapter (`Set-VMNetworkAdapterVlan -VMName APP01 -Access -VlanId 20`) and make sure the physical switch port is a trunk that carries those VLANs.

## Create your first VM with PowerShell

This builds a generation 2 VM with a new 80 GB disk, 4 GB of startup memory, two vCPUs and the Windows Server ISO attached. Generation 2 is the right choice for any current Windows or Linux guest: it uses UEFI firmware and has Secure Boot on by default.

```
$vm   = 'APP01'
$iso  = 'D:\ISO\WindowsServer2025.iso'
$vhd  = "D:\Hyper-V\Virtual Hard Disks\$vm.vhdx"

New-VM -Name $vm -Generation 2 -MemoryStartupBytes 4GB `
       -NewVHDPath $vhd -NewVHDSizeBytes 80GB -SwitchName 'External-LAN'

Set-VMProcessor -VMName $vm -Count 2
Set-VMMemory    -VMName $vm -DynamicMemoryEnabled $true -MinimumBytes 2GB -MaximumBytes 8GB

# Generation 2 VMs created with New-VM have no DVD drive: add one with the ISO
Add-VMDvdDrive -VMName $vm -Path $iso
Set-VMFirmware -VMName $vm -FirstBootDevice (Get-VMDvdDrive -VMName $vm)

Start-VM -Name $vm
vmconnect.exe localhost $vm
```

Two things to know about this example:

- **Secure Boot template for Linux.** The default template trusts Microsoft Windows only. For a Linux guest, switch to the UEFI CA template before first boot: `Set-VMFirmware -VMName WEB01 -SecureBootTemplate MicrosoftUEFICertificateAuthority`.

- **Configuration version.** New VMs on Server 2025 get configuration version 12.0. Server 2022 hosts support up to 10.0 and Server 2019 up to 9.0. If the VM may need to move back to an older host, create it with `New-VM -Version 10.0` (or lower); check what the host supports with `Get-VMHostSupportedVersion`.

In Hyper-V Manager the same thing is **Action > New > Virtual Machine**: name and location, generation 2, startup memory, switch, new disk, and install from an ISO. You cannot change a VM’s generation after creation.

## NUMA and CPU basics for bigger hosts

A two-socket server has at least two NUMA nodes, each with its own local memory. A VM performs best when its vCPUs and memory fit inside one node. See the host topology with:

```
Get-VMHostNumaNode
```

Practical rules:

- Size large VMs so their memory and vCPU count fit one NUMA node where possible.

- `Set-VMHost -NumaSpanningEnabled` controls whether VMs may use memory from more than one node. With spanning allowed, a large VM can still start when one node is short of memory, at a performance cost. With it off, a VM that cannot fit may fail to start. Check the current value with `Get-VMHost | Select-Object NumaSpanningEnabled` and change it only with a reason.

- Dynamic Memory and NUMA interact: a VM with a high maximum may be placed across nodes. For latency-sensitive workloads (SQL Server, for example) many admins use static memory.

- Do not overcommit vCPUs heavily on hosts running domain controllers, VoIP or databases; CPU wait shows up as jitter and slow logons long before the host looks busy.

## Check that it worked

```
Get-WindowsFeature -Name Hyper-V | Select-Object Name, InstallState
Get-VMHost | Select-Object VirtualMachinePath, VirtualHardDiskPath, NumaSpanningEnabled
Get-VMSwitch | Format-Table Name, SwitchType, NetAdapterInterfaceDescription, AllowManagementOS
Get-VM | Format-Table Name, State, Generation, Version, Status
Get-VMNetworkAdapter -VMName APP01 | Format-Table VMName, SwitchName, MacAddress, IPAddresses
```

Expected result: the role shows `Installed`, paths point at your data volume, the switch exists with the right adapter, and the VM is `Running` with status `Operating normally`. IP addresses appear on the adapter once the guest OS is installed and its integration services are running.

## Common problems

- **The role install is blocked with a processor or virtualization capability error.** Virtualization or DEP is off in firmware, or the server is itself a VM without nested virtualization exposed. Re-run `systeminfo` and fix whichever requirement says `No`.

- **Host loses network when the switch is created.** You bound the external switch to the management NIC. The host IP now lives on the vEthernet (External-LAN) adapter; check it with `Get-NetIPAddress`.

- **Generation 2 VM will not boot from the ISO or reports a Secure Boot failure.** Usually a missing DVD drive, wrong boot order, or the Windows-only Secure Boot template on a Linux ISO. Fix the boot order with `Set-VMFirmware -FirstBootDevice` and the template as shown above.

- **Live migration fails after upgrading hosts to Server 2025.** Credential Guard is on by default on domain-joined Server 2025 machines that are not DCs, which breaks CredSSP-based live migration. Switch to Kerberos with constrained delegation; the steps are in [Hyper-V export, import and move VMs](/guides/hyper-v-export-import-vm/).

**Official documentation:** [Install Hyper-V on Windows Server](https://learn.microsoft.com/en-us/windows-server/virtualization/hyper-v/get-started/install-hyper-v) · [Create a virtual switch](https://learn.microsoft.com/en-us/windows-server/virtualization/hyper-v/get-started/create-a-virtual-switch-for-hyper-v-virtual-machines) · [System requirements for Hyper-V](https://learn.microsoft.com/en-us/windows-server/virtualization/hyper-v/system-requirements-for-hyper-v-on-windows) · [Supported VM configuration versions](https://learn.microsoft.com/en-us/windows-server/virtualization/hyper-v/deploy/upgrade-virtual-machine-version-in-hyper-v-on-windows-or-windows-server)

**Related:** [Install Proxmox VE 9: Step-by-Step Setup on Bare Metal](/guides/install-proxmox-ve-9/) · [Install VMware ESXi 9: Complete Step-by-Step Setup Guide](/guides/install-vmware-esxi-9/) · [Proxmox vs ESXi 9 for Hosting Providers: Best Choice in 2026](/guides/proxmox-vs-esxi-9-hosting/) · [Convert Evaluation Edition to Full Windows Server: DISM Steps for 2025](/guides/windows-server-convert-evaluation-edition/) · [RAID Calculator](/tools/raid-calculator/)

**See also:** [Hyper-V Checkpoint Merge Failed: Fix Stuck AVHDX Chains Safely](/guides/hyper-v-checkpoint-merge-failed/) · [Hyper-V Export and Import VM: Move VMs with PowerShell](/guides/hyper-v-export-import-vm/)

## Frequently asked questions

### Is Hyper-V free on Windows Server 2025?

The role is included with Windows Server. Guest licensing depends on edition: per Microsoft licensing guidance, Standard licensed by physical cores gives rights to two OSEs (physical or virtual), Datacenter licensed by physical cores gives unlimited OSEs. Check your own agreement before you size a host.

### Should I use generation 1 or generation 2 VMs?

Generation 2 for any modern Windows or Linux guest. Use generation 1 only for an existing disk or OS that cannot boot from UEFI. You cannot change the generation later.

### Can I install Hyper-V on Server Core?

Yes. The same Install-WindowsFeature command works, but only the PowerShell module is installed locally. Manage the host from Hyper-V Manager on another machine or from Windows Admin Center.

### Do I need a separate NIC for the virtual switch?

Not strictly, because AllowManagementOS lets the host share the adapter. A dedicated NIC (or a team) for VM traffic is still the cleaner design and avoids losing your session when the switch is created.

### How much RAM should I leave for the host?

Microsoft does not give one number. Keep a few GB free for the parent partition and its services, and never assign more startup memory to running VMs than the host physically has.
