Installing Windows 11 in a Hyper-V virtual machine.

Microsoft has rolled out a number of requirements for device hardware required to install Windows 11. In particular, your computer must have a built-in TPM module, a modern processor, and support UEFI Secure Boot. Even if your computer does not support these features at the hardware level, you can use the virtual TPM module and run Windows 11 in a virtual machine. In this article, we will look at how to create a Windows 11 virtual machine in Hyper-V.

Create a Windows 11 virtual machine in Hyper-V.

Your computer should already have the Hyper-V role installed. You can install Hyper-V on both a Windows 10 desktop and a host with Windows Server or the free Microsoft Hyper-V Server.

  • You can create a Windows 11 virtual machine from the Hyper-V graphical console or using PowerShell.Launch the Hyper-V Manager console , click Create -> New Virtual Machine ;
  • Specify the name of the VM;
  • Be sure to select the second generation virtual machine (Generation 2 virtual hardware supports UEFI, Secure Boot, and virtual TPM);

  • Specify the size of RAM for the VM (at least 4GB, otherwise, when installing Windows 11, an error will appear that the computer does not meet the minimum requirements for installing the OS);
  • Connect the VM to a Hyper-V virtual switch with internet access (optional);

  • Specify the size of the virtual vhdx disk for a Windows 11 VM (it is recommended to use a disk of at least 64 GB, but 30 GB is enough for a minimum VM);

  • In the next step, choose that you want to install the OS later.

So, the virtual machine is ready. Now you need to configure the VM settings for installing Windows 11 guest.

  • Open the VM settings;
  • Open the virtual processor management tab ( Processor ) and increase the number of vCPUs to at least 2;

  • Go to the Security tab, enable the Secure Boot option and select Microsoft Windows as a template;
  • Enable the Trusted Platform Module option;

You can create a Windows 11 virtual machine on Hyper-V using PowerShell:
$VMName = "win11_vm2"
$VM = @{
Name = $VMName
MemoryStartupBytes = 4Gb
Generation = 2
NewVHDPath = "C:\HV\$VMName\$VMName.vhdx"
NewVHDSizeBytes = 30Gb
Path = "C:\HV\$VMName"
SwitchName = "ExtVMSwitch"
}
New-VM @VM

Add a second CPU for the VM:

Set-VM -VMName $VMName -ProcessorCount 2

Installing Windows 11 in a Hyper-V virtual machine.

To install Windows 11 in a virtual machine, you will need an ISO image. You can download the Windows 11 ISO from the Microsoft website (https://www.microsoft.com/en-us/software-download/windows11), or use the Media Creation Tool to generate a Windows install image.

Connect the downloaded Windows 11 ISO image to the virtual machine. To do this, go to the SCSI Controllers section and add a virial DVD drive (DVD Drive -> Add ).

The DVD Drive will appear in the hardware list of the VM . Select it, enable the Image file option and specify the path to the Windows 11 installation ISO image. Save the VM settings.


Open the VM properties again, and on the Firmware tab , set the virtual DVD drive as the primary boot device (move this entry up with the Move Up button).

These same operations can be performed from PowerShell. Mount the ISO image to a virtual DVD drive and change the boot order of the VM:
$virt_dvd = Add-VMDvdDrive -VMName $VMName -Path 'C:\Share\Win11_English_x64_RTM.iso' -Passthru
Set-VMFirmware -VMName $VMName -FirstBootDevice $virt_dvd
It remains to add virtual TPM support:
Set-VMKeyProtector -NewLocalKeyProtector -VMName $VMName
Enable-VMTPM -VMName $vmname
Start the virtual machine from the Hyper-V console or using PowerShell:
Start-VM -Name $vmname

Open the virtual machine console and press any key to boot from the virtual DVD.


Follow the Windows 11 installation wizard: select the language, time format, keyboard layout, OS edition (there may be several editions of Windows in the ISO image). If you don't have a Windows 11 installation key, you can skip this step by clicking I don't have a product key.

If you try to install Windows 11 in a virtual machine without a TPM chip, UEFI Secure boot, or with less than 4 GB of memory, an error will appear at this stage:

It is not possible to run Windows 11 on this computer . This computer does not meet the minimum system requirements for this version of Windows. For more information, see aka.ms/WindowsSysReq

Check that your virtual machine meets all the requirements, or you can proceed with the installation, ignoring the Windows 11 compatibility requirements.

Select the installation mode Custom: install Windows only for advanced users (Custom: Install Windows only advanced).

It remains to create a partition table on the virtual disk. You can create partitions manually, or install Windows 11 in an unallocated space (Drive 0 Unallocated Space -> Next). In this case, the Windows Installer will create the EFI, MSR, and System Reserved system partitions on its own ; the remaining space will be used under the Windows partition.


After that, the installation of Windows 11 will begin on the selected virtual drive.


Отправить комментарий

Добавлять новые комментарии запрещено.*

Новые Старые