If Generation 2, must disable Secure Boot
Get-VM | Get-VMFirmware
Get-VM -Name 'TrustyTahr' | Set-VMFirmware -EnableSecureBoot Off
https://blog.couchbase.com/hyper-v-run-ubuntu-linux-windows/ https://docs.microsoft.com/en-us/windows-server/virtualization/hyper-v/supported-ubuntu-virtual-machines-on-hyper-v
No need to disable Secure Boot. Simply go to Settings for your Ubuntu VM, click Security under Hardware in the left pane, then change the Template dropdown in the right pane to "Microsoft UEFI Certificate Authority". I don't know if it matters but the only checkbox I have checked on the Security page is Enable Secure Boot - all others are unchecked (home lab). Works great!