Hyper-V

Hyper-V is a native hypervisor from Microsoft that can create virtual machines on x86-64 systems running Windows – included in Windows Pro and Enterprise editions (since Windows 8) as an optional feature to be manually enabled.

Table of Contents

Enable Hyper-V

Open a command promt (run as Administrator).

powershell -c "Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All"

Answer “Y” to reboot.

To disable Hyper-V:

powershell -c "Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All"

Create a virtual machine

Command line

Open a command promt (run as Administrator).

powershell
New-VM -Name "My VM" -Generation 2
Set-VMFirmware "My VM" -EnableSecureBoot Off
Start-VM "My VM"

Using the GUI

You can also click Action -> Quick Create and select an operating system from the list. The Windows 10 MSIX packaging environment works well.

  • Start Hyper-V Manager (run as Administrator).
  • In the left pane, under Hyper-V Manager, click on your machine or server name.
  • Click on Actions -> New -> Virtual Machine
  • From the New Virtual Machine Wizard, click Next.
  • Specify Name and Location:
    • Enter a name for the virtual machine. Change the folder path if needed. Click Next.
  • Specify Generation:
    • Choose Generation 2 and click Next.
  • Assign Memory:
    • Enter the memory (RAM) size and click Next.
  • Configure Networking:
    • Select Default Switch and click Next.
  • Connect Virtual Hard Disk:
    • Select Create a virtual hard disk and change the size (GB). Click Next.
    • From the Installation Options, select Install an operating system later or select the iso file to use.
  • Summary:
    • Review the configuration and click Finish.

Access the VM

Command line

vmconnect.exe localhost "Atomic VM"

Using the GUI

  • Start Hyper-V Manager (run as Administrator).
  • Right-click on the virtual machine name -> Start.
  • Right-click on the virtual machine name -> Connect.

Reference