Hyper-V Generation 2 VM with Linux Operating System

Hi Guys,

Since Hyper-V for Windows Server 2012 R2 we have two generations of Virtual Machines (VM).
The main differences between the two generations are:

  • Generation 1 will provide the same virtual hardware to the virtual machine as in previous Hyper-V.
  • Generation 2 will provide new functionalities to virtual machine, such as:
    • PXE boot over a “Standard Network Adapter”
    • Secure Boot (enabled by default)
    • UEFI firmware support

Some of you may have tried, since Hyper-V 2012 R2, to install a Linux OS using a VM created using “Generation 2“, for those of you who did not tried it the Secure Boot failed and the boot sequence go to PXE.

To solve this issue with the Secure Boot, there is an anoyingly small PowerShell Cmdlet to run in order to turn off the Secure Boot on the Virtual Machine.
[ps]Set-VMFirmware ubuntu -EnableSecureBoot Off[/ps]

The thing I found anoying aboutn this PowerShell Cmdlet is that since I start using it on Windows Server 2012 R2 the ‘EnableSecureBoot‘ parameter takes ‘Off’ value instead of the natural PowerShell universal variable “$False”.