Hyper-V How To: Create a Virtual Machine

Table of contents

Creating a new Hyper-V in Hyper-V from scratch is a straightforward process using Hyper-V Manager. For the sake of simplicity, most of the possible configuration options are not available during initial creation. The wizard does present a number of options that may not be entirely obvious for those not experienced with its nuances.

To create a new virtual machine, open Hyper-V Manager and follow these steps:

  1. In the left pane, click on the Hyper-V host that you wish to host the new virtual machine.
  2. In the right-hand Actions pane, click New, then Virtual Machine to start the wizard.
    New VM: Start the Wizard

    New VM: Start the Wizard

     

  3. The first page of the New Virtual Machine Wizard is purely informational. Click Next when ready.
  4. The first data screen asks for the name of the virtual machine and the initial location. The name that you choose will be used as a label in all virtual machine tools, including Hyper-V Manager, Failover Cluster Manager, and PowerShell. The name of the guest operating system that you’ll eventually install will not be automatically set to this, and does not need to be the same.
    If you do not check the option to Store the virtual machine in a different location, then all of the virtual machine’s metadata (XML, BIN, VSV, and second-level paging files) will all be placed in the host’s default location. This path will be visible in the grayed out text box. Checking the box allows you to override this location. If it’s never held a virtual machine before, a subfolder named “Virtual Machines” will be created in the path that you specified. Whether that folder is new or existing, another subfolder will be created underneath it that will have the name of the automatically-generated GUID that represents the virtual machine. Security will automatically be configured for you.

    New VM: Name and Location

    New VM: Name and Location

     

  5. On the next screen (2012 and later), you’ll be asked to choose the Generation of the virtual machine. Generation 1 operates in the traditional BIOS mode and will be compatible will virtually any guest operating system. It allows the use of “legacy” hardware like the emulated virtual network adapter and IDE hard disks. Generation 2 virtual machines use the newer UEFI standard and is only compatible with newer guest operating systems, like Windows Server 2012, Windows 8, and recent Linux distributions. It opens up a number of features that you can read about in this TechNet article.
    New VM: Generation

    New VM: Generation

     

  6. On the next screen, you set the preliminary memory settings for the virtual machine. You only have two options: the amount of Startup memory and whether or not you wish to Use Dynamic Memory for this virtual machine. If you do not wish to use Dynamic Memory, leave the box unchecked and set the startup memory to the amount of memory that you wish the virtual machine to have. If you do wish to use Dynamic Memory, you’ll have to configure the minimums and maximums later. They will be automatically set to 512 and 1TB, respectively. Be aware that Windows Server 2012 and R2 will not install if the Startup memory is less than 1 gigabyte and the error message indicates an invalid license key, not insufficient memory.
    New VM: Memory Settings

    New VM: Memory Settings

     

  7. Next, you’ll need to determine how to connect the virtual network adapter. You can leave it at Not Connected, which means the virtual machine will begin its life without any network connectivity. Otherwise, you can connect it to a virtual switch right away. Be aware that you can’t set any advanced options such as the VLAN here. Whatever you choose, this adapter is always the newer synthetic adapter, which cannot be used to PXE boot a Generation 1 virtual machine. If you need that functionality, it is granted on a later screen.
    New VM: Network Connection

    New VM: Network Connection

     

  8. After networking, you’ll be asked to configure the first virtual hard disk for the virtual machine. You have three options on this screen. The first is to build a new virtual hard disk file. It will always be dynamically expanding and, in 2012+, will always be VHDX (as opposed to the earlier VHD). Unlike the virtual machine placement, the destination location specified on this screen will be the exact placement of the generated VHDX file.
    The second option allows you to connect an existing virtual hard disk. It cannot be currently in use. If it is attached to another virtual machine that is currently turned off, security will be reset for this virtual machine. You cannot use this wizard to establish one of the new shared virtual hard disks; such a virtual hard disks cannot be the boot disk of a virtual machine.
    The final option is to not connect a virtual hard disk at all.
    You cannot use this wizard to connect to a physical hard disk (pass-through). Contrary to a myth that’s circulating, you can, in fact, use a physical disk as the primary disk for a Hyper-V virtual machine in recent versions. That doesn’t change the fact that you should just stop using physical hard disks altogether.

     

  9. The Installation Options tab is indented in the left-hand navigation pane of the wizard for good reason: it will only appear if you chose to create a new virtual hard disk.
    The first option, Install an operating system later, creates the virtual machine with all of the previous settings and then does nothing else.
    The second option, Install an operating system from a bootable CD/DVD-ROM, allows you to select an ISO image or, for a Generation 1 VM, connect the host’s physical optical drive directly to the virtual machine. If you select this option, the image or disc will be “inserted” into the virtual machine’s virtual optical drive and the virtual machine will be set to boot from it.
    The option to use a virtual floppy disk is only available on Generation 1 virtual machines, as the Generation 2 virtual machine does not allow virtual floppies. Even for Generation 1 machines, this is an extremely rare circumstance. You can easily create a virtual floppy image using Hyper-V Manager, but you will need a functioning virtual machine to work with it.
    The final option sets the virtual machine to boot from a virtual network adapter (PXE boot). If you have created a Generation 1 virtual machine, this will cause a legacy virtual NIC to be created. In the following screenshot, note that the option is grayed out. This will happen if no virtual switch was selected for the primary network adapter. If you have created a Generation 2 virtual machine, no extra NIC is created.

    New VM: Installation Options

    New VM: Installation Options

     

  10. The final screen is simply a confirmation and your last opportunity to go back and make any necessary changes.
    New VM: Confirmation

    New VM: Confirmation

     

Once you click Finish, the wizard undertakes all of the options that you selected and creates the virtual machine. The wizard does not turn the virtual machine on, so you have an opportunity to make any desired modifications beforehand.

One important thing to take note of is that there is no screen allowing you to select the number of virtual CPUs. All virtual machines are always created with only one.

 

 

Altaro Hyper-V Backup
Share this post

Not a DOJO Member yet?

Join thousands of other IT pros and receive a weekly roundup email with the latest content & updates!

17 thoughts on "Hyper-V How To: Create a Virtual Machine"

  • Juri says:

    Hint: If you’re like me an had years before used VMware, you probably don’t feel comfortable with VM files and VHDs being buried somewhere in the file system. If you like having all files belonging to a VM on a single location, here is how to the most simple way:

    – Open in Hyper-V manager the settings of your server
    – Change the paths of virtual disks and virtual machines to say D:VM
    – Create a new VM and tick the box “Store the virtual machine in a different location”, but don’t change the path, just tick the box
    – finish creating your VM

    This will ensure that you will have under D:VM[vmname] all your files belonging to said machine.

    Makes a whole lot more sense to me.

    Cheers
    Juri

  • Juri says:

    Hint: If you’re like me an had years before used VMware, you probably don’t feel comfortable with VM files and VHDs being buried somewhere in the file system. If you like having all files belonging to a VM on a single location, here is how to the most simple way:

    – Open in Hyper-V manager the settings of your server
    – Change the paths of virtual disks and virtual machines to say D:VM
    – Create a new VM and tick the box “Store the virtual machine in a different location”, but don’t change the path, just tick the box
    – finish creating your VM

    This will ensure that you will have under D:VM[vmname] all your files belonging to said machine.

    Makes a whole lot more sense to me.

    Cheers
    Juri

  • Stev says:

    Hello,

    I followed this procedure but when the virtual machine boots on my Hyper-V Server 2012 R2 i receive the following error: “Windows failed to start. A recent hardware or software change might be the cause. Status: 0xc0000001”

    I have troubleshooted for hours with google but still no luck. I’m using an ISO of HP Windows Server 2012 R2 Foundation ROK.

    Any helpful advice?

    Thanks in advance!

    • Eric Siron says:

      It might be that the HP edition expects certain hardware, which it can’t see because it’s in a virtual machine.
      I looked for a trial edition of Foundation and don’t see one. It seems that this is an OEM-only thing.
      Also, I read a comment somewhere that Foundation is not intended or licensed to run as a virtual instance, so it may simply not be possible. I have only heard of Essentials, Standard, and Datacenter being virtualized.

  • Stev says:

    Hello,

    I followed this procedure but when the virtual machine boots on my Hyper-V Server 2012 R2 i receive the following error: “Windows failed to start. A recent hardware or software change might be the cause. Status: 0xc0000001”

    I have troubleshooted for hours with google but still no luck. I’m using an ISO of HP Windows Server 2012 R2 Foundation ROK.

    Any helpful advice?

    Thanks in advance!

  • Stev says:

    Hi Mr. Siron,

    Thanks for your cooperation! Indeed, you can’t find the foundation edition on msdn etc… It’s delivered with the HP server DVD so i created an ISO. Then you need to add the following key to the windows registry via powershell on the hyper-v : Reg Add “HKLMSOFTWAREMicrosoftWindows NTCurrentVersionVirtualization” /v BiosLockString /t REG_SZ /d “HP ” according HP laws
    > otherwise you will receive the error “BiosLockString”

    The strange thing is if you use this ISO with ESXi you have a similar procedure where you have to add smbios.ReflectHost = “TRUE” in the vmx file of the VM. With ESXi the VM starts!

    HP says that you can deploy foundation as a virtual machine also the licensing terms and conditions of Microsoft.

    And now i’m stuck in the middle…

  • Stev says:

    Hi Mr. Siron,

    Thanks for your cooperation! Indeed, you can’t find the foundation edition on msdn etc… It’s delivered with the HP server DVD so i created an ISO. Then you need to add the following key to the windows registry via powershell on the hyper-v : Reg Add “HKLMSOFTWAREMicrosoftWindows NTCurrentVersionVirtualization” /v BiosLockString /t REG_SZ /d “HP ” according HP laws
    > otherwise you will receive the error “BiosLockString”

    The strange thing is if you use this ISO with ESXi you have a similar procedure where you have to add smbios.ReflectHost = “TRUE” in the vmx file of the VM. With ESXi the VM starts!

    HP says that you can deploy foundation as a virtual machine also the licensing terms and conditions of Microsoft.

    And now i’m stuck in the middle…

  • Stev says:

    Creating the virtual machine with Generation 1 has resolved the issue.

Leave a comment or ask a question

Your email address will not be published. Required fields are marked *

Your email address will not be published.

Notify me of follow-up replies via email

Yes, I would like to receive new blog posts by email

What is the color of grass?

Please note: If you’re not already a member on the Dojo Forums you will create a new account and receive an activation email.