Installation of Linux Ubuntu 20.04 LTS in a Hyper-V Version 2 Virtual Machine with a UEFI BIOS, Secure Boot and Machine Owner Key (MOK)
In this guide I will go through the installation of Ubuntu 20.04 LTS in a Hyper-V Virtual Machine on a Windows 11 Pro Host PC using optimal Virtual Machine settings for both performance and security. To instead install Ubuntu 20.04 LTS directly on your Dell PC see my other guide:
Hyper-V is an optional Windows feature only available in Windows 11 Pro/Education and is not available for Windows 11 Home (for windows 11 Home and Non-Commercial use, you can use VMware instead). Hyper-V can be used to create a more Secure VM with a UEFI BIOS and Secure Boot and a Machine Owner Key (MOK). Typically the Hyper-V VM has superior performance to the VM produced by VMware. Hyper-V is also cheaper to run for Commercial use as Business systems tend to have Windows 11 Pro preinstalled and the cost for Hyper-V on the other hand is incorporated into the Windows 11 Pro OEM License included with the PC. VMware has the edge over Hyper-V when it comes to usability as it automatically updates the VMs display using VMware Tools in response to the VM Window being resized on the Host PC. We can however make our VM full screen with a few additional command lines.
Table of contents
- Installation of Linux Ubuntu 20.04 LTS in a Hyper-V Version 2 Virtual Machine with a UEFI BIOS, Secure Boot and Machine Owner Key (MOK)
- Video
- Enable Hyper-V
- Download Ubuntu ISO
- Configure a VM: New VM Wizard Setup
- Configure a VM: VM Settings
- Connecting and Starting the VM
- Installing Ubuntu from the Ubuntu Live ISO Image
- First Time Boot (MOK Enrollment)
- Updating Ubuntu
- Making the VM Full Screen
The minimum system requirements for Hyper-V are roughly inline with the minimum system requirements for Windows 11 Pro i.e. a computer with a 6th Generation Intel Processor or AMD Equivalent or later. To run a VM the Windows 11 Pro Host PC should have at least 8 GB of RAM installed. A minimum of 4-6 GB of the RAM should be reserved for the Host PC otherwise there will be a performance lockup. This allows the VM to have 2 GB of RAM. If your Windows 11 Pro Host PC has 16 GB of RAM or higher, you can safely allow the VM to use 4 GB of RAM. The OS Boot Drive on the Windows 11 Pro Host PC should be at least a 250 GB SSD. Note a mechanical HDD will lock up to 100 % Disk Usage when used to run Windows 11 Pro and a VM on top giving a bottleneck in terms of system performance.
Video
Enable Hyper-V
To enable Hyper-V on your Windows 11 Pro PC. Right click the Start Button and select Windows Terminal (Admin):

Then Accept the User Account Control Prompt:

Then type in the following command:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All

This will download the latest version of Hyper-V from Microsoft servers. To install this Windows feature you will need to input to restart when prompted. Input:
y

The PC will restart and configure Hyper-V.

Hyper-V can be found in the Windows 11 Start Menu under windows Tools:

Download Ubuntu ISO
You will next need a Ubuntu 20.04 LTS ISO.
The ISO should have Update 1 or Higher as the original Ubuntu 20.04 ISO has an outdated GRUB2 Bootloader which is not compliant with mid 2020 or newer Secure Boot. Secure Boot was updated in mid 2020 in response to a Security Exploit found in old GRUB2 Bootloaders.
Configure a VM: New VM Wizard Setup
Launch Hyper-V Manager:

To the left hand side you will see your computers name:

Right click your Computer Name and select New → Virtual Machine:

Select Next:

Name your VM e.g. Ubuntu 20.04 LTS and then select Next:

For best performance and Security select Generation 2 which will create a VM with a Virtual UEFI BIOS. Generation 1 is a VM with a Legacy BIOS which is obsolete:

Open the Task Manager pressing [Ctrl], [Shift] + [Esc] and have a look at your memory. In my case there is 16 GB installed with Windows using ~4 GB and 11.8 GB of RAM available. It is safe for me to assign the VM 4 GB of RAM. If you have 8 GB of RAM you may be better to give the vM 2 GB:

Update the Startup Memory to 4096 MB or 2048 MB if your PC only has 8 GB of RAM. Select Next:

Change the Network to Default Switch. This will give you a Virtual Ethernet based upon your Host PCs Internet Connectivity. Select Next:

Use the default settings to Create a Virtual Hard Disk. The maximum size by default is 127 GB which is ample in most cases. Note that it is a dynamically expanding Virtual Drive so won't actually occupy the maximum fill size (unless you fill it to the brim with data). If you have a 2 TB SSD you can optionally make the maximum size larger if desired. Select Next:

Under Installation Options select Install an Operating System from a Bootable Image File and then select Browse:

Select your Ubuntu 20.04 ISO:

Select Next:

Select Finish:

Configure a VM: VM Settings
The VM will be created however it is optimised for a Windows install and not a Ubuntu install,

We need to right click the VM and select Settings to access additional settings not displayed in the New Virtual Machine Wizard:

Under Security, Secure Boot should be checked by default. We need to Change the Template from Microsoft Windows (which will only allow Windows to Boot) to Microsoft UEFI Certificate Authority (which will allow Linux Distros with a Secure Boot Signature to Boot). Under Encryption Support Enable Trusted Platform Module and then select Apply:

Press [Ctrl}, [Shift] and [Esc] to open the Task Manager and have a look at your CPU. You are interested in the number of Cores. If your CPU has 4 Cores, update the Number of Virtual Processors to 2. If it has 8 Cores update the Number of Virtual Processors to 4:

In this case I will update the number of Virtual Processors to 2 and then select Apply:

Select Integration Services and check Guest Services then select Apply:

Connecting and Starting the VM
Right click the VM and select Connect (selecting tart Directly will launch the VM without Displaying the VM output to the user):

Then select Action and Start:

Installing Ubuntu from the Ubuntu Live ISO Image
The VM will automatically boot to the Ubuntu ISO Image. Ubuntu should be selected press [Enter]:

You will see the Hyper-V logo and it will check the installation media integrity:


You will be informed the installation media is okay:

You will now see the Hyper-V and Ubuntu logo with spinner as the Ubuntu Live ISO Starts:

To the left hand side select your language and then select Install Ubuntu:

Select your Keyboard Layout and then select Next:

Normal installation should be selected by default. As you are already connected to the internet, Download Updates while Installing Ubuntu will automatically be checked. Check Install Third-Party Software for Graphics and Wi-Fi Hardware and Additional Media Formats. Then create a Machine Owner Key and confirm the Machine Owner Key. We will need to provide the Machine Owner Key to the Hyper-V UEFI BIOS during the first time Boot to authorise the Boot with the additional drivers and multi-media audio codecs. Select Next:

Select Erase Disk and Install Ubuntu then select Next:

Select Continue:

Select your Capital City/Timezone on the map or dropdown list and select Next:

Input your Name (Full Name) and Usernmae (lower case only with no special characters). The computer name will be generated from your username and PC model (in this case Virtual-Machine). Input your password and confirm it. Then select Continue:

Select Restart Now:

First Time Boot (MOK Enrollment)
The Ubuntu first time boot will be blocked by the UEFI BIOS because it includes the third-party drivers and multimedia codecs. The UEFI BIOS will recognise that the boot has a new Machine Owner Key and take you to the MOK Management screen. Press [↓] and highlight Enroll MOK, then press [Enter]:

Then press [↓] and highlight [Continue] and press [Enter]:

Then press [↓] and highlight Yes and press [Enter]:

Input your MOK and press [Enter]. Note no characters display when you are inputting text:

If the key matches it will be accepted and you will be prompted to Reboot. Press [Enter]:

Now Ubuntu will Boot with the multimedia codecs and additional drivers past Secure Boot. You will see the Hyper-V OEM logo and Ubuntu logo splash screen with the Ubuntu spinner:

Select your User Name:

Input your password to login:

You will now be prompted to connect to Online Accounts. I am going to skip this:

You will be informed about Livepatch. I am going to select Next:

You can optionally turn on Location Services (useful if you plan to use things like maps). Once you have made your selection, select Next:

You can optionally send system info to Canonical (the company who develop Ubuntu). Once you have made your option select Next:

You will be informed about the Software Store. Select Done:

Updating Ubuntu
You should now update Ubuntu. Go to the Start Screen and select Software Update (don't confuse this with Software and Update Settings to the left hand side of it that has a very similar name and icon):

Select Install Now:

To install updates, elevated permissions are required and you will get an Authentication Prompt, the Linux equivalent of Windows User Account Control. In the case of Linux, you need to input your password and then you can select Authenticate:

Once the updates are installed, select Restart Now. The VM will reboot and you will be prompted to login again:

Making the VM Full Screen
If we right click the Ubuntu Desktop in the VM and have a look at Display Settings. We will see the resolution is very small:

If we do the same on the Windows 11 Desktop we can see the resolution of our monitor:

In my case it is 1920×1080. Note the Hyper-V VM has no Aerosnap option and no snap layouts when the maximise button is selected. The VMs graphic display is behind that of VMwares. In the case of VMware Ubuntu has inbuilt VMware tools and the Window can be snapped to any size on the Host PC and the display of the VM will automatically update in accordance to the Window size.

When we maximise the Hyper-V VM it stays the same size:

To make the Virtual Machine full screen we are going to modify the display settings of the GRand Unified Bootloader GRUB of the VM using the Terminal.
Go to the Start Screen and open up the Terminal (the shortcut key [Ctrl], [Alt] and [ t ] will also open up the Terminal):

Type in the following command:
sudo nano /etc/default/grub

sudo is an abbreviation for super user do. This means we want to run the command with administrator privileges. To do so we will be prompted for our password:

nano is the name of a text editor and /etc/default/grub is the name of the file we wish to edit in nano.

Press the arrow keys to highlight the line:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
We want to update the end of the line to:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video=hyperv_fb:1920x1080"
Note 1920×1080 is the screen resolution of my Windows 11 Pro Monitor. You can check your screen resolution by right clicking the Windows Desktop and selecting display. For convenience the code uses the letter x and not the multiply symbol ×.
Once the line is modified press [Ctrl] + [x] to exit:

Then [y] to save:

The next screen will display the file name. We want to overwrite the file so just press [Enter] to overwrite the original file:

This should exit the text editor nano and return you to the terminal.
To update the grub bootloader type in:
sudo update-grub

Then to reboot type in:
sudo reboot

The VM should start full screen (maximise it to display it full screen on your Host PC):


You should now be able to use Ubuntu as a Full Screen VM with the security settings expected for a modern computer and decent performance.