Windows 2025
Sponsored Link

Hyper-V : Create Virtual Machine (Windows)2024/12/12

 

Install GuestOS and Create a Virtual Machine.
This example shows to create VM with installing Windows Server 2025.

[1] On CUI configuration, Run PowerShell with Admin Privilege and set like follows.
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

# create a directory for virtual machines
PS C:\Users\Administrator> mkdir C:\Virtual_Machine 

# confirm virtual switches
PS C:\Users\Administrator> Get-VMSwitch 

Name     SwitchType NetAdapterInterfaceDescription
----     ---------- ------------------------------
Bridge01 External   Red Hat VirtIO Ethernet Adapter

# set virtual machine name and others
PS C:\Users\Administrator> $ParentDir = 'C:\Virtual_Machine' 
PS C:\Users\Administrator> $VMName = 'Win2k25' 
PS C:\Users\Administrator> $Switch = 'Bridge01' 

# create a virtual machine with generation 2
PS C:\Users\Administrator> New-VM -Name $VMName `
-MemoryStartupBytes 8GB `
-Generation 2 `
-NewVHDPath "$ParentDir\$VMName\$VMName.vhdx" `
-NewVHDSizeBytes 50GB `
-Path "$ParentDir\$VMName" `
-SwitchName $Switch 

Name    State CPUUsage(%) MemoryAssigned(M) Uptime   Status             Version
----    ----- ----------- ----------------- ------   ------             -------
Win2k25 Off   0           0                 00:00:00 Operating normally 12.0

# change vCPU count
PS C:\Users\Administrator> Set-VMProcessor $VMName -Count 4 

# add SCSI controler
PS C:\Users\Administrator> Add-VMScsiController -VMName $VMName 

# set install image
PS C:\Users\Administrator> Add-VMDvdDrive -VMName $VMName `
-ControllerNumber 1 `
-ControllerLocation 0 `
-Path 'C:\Users\Administrator\Documents\Win2025_26100.1742.240906-0331.ge_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso' 

# set virtual DVD first boot device
PS C:\Users\Administrator> Set-VMFirmware -VMName $VMName -FirstBootDevice (Get-VMDvdDrive -VMName $VMName) 

# start the virtual machine
PS C:\Users\Administrator> Start-VM -Name $VMName 

# after this, refer to [13] to install OS
Hyper-V : Create Virtual Machine (Windows) (GUI)
 

On GUI configuration, set like follows.

[2] Run [Server Manager] and Open [Tools] - [Hyper-V Manager].
[3] Select Hostname on the left pane and right-click it to open the menu, and then select [New] - [Virtual Machine].
[4] Click [Next] button.
[5] Input name of Virtual Machine. Any name is OK.
[6] Specify generation of Virtual Machine. On this example, select [Generation 2].
[7] Assign Memory for Virtual Machine.
[8] Select Virtual Switch to use networking of Virtual Machine.
[9] Configure Virtual Hard Disk. Set parameters you like.
[10] Select installation source of GuestOS.
[11] If everything is OK, click the [Finish] button.
[12] Virtual machine has been created. To start it, right-click it and select [Start].
[13] To connect the console of Virtual Machine, right-click it and select [Connect].
[14] Install GuestOS with common procedure.
Depending on your environment, you may see the second screen in the image below. However, if you click [Restart now] to restart the VM, the installer will start as usual.
[15] Installation has finished and Virtual Machine Windows Server is running now.
Matched Content