Skip to content

Commit 62d72f4

Browse files
authored
Merge pull request #7817 from robinharwood/robinharwood-hyper-v-create-vm
Freshness pass of create-a-virtual-machine-in-hyper-v.md
2 parents 1b81dde + f65ace5 commit 62d72f4

1 file changed

Lines changed: 81 additions & 33 deletions

File tree

WindowsServerDocs/virtualization/hyper-v/get-started/Create-a-virtual-machine-in-Hyper-V.md

Lines changed: 81 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,89 @@
11
---
22
title: Create a virtual machine in Hyper-V
3-
description: Gives instructions for creating a virtual machine using Hyper-V Manager or Windows PowerShell.
3+
description: Learn how to create a virtual machine in Hyper-V using Hyper-V Manager or PowerShell. Follow step-by-step instructions to get started quickly.
4+
#customer intent: As an IT admin, I want to create a virtual machine using Hyper-V Manager so that I can run isolated workloads on my server.
45
ms.topic: how-to
56
ms.author: roharwoo
67
author: robinharwood
7-
ms.date: 01/29/2025
8+
ms.date: 11/27/2025
89
---
910

1011
# Create a virtual machine in Hyper-V
1112

1213
Learn how to create a virtual machine by using Hyper-V Manager and Windows PowerShell and what options you have when you create a virtual machine in Hyper-V Manager.
1314

15+
## Prerequisites
16+
17+
Before you create a virtual machine, make sure you have the following prerequisites:
18+
19+
- A computer running Windows Server or Windows client with Hyper-V enabled. For more information, see [Install the Hyper-V role on Windows Server](../get-started/Install-the-Hyper-V-role-on-Windows-Server.md).
20+
- Membership in the local **Administrators** group or the **Hyper-V Administrators** group.
21+
- Sufficient physical memory on the host to allocate to the virtual machine.
22+
- Sufficient disk space for virtual machine configuration files and virtual hard disks.
23+
- (Optional) A virtual switch configured if you want network connectivity for the virtual machine. See [Create a virtual switch for Hyper-V virtual machines](Create-a-virtual-switch-for-Hyper-V-virtual-machines.md).
24+
- (Optional) An operating system installation media (.iso file) or an existing virtual hard disk (.vhd or .vhdx) if you want to install an operating system.
25+
1426
## Create a virtual machine
1527

28+
To create a virtual machine, use either Hyper-V Manager or Windows PowerShell. Select the method you prefer:
29+
1630
### [Hyper-V Manager](#tab/hyper-v-manager)
1731

18-
1. Open **Hyper-V Manager**.
32+
To create a virtual machine in Hyper-V Manager, follow these steps:
33+
34+
1. Select the **Start** button, type **Hyper-V Manager**, and then select it from the list.
35+
36+
> [!NOTE]
37+
> If you don't see Hyper-V Manager, make sure that the Hyper-V role is installed. For more information, see [Install the Hyper-V role on Windows Server](../get-started/Install-the-Hyper-V-role-on-Windows-Server.md).
38+
39+
1. In the left pane, under **Hyper-V Manager**, select your server.
40+
41+
1. From the **Actions** pane, select **New**, then select **Virtual Machine**.
42+
43+
1. From the **New Virtual Machine Wizard**, select **Next**.
44+
45+
1. For the **Specify Name and Location** page, enter a name for the virtual machine and choose a location to store the virtual machine configuration files. Select **Next**.
46+
47+
(Optionally) If you want to store the virtual machine configuration files in a different location, select the **Store the virtual machine in a different location** check box and then browse to the folder where you want to store the files.
48+
49+
1. In the **Specify Generation** page, select the generation of the virtual machine. For more information, see [Should I create a generation 1 or 2 virtual machine in Hyper-V?](../plan/Should-I-create-a-generation-1-or-2-virtual-machine-in-Hyper-V.md). Create a generation 2 virtual machine unless you have a specific reason to create a generation 1 virtual machine. Select **Next**.
50+
51+
1. For the **Assign Memory** page, enter the amount of memory to allocate to the virtual machine at startup. You can also choose to enable Dynamic Memory. For more information, see [Hyper-V Dynamic Memory Overview](../dynamic-memory.md). Select **Next**.
52+
53+
> [!NOTE]
54+
> The minimum amount of memory you can assign is 32 MB and the maximum is 5,902 MB.
55+
56+
1. For the **Configure Networking** page, select a virtual switch to connect the virtual machine to the network. If you don't have a virtual switch created, you can skip this step and configure networking later. Select **Next**.
57+
58+
1. In the **Connect Virtual Hard Disk** page, choose one of the following options, then select **Next**:
59+
60+
- **Create a virtual hard disk** - Enter a name for the virtual hard disk, choose a location to store it, and specify its size.
1961

20-
1. In the left pane, under **Hyper-V Manager**, select your server.
62+
- **Use an existing virtual hard disk** - Browse to the location of an existing virtual hard disk (`.vhd` or `.vhdx`).
2163

22-
1. From the **Actions** pane, select **New**, and then select **Virtual Machine**.
64+
- **Attach a virtual hard disk later** - You can attach a virtual hard disk later.
2365

24-
1. From the **New Virtual Machine Wizard**, select **Next**.
66+
1. For the **Installation Options** page, choose how you want to install the operating system on the virtual machine. You can choose one of the following options, then select **Next**:
2567

26-
1. Make the appropriate choices for your virtual machine on each of the pages. For more information, see [New virtual machine options and defaults in Hyper-V Manager](#options-in-hyper-v-manager-new-virtual-machine-wizard).
68+
- **Install an operating system later**
2769

28-
1. After verifying your choices in the **Summary** page, select **Finish**.
70+
- **Install an operating system from a bootable image file** - Browse to the location of an `.iso` file that contains the operating system installation media.
2971

30-
1. In Hyper-V Manager, right-click the virtual machine and select **Connect...**.
72+
- **Install an operating system from a bootable floppy disk** - Select a floppy disk drive that contains the operating system installation media.
3173

32-
1. In the Virtual Machine Connection window, select **Action** > **Start**.
74+
- **Install an operating system from a network-based installation server** - This option is for using Windows Deployment Services (WDS) or another network-based installation service.
75+
76+
1. After verifying your choices in the **Summary** page, select **Finish**.
3377

3478
### [PowerShell](#tab/powershell)
3579

80+
To create a virtual machine with Windows PowerShell using [New-VM](/powershell/module/hyper-v/new-vm), follow these steps:
81+
3682
1. On the Windows desktop, select the Start button and type **Windows PowerShell**.
3783

3884
1. Right-click on **Windows PowerShell** and select **Run as administrator**.
3985

40-
1. Get the name of the virtual switch that you want the virtual machine to use by using the [Get-VMSwitch](/powershell/module/hyper-v/get-vmswitch) cmdlet:
86+
1. Use the [Get-VMSwitch](/powershell/module/hyper-v/get-vmswitch) cmdlet to get the name of the virtual switch that you want the virtual machine to use:
4187

4288
```powershell
4389
Get-VMSwitch * | Format-Table Name
@@ -46,12 +92,12 @@ Learn how to create a virtual machine by using Hyper-V Manager and Windows Power
4692
1. Use the [New-VM](/powershell/module/hyper-v/new-vm) cmdlet to create the virtual machine. See the following examples:
4793

4894
> [!NOTE]
49-
> If you move this virtual machine to a Hyper-V host that runs Windows Server 2012 R2, use the **-Version** parameter with **[New-VM](/powershell/module/hyper-v/new-vm)** to set the virtual machine configuration version to 5. The default virtual machine configuration version for Windows Server 2016 isn't supported by Windows Server 2012 R2 or earlier versions. You can't change the virtual machine configuration version after the virtual machine is created. For more information, see [Supported virtual machine configuration versions](../deploy/Upgrade-virtual-machine-version-in-Hyper-V-on-Windows-or-Windows-Server.md#supported-virtual-machine-configuration-versions).
95+
> Use the **-Version** parameter if you need to move this virtual machine to a host running an older Windows Server version. See [Supported virtual machine configuration versions](../deploy/Upgrade-virtual-machine-version-in-Hyper-V-on-Windows-or-Windows-Server.md#supported-virtual-machine-configuration-versions).
5096
51-
- **Existing virtual hard disk** - To create a virtual machine with an existing virtual hard disk, you can use the following command where,
97+
- **Existing virtual hard disk** - To create a virtual machine with an existing virtual hard disk, use the following command where,
5298
- **-Name** is the name that you provide for the virtual machine that you're creating.
53-
- **-MemoryStartupBytes** is the amount of memory that is available to the virtual machine at start up.
54-
- **-BootDevice** is the device that the virtual machine boots to when it starts like the network adapter (NetworkAdapter) or virtual hard disk (VHD).
99+
- **-MemoryStartupBytes** is the amount of memory that's available to the virtual machine at startup.
100+
- **-BootDevice** is the device that the virtual machine boots to when it starts, like the network adapter (NetworkAdapter) or virtual hard disk (VHD).
55101
- **-VHDPath** is the path to the virtual machine disk that you want to use.
56102
- **-Path** is the path to store the virtual machine configuration files.
57103
- **-Generation** is the virtual machine generation. Use generation 1 for VHD and generation 2 for VHDX. See [Should I create a generation 1 or 2 virtual machine in Hyper-V?.](../plan/Should-I-create-a-generation-1-or-2-virtual-machine-in-Hyper-V.md)
@@ -67,7 +113,7 @@ Learn how to create a virtual machine by using Hyper-V Manager and Windows Power
67113
New-VM -Name TestVM -MemoryStartupBytes 4GB -BootDevice VHD -VHDPath .\VMs\Test.vhdx -Path .\VMData -Generation 2 -Switch ExternalSwitch
68114
```
69115
70-
This creates a generation 2 virtual machine named TestVM with 4 GB of memory. It boots from the folder VMs\Test.vhdx in the current directory and uses the virtual switch named ExternalSwitch. The virtual machine configuration files are stored in the folder VMData.
116+
This example creates a generation 2 virtual machine named TestVM with 4 GB of memory. It boots from the folder VMs\Test.vhdx in the current directory and uses the virtual switch named ExternalSwitch. The virtual machine configuration files are stored in the folder VMData.
71117
72118
- **New virtual hard disk** - To create a virtual machine with a new virtual hard disk, replace the **-VHDPath** parameter from the previous example with **-NewVHDPath** and add the **-NewVHDSizeBytes** parameter. For example,
73119
@@ -77,7 +123,25 @@ Learn how to create a virtual machine by using Hyper-V Manager and Windows Power
77123
78124
- **New virtual hard disk that boots to operating system image** - To create a virtual machine with a new virtual disk that boots to an operating system image, see the PowerShell example in [Create virtual machine walkthrough for Hyper-V on Windows](/virtualization/hyper-v-on-windows/quick-start/create-virtual-machine).
79125
80-
1. Start the virtual machine by using the [Start-VM](/powershell/module/hyper-v/start-vm) cmdlet. Run the following cmdlet where Name is the name of the virtual machine you created:
126+
---
127+
128+
## Start and connect to the virtual machine
129+
130+
After you create the virtual machine, you can start it and connect to it. You can use either Hyper-V Manager or Windows PowerShell. Select the method you prefer:
131+
132+
### [Hyper-V Manager](#tab/hyper-v-manager)
133+
134+
To start and connect to the virtual machine in Hyper-V Manager, follow these steps:
135+
136+
1. In Hyper-V Manager, right-click the virtual machine and select **Connect...**.
137+
138+
1. In the Virtual Machine Connection window, select **Action** > **Start**.
139+
140+
### [PowerShell](#tab/powershell)
141+
142+
To start and connect to the virtual machine using Windows PowerShell, follow these steps:
143+
144+
1. Start the virtual machine by using the [Start-VM](/powershell/module/hyper-v/start-vm) cmdlet. Run the following cmdlet where Name is the name of the virtual machine you created:
81145
82146
```powershell
83147
Start-VM -Name <Name>
@@ -103,20 +167,6 @@ Learn how to create a virtual machine by using Hyper-V Manager and Windows Power
103167

104168
---
105169

106-
## Options in Hyper-V Manager New Virtual Machine Wizard
107-
108-
The following table lists the options you can pick when you create a virtual machine in Hyper-V Manager and the defaults for each.
109-
110-
|Page|Default for Windows Server 2016, Windows 10, and later|Other options|
111-
|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------|
112-
|**Specify Name and Location**|Name: New Virtual Machine.<p>Location: **C:\ProgramData\Microsoft\Windows\Hyper-V\\**.|You can also enter your own name and choose another location for the virtual machine.<p>This is where the virtual machine configuration files are stored.|
113-
|**Specify Generation**|Generation 1|You can also choose to create a Generation 2 virtual machine. For more information, see [Should I create a generation 1 or 2 virtual machine in Hyper-V?.](../plan/Should-I-create-a-generation-1-or-2-virtual-machine-in-Hyper-V.md)|
114-
|**Assign Memory**|Startup memory: 1024 MB<p>Dynamic memory: **not selected**|You can set the startup memory from 32 MB to 5902 MB.<p>You can also choose to use Dynamic Memory. For more information, see [Hyper-V Dynamic Memory Overview](../dynamic-memory.md).|
115-
|**Configure Networking**|Not connected|You can select a network connection for the virtual machine to use from a list of existing virtual switches. See [Create a virtual switch for Hyper-V virtual machines](Create-a-virtual-switch-for-Hyper-V-virtual-machines.md).|
116-
|**Connect Virtual Hard Disk**|Create a virtual hard disk<p>Name: <*vmname*>.vhdx<p>**Location**: **C:\Users\Public\Documents\Hyper-V\Virtual Hard Disks\\**<p>**Size**: 127 GB|You can also choose to use an existing virtual hard disk or wait and attach a virtual hard disk later.|
117-
|**Installation Options**|Install an operating system later|These options change the boot order of the virtual machine so that you can install from an .iso file, bootable floppy disk or a network installation service, like Windows Deployment Services (WDS).|
118-
|**Summary**|Displays the options that you chose, so that you can verify they're correct.<p>- Name<br />- Generation<br />- Memory<br />- Network<br />- Hard Disk<br />- Operating System|**Tip:** You can copy the summary from the page and paste it into e-mail or somewhere else to help you keep track of your virtual machines.|
119-
120170
## Related content
121171

122172
- [New-VM](/powershell/module/hyper-v/new-vm)
@@ -126,5 +176,3 @@ The following table lists the options you can pick when you create a virtual mac
126176
- [Should I create a generation 1 or 2 virtual machine in Hyper-V?](../plan/Should-I-create-a-generation-1-or-2-virtual-machine-in-Hyper-V.md)
127177

128178
- [Create a virtual switch for Hyper-V virtual machines](Create-a-virtual-switch-for-Hyper-V-virtual-machines.md)
129-
130-

0 commit comments

Comments
 (0)