Hyper-V runs each virtual machine in its own isolated space, which means you can run more than one virtual machine on the same hardware at the same time. You might want to do this to avoid problems such as a crash affecting the other workloads or to give different people, groups, or services access to different systems. Ref.
Download Ubuntu ISO-image from here (e.g., the “desktop” version).
Enable Hyper-V on Windows 10
<span class="hljs-pscommand">Enable-WindowsOptionalFeature</span><span class="hljs-parameter"> -Online</span><span class="hljs-parameter"> -FeatureName</span> <span class="hljs-pscommand">Microsoft-Hyper</span>-V<span class="hljs-parameter"> -All</span>
When the installation has completed, reboot.
When the installation has completed you are prompted to restart your computer. Ref.
Start Hyper-V Manager from Administrative Tools.
Under the Actions pane, click on the ‘New’ > Virtual Machine option to launch the Virtual Machine Wizard.
New Virtual Machine Wizard will open, presenting the set of VM options that you need to configure. They include: Before You Begin, Specify Name and Location, Specify Generation, Assign Memory, Configure Networking, Connect Virtual Hard Disk, and Summary.
The Before You Begin section provides a short overview of what this wizard can do and how to use it. Read it and check the box Do not show this page again below if you want to skip this information in the future.
In the next section, you can configure the VM name and location. Ensure that the VM name is unique and allows you to easily identify the required VM. As for the VM location, you can either leave the default one, or you can create a folder and assign a new location of your choice. For this purpose, check the box below and click Browse.
On the Specify generation option, choose ‘Generation 1’.For more information on how to choose Generation 1 or 2, see here.
In the Generation section, you can choose the generation of the VM. The choice between Generation 1 and Generation 2 is mainly dictated by the guest OS that you want to install. Generation 1 VMs support 32-bit and 64-bit guest OSes and BIOS-based architecture. Also, they provide the functionality of the earlier versions of Hyper-V. Generation 2 VMs, on the other hand, support 64-bit Windows OSes and the latest versions of Linux and FreeBSD OSes and provide advanced virtualization features, such as Secure Boot. Take all aspects into account when choosing between the two generation types because you can’t change the VM generation after the VM has been created.
On the Assign Memory option, specify the amount of memory needed for the Virtual Machine. In the following section, you must specify the amount of memory (from 32 MB up to 12,582,912 MB) which will be assigned to the VM. The future performance of the VM will largely depend on the amount of allocated memory. Moreover, you can choose to use Dynamic Memory for this VM by checking the box below. This feature allows you to take a part of the memory available on a physical host and assign resources to the VM which needs it most.
On the Configure Networking option, choose the switch that you would want to use. A virtual switch allows virtual machines created on Hyper-V hosts to communicate with other computers. This setting can be changed later too.
The next step is to choose the storage, you can create or choose the virtual hard disk in this step. Configure the virtual hard disk requirements. In this section, you can create a new virtual hard disk, which requires specifying its name, location, and size. Or, you can use an existing virtual hard disk (of the VHD or VHDX format). Another option is to skip this step and attach a virtual hard disk later.
If you have decided to select Create a Virtual Hard Disk, the Installation Options section will appear where you can specify configurations right away or postpone it for later. Here, you can install a guest OS by choosing the ISO file. In this case, you can select one of the following variants:
Select one of the options and click Next.
Choose the operating system to install in this step, here you can use the iso file downloaded in the 1st step. There is also an option to install the operating system later.
The last section is Summary, which provides a short description of this VM. Look through it once again and check to make sure everything is correct. If so, click Finish to create the VM and close the wizard.
Once the virtual machine is created, right-click the virtual machine and select connect.
In the Virtual Machine Connection window, select Action > Start.
Ubuntu Virtual Machine would start booting up.
Select ENGLISH and press Enter.
Select “Install Ubuntu” using up and down key and hit the Enter key.
If you want to customize your partitions, you can do that here.
Else select “erase the disk and install Ubuntu” and click on “Continue”.
Then click “Install Now” after selecting that it’s fine to erase the disk and install Ubuntu (this is for the virtual disk, so don’t panic).
The installation will take a while. Along the way, you’ll be asked a few easy questions that you have to answer (time zone, keyboard, etc.), as well as your name, hostname, user name, and password. These are for the Ubuntu machine, just like on a real system you’d be installing. Select the security options you want.
When all files have been downloaded/installed, which can take a while, you have to click on “Restart”. Just close the Ubuntu Window, and select the “Shutdown” option. Then double-click on your VM in the main VirtualBox window again (left panel). Ubuntu should start right away in a new window.
You’re now “in” Ubuntu.