On Windows Server 2025 with virtualisation enabled in firmware, add the Hyper-V role and restart. Then create the VM storage folders, configure an external virtual switch from the server console and build a Generation 2 VM with an installation ISO. Start it, connect to its console and verify it boots and has network access. The exact PowerShell commands are shown below.
Before you begin
This guide takes one physical Windows Server 2025 machine, not joined to a domain and not part of a cluster, and ends with a virtual machine (VM) that boots on your network. Everything is done locally in PowerShell, which is quicker to follow than a wizard and easier to repeat. Where the graphical route is worth knowing about, we say so.
- A local administrator account on the server. PowerShell must be opened as administrator or the commands fail.
- A 64-bit processor with second-level address translation (SLAT) and VM Monitor Mode extensions, with Intel VT or AMD-V and hardware-enforced Data Execution Prevention (the XD or NX bit) switched on in the BIOS or UEFI. Microsoft says to plan for at least 4 GB of RAM for the host, and you will want more than that to run a VM beside it.
- An installation ISO for the guest operating system. If you want a Windows Server 2025 guest to practise on, Microsoft offers an evaluation copy through its Evaluation Center.
- A volume with room for VM files. The examples use a D: drive and a 60 GB virtual disk, so swap in your own drive letter and sizes.
Install the Hyper-V role
Hyper-V is a server role, so it is added rather than downloaded. Save anything you have open before you run the installation command, because Windows will restart the host and interrupt access.
If you prefer clicking, Server Manager does the same job: Manage, then Add Roles and Features, choose Role-based or feature-based installation, tick Hyper-V and select Add Features. You can skip the virtual switch page and do it below, and tick the option to restart automatically if required before you select Install. On a Server Core installation, the management-tools option installs only the Hyper-V PowerShell module, so you would manage the host with PowerShell or from Hyper-V Manager on another computer.
- Sign in to the server with a local administrator account. Select Start, type Windows PowerShell, right-click it and choose Run as administrator.
- Optionally check the processor and virtualisation requirements. The Hyper-V Requirements section should show Yes on every line. After the hypervisor is running, a message saying it has been detected appears instead, which is normal.
systeminfo.exe - Install the Hyper-V role and management tools. Windows may take a few minutes to install everything and restart, depending on the host. If you owe someone a reply, now's your window. Carry on once the server is back at the sign-in screen.
Install-WindowsFeature -Name Hyper-V -IncludeManagementTools -Restart - After the server restarts, sign back in and open elevated PowerShell. Confirm that the Hyper-V role reports Installed.
Get-WindowsFeature Hyper-V
Decide where VM files will live
Virtual hard disks grow, and a VM's configuration files sit beside them. Settling the location now stops your first VM ending up wherever the defaults happen to point. This step changes only host settings and creates two empty folders; it does not touch any existing data.
One quirk to know about: Microsoft documents the default VM configuration path as functional for PowerShell VM creation, while the default virtual hard disk path is used as a suggested location by Hyper-V Manager and Windows Admin Center. A new VM created from PowerShell does not automatically honour that suggested disk folder, so the creation command later supplies the virtual disk path explicitly.
- Create a folder for virtual hard disks on a volume with enough space. The example uses D: but you should choose a suitable volume on your server. Creating this folder also creates its parent directory.
New-Item -ItemType Directory -Path "D:\Hyper-V\Virtual Hard Disks" -Force - Set the host defaults for virtual hard disks and VM configuration files. Hyper-V stores VM configurations in a Virtual Machines subfolder of the chosen VM path.
Set-VMHost -VirtualHardDiskPath "D:\Hyper-V\Virtual Hard Disks" -VirtualMachinePath "D:\Hyper-V" - Check that both configured paths point to the folders you chose.
Get-VMHost | Format-List VirtualMachinePath, VirtualHardDiskPath
Create the virtual switch
A virtual switch is the software network connection your VMs plug into. An external switch binds to a physical network adapter so VMs can reach your real network, and with the management operating system option enabled the host keeps using that same adapter as well. Internal and private switches exist, but they do not give a VM a route to your LAN, so they are not what you want here.
Do this step at the server's console, or through a management card such as iDRAC or iLO, rather than over Remote Desktop. Microsoft warns that creating an external switch, or changing its management-OS sharing, may disrupt network connectivity, and a remote session running over the adapter you are rebinding is exactly the thing that can be cut off.
- List the physical network adapters and note the Name of the one connected to your LAN. This is a read-only check.
Get-NetAdapter - Create an external virtual switch using that physical adapter. Replace YOUR_ADAPTER_NAME with the exact Name you noted. The management operating system sharing option lets the host continue to use the same adapter.
New-VMSwitch -Name "External-LAN" -NetAdapterName "YOUR_ADAPTER_NAME" -AllowManagementOS $true - Confirm that External-LAN exists, then test whether the host can reach a device on your LAN. Replace YOUR_LAN_HOST with its IP address or resolvable hostname.
Get-VMSwitchTest-NetConnection -ComputerName YOUR_LAN_HOST - If creating the switch leaves the host disconnected and you cannot repair the settings, remove the new switch from the server console as a last resort. Any VMs attached to it will then lose their network until you configure another switch.
Remove-VMSwitch -Name "External-LAN"
Create and start your first VM
We will create a generation 2 VM, which Microsoft recommends unless you have a specific reason to need generation 1. The new virtual disk is dynamic, so the .vhdx file starts small and grows towards the 60 GB limit as the guest uses it. The 4 GB of startup memory must be free on the host when you start the VM.
The VM will have an empty disk, so we give it a virtual DVD drive with your ISO in it and tell the firmware to boot from that first. Installing the guest operating system itself is the usual installer routine and is not covered here.
Prefer Hyper-V Manager on a Desktop Experience host? Select your server, then Action pane, New, Virtual Machine. The wizard asks for the same things on its Specify Name and Location, Specify Generation, Assign Memory, Configure Networking, Connect Virtual Hard Disk and Installation Options pages. In Installation Options choose Install an operating system from a bootable image file.
- Create a Generation 2 VM with 4 GB startup RAM and a dynamically expanding 60 GB virtual disk. The example uses the storage folders and external switch created above. Change the sizes and paths to suit your host. The VM is created powered off.
New-VM -Name "TestVM01" -Generation 2 -MemoryStartupBytes 4GB -NewVHDPath "D:\Hyper-V\Virtual Hard Disks\TestVM01.vhdx" -NewVHDSizeBytes 60GB -Path "D:\Hyper-V" -SwitchName "External-LAN" - Attach your guest installation ISO as a virtual DVD and set that drive as the first boot device. Replace YOUR_ISO_FILENAME with the real ISO filename in D:\ISOs or change the path to match where you saved it.
$dvd = Add-VMDvdDrive -VMName "TestVM01" -Path "D:\ISOs\YOUR_ISO_FILENAME.iso" -Passthru Set-VMFirmware -VMName "TestVM01" -FirstBootDevice $dvd - Start the VM.
Start-VM -Name "TestVM01" - Open its console. You should see the firmware boot from the installation ISO. If prompted to press a key to boot from DVD, do so, then work through the guest installer.
VMConnect.exe localhost "TestVM01"
Check that it works
Two quick checks tell you far more than the VM merely appearing in a list. The first proves the hypervisor is running it. The second proves the guest operating system is alive and talking to the host, which is only possible once the guest is installed and running.
- Confirm the host shows TestVM01 with a State of Running.
Get-VM - Once the guest operating system is installed and started, check its integration services. For a healthy supported guest, Heartbeat should be enabled and its status should report OK.
Get-VMIntegrationService -VMName "TestVM01" - Inside a Windows guest, display its IP configuration and confirm that it has an address on your LAN. Then verify it can reach another device. This confirms the external switch is doing its job.
ipconfig
If it did not work
These are the usual blockers for this exact task.
- Install fails or the hypervisor will not start: repeat the host requirements check above and look for a No under Hyper-V Requirements. Turn on Intel VT or AMD-V and the XD or NX bit in the firmware settings. SLAT is required to install the hypervisor itself.
- Other virtualisation software on the host: VMware Workstation and VirtualBox rely on processor features that Hyper-V takes over. Microsoft says you can install Hyper-V alongside them, but VMs run by those apps while the Hyper-V hypervisor is active might not start or might run unreliably. A dedicated host is simplest.
- The VM refuses to start for lack of memory: the host may not have the 4 GB free. Reduce startup memory to 2 GB while the VM is off using the command below or free up memory on the host.
Set-VMMemory -VMName "TestVM01" -StartupBytes 2GB - The VM has no network: check which switch its network adapter is attached to. If the switch name is blank, attach the VM to External-LAN using the second command below.
Get-VMNetworkAdapter -VMName "TestVM01"Connect-VMNetworkAdapter -VMName "TestVM01" -SwitchName "External-LAN" - The VM boots to a firmware screen instead of the installer: confirm the ISO path is correct and that the virtual DVD is configured as the first boot device, then restart the VM.
Sources and further reading
- Install Hyper-V in Windows and Windows Server (Microsoft Learn)
- System requirements for Hyper-V on Windows and Windows Server (Microsoft Learn)
- Create and configure a virtual switch with Hyper-V (Microsoft Learn)
- Create a virtual machine in Hyper-V (Microsoft Learn)
- New-VM cmdlet reference, Windows Server 2025 (Microsoft Learn)
- New-VMSwitch cmdlet reference, Windows Server 2025 (Microsoft Learn)
- Set-VMHost cmdlet reference, Windows Server 2025 (Microsoft Learn)
- Add-VMDvdDrive and Set-VMFirmware cmdlet reference (Microsoft Learn)
- Manage Hyper-V Integration Services (Microsoft Learn)
- Windows Server 2025: Installing Hyper-V (RDR-IT, independent walkthrough)