Installing Ubuntu 14.04 LTS as a Generation 2 Hyper-V guest

Since Microsoft release Windows Server 2012 R2 Hyper-V have had two different generations of virtual machines. The old “Generation 1” and the new “Generation 2”. Microsoft added generation 2 to get rid of the old stuff that really doesn’t make sense in a virtual world. And also to add new stuff. Generation 2 virtual machines provide the following new functionality:

  • PXE boot by using a standard network adapter
  • Boot from a SCSI virtual hard disk
  • Boot from aSCSI virtual DVD
  • Secure Boot (on by default)
  • UEFI firmware support

As can be expected all of these features worked fine straight away with Windows 8 (64-bit) and Windows Server 2012 or later. But they did not work well with Linux. Until now.

The fresh Ubuntu 14.04 LTS release works fine with and can be installed into a generation 2 virtual machine in Hyper-V. There is only one thing you need to know – Secure Boot has to be disabled. Hyper-V enables secure boot by default so if you just click through the wizard to create a VM it will not work. You have to disable Secure Boot.

Here’s the PowerShell way to check if Secure Boot is enable for your VMs:

Get-VM | Get-VMFirmware

To disable Secure Boot for a specific VM (‘TrustyTahr’) use this:

Get-VM -Name 'TrustyTahr' | Set-VMFirmware -EnableSecureBoot Off

Now you can install Ubuntu in a generation 2 Hyper-V machine. It just works. And even though I have not done any valid tests the gen 2 Ubuntu machine feels a lot snappier than on old one.