Edit

Share via


Create a virtual machine in Hyper-V

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.

Prerequisites

Before you create a virtual machine, make sure you have the following prerequisites:

  • A computer running Windows Server or Windows client with Hyper-V enabled. For more information, see Install the Hyper-V role on Windows Server.
  • Membership in the local Administrators group or the Hyper-V Administrators group.
  • Sufficient physical memory on the host to allocate to the virtual machine.
  • Sufficient disk space for virtual machine configuration files and virtual hard disks.
  • (Optional) A virtual switch configured if you want network connectivity for the virtual machine. See Create a virtual switch for Hyper-V virtual machines.
  • (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.

Create a virtual machine

To create a virtual machine, use either Hyper-V Manager or Windows PowerShell. Select the method you prefer:

To create a virtual machine in Hyper-V Manager, follow these steps:

  1. Select the Start button, type Hyper-V Manager, and then select it from the list.

    Note

    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.

  2. In the left pane, under Hyper-V Manager, select your server.

  3. From the Actions pane, select New, then select Virtual Machine.

  4. From the New Virtual Machine Wizard, select Next.

  5. 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.

    (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.

  6. 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?. Create a generation 2 virtual machine unless you have a specific reason to create a generation 1 virtual machine. Select Next.

  7. 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. Select Next.

    Note

    The minimum amount of memory you can assign is 32 MB and the maximum is 5,902 MB.

  8. 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.

  9. In the Connect Virtual Hard Disk page, choose one of the following options, then select Next:

    • Create a virtual hard disk - Enter a name for the virtual hard disk, choose a location to store it, and specify its size.

    • Use an existing virtual hard disk - Browse to the location of an existing virtual hard disk (.vhd or .vhdx).

    • Attach a virtual hard disk later - You can attach a virtual hard disk later.

  10. 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:

    • Install an operating system later

    • Install an operating system from a bootable image file - Browse to the location of an .iso file that contains the operating system installation media.

    • Install an operating system from a bootable floppy disk - Select a floppy disk drive that contains the operating system installation media.

    • 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.

  11. After verifying your choices in the Summary page, select Finish.

Start and connect to the virtual machine

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:

To start and connect to the virtual machine in Hyper-V Manager, follow these steps:

  1. In Hyper-V Manager, right-click the virtual machine and select Connect....

  2. In the Virtual Machine Connection window, select Action > Start.