Hyper-v Secure Boot Template

Luckily this is an easy fix, as it is simply secure boot that Ubuntu/Hyper-V are having an argument over the validity of the Secure Boot certificate. If this change in of the CA template for Secure Boot does not work however you may need to disable secure boot entirely. Only a few people I know would perform an installation of Ubuntu using generation 2 option when creating the Virtual machine within the Hyper-v console but still not take full advantage of the hyper-v solution. When creating such virtual machine, these people would disable the Secure Boot option.

  1. Hyper-v Secure Boot Ubuntu
  2. Create A Hyper-v Template

Hyper-v Secure Boot Ubuntu

Hyper-V virtual machine boot order sounds pretty straight-forward, until you need something that is not the default. A virtual machine in Hyper-V will boot from CD/DVD (or mapped.ISO files), optical drives, IDE (fixed local disks), next network services (PXE) and finally, virtualized floppy media. For most Hyper-V setups, this is fine. But what does one do when the boot order needs to change, and it may need to change en masse?That’s when the virtual machine’s properties can be changed for the boot order. Figure A below shows one Hyper-V virtual machine having the IDE device (VHD / VHDX hard drives) being moved up to be the leading boot device: Figure AThis is good for situations where users may map their own media, which may include bootable elements (like a recovery environment). Changing the settings in Hyper-V Manager are good for a one-off change (especially if it is sent to a template/library); but not the best situation for a large scale change.For changing multiple virtual machines' bootable behavior at once, PowerShell becomes the way to do it. Making that same change in PowerShell is actually quite easy.

Create A Hyper-v Template

Hyper-v

Using the Get-VM and Set-VMBios commands, this change is made on a per-VM basis. From Figure A, the DLD-2008R2 VM will have its boot order to put IDE first; the following PowerShell script will do this change (as well as query the boot order before and after the change): get-vm DLD-2008R2 Get-VMBiosget-vm DLD-2008R2 Set-VMBios -StartupOrder@('IDE','CD','LegacyNetworkAdapter','Floppy')get-vm DLD-2008R2 Get-VMBios.

Posted on