If you want to install Ubuntu or any other Linux inside a Hyper-V Generation 2 Virtual Machine you need to do a simple change to the VM so you can install it from ISO. If you create a Hyper-V Generation 2 Virtual Machine and try to start the Virtual Machine, the Virtual Machine will not boot from ISO. This is because of the Secure Boot feature, which is included in Hyper-V Generation 2 Virtual Machines and applies to all Linux operating systems running on Hyper-V. If you don't want to install the Ubuntu manually, you can simply use the Ubuntu images