Thursday, January 14, 2021

Deploying Ubuntu 20.10 (Groovy Gorilla) in Windows Enterprise Hyper-V

In the past I've always deployed my VMs using VMware products. I recently received a new laptop with Windows Enterprise on it. When I went to install VMware Workstation, it complained that it cannot be installed while Hyper-V is also installed. Doing some quick research I read that Hyper-V should have better performance than VMware in this situation. I've never used Hyper-V before so I figured this is a good time to learn it.

The Hyper-V Manager runs in the Microsoft Management Console, which is a somewhat outdated looking UI.  

Hyper-V Manager 

 

 

 

 

 

 

 

 

Adding a VM is pretty straight forward by selecting New -> Virtual Machine... under the Actions right side panel. This brings up the New Virtual Machine Wizard.

 

 

New Virtual Machine Wizard

Before You Begin

This first step in the wizard can be quickly read through and then press Next.












Specify Name and Location

The next step allows you to provide a unique name for the VM. It also allows specifying the location to store the VM files. I like to store these under my Documents folder. Make sure to note the warning about making sure there is sufficient space, if you change the location.












Specify Generation

I've heard about Generation 1 and Generation 2 related to Hyper-V from previous customer issues I've heard of, but never personally had to choose one. In this case, Ubuntu is a 64-bit OS, so I decided to go with Generation 2.












Assign Memory

For my situation, I am going to set this VM to use 8GB. It would be nice if the UI allowed you to enter 8 and set GB, but I had to do the math myself: 1024 * 8 = 8192MB. I left the checkbox checked to use Dynamic Memory.












Configure Networking

I am going to want to access the network with this VM, so I selected "Default Switch".












Connect Virtual Hard Disk

I went for all the default settings on the next screen and stuck with the 127 GB disk and default location.












Installation Options

We want to install Ubuntu, so changing this to point to the iso image I downloaded from the Ubuntu site.












Competing the New Virtual Machine Wizard

A quick review of the summary step and I pressed Finish.












Running the new VM

A progress modal popped up just for a few seconds and now the Hyper-V Manager is successfully showing my new VM! Let's start it.









There are at least 2 ways I saw to view the VM's console:

  1. Right click the VM name under the Virtual Machines panel in the center of the UI, then select Connect.
  2. Select the VM from the Virtual Machines panel. Then click the Connect button under the Actions panel in the right side of the UI.

After a short time, the console eventually displayed a lovely error message:

    The image's hash and certificate are not allowed (DB).











My first thought was, I probably should have picked Generation 1 in the wizard. Doing some research, I eventually found this site with some helpful answers: Hyper-V Boot Error: The Image’s Hash and Certificate Are not Allowed | Windows OS Hub (woshub.com) 

I decided to leave Secure Boot enabled, but use Microsoft UEFI Certificate Authority.

Attempting to get to the Security settings while the VM is running is not allowed. So I had to "Turn Off" the VM. (I tried "Shut Down" but it failed). Then I was able to set the settings up correctly:



 

 

 









Then I started the VM after applying the change and we have success:













I've tried running Ubuntu VMs for my development purposes in the past with limited success because of performance issues. Hopefully with this new laptop I'll have better success. I'll keep you posted!