How to Install Ubuntu on Hyper-V Windows 10/ Windows 11?


The Hyper-V is the native virtualization software from Microsoft. If you have the latest Windows operating system, you can run Hyper-V with no issues. Except for windows 10/11 home addition, for which Microsoft does not officially support the Hyper-V feature. However, you can still do some tweaking on your machine to get it working.

If you want to run a Linux virtual machine, mainly Ubuntu on windows, most users would prefer VMware workstation pro or VirtualBox hypervisors because that’s the common virtualization software that most people would know. But after Microsoft released their hypervisor called Hyper-V, some users are still sticking with the VirtualBox or VMware itself. Maybe they are unaware of the fact that Microsoft has their native hypervisor software.

You can install any virtual machine on the Hyper-V, and in this blog, we will install Ubuntu on the Hyper-V.

Can I have both Hyper-V and 3rd party hypervisor run at the same time?

When you enable the Hyper-V feature on the windows machine, you can no longer use the VMware workstation or any hypervisors such as VirtualBox on your machine. If you try to turn on a VM in a VMware workstation after enabling Hyper-V you will get an error message below.

VMware worksatation and Device/Credential Guard are not compatible
Transport (VMDB) error -14: Pipe connection has been broken

Same case with Virtualbox as well.

virtualbox failed to open a session for the virtual machine

How to Run Hyper-V and VMware workstations on the same machine?

There is some workaround to get the Hyper-V, and the VMware workstation to run simultaneously on the same machine. To work, you need to have the minimum required Windows 10 version Windows 10 20H1 build 19041.264. however, if you don’t have the same version, the quick fix would be to disable the hyper-v on your machine. Otherwise, you cannot run the VMware workstation on your machine.

How to Run Hyper-V and Virtualbox on the same machine?

You need to have the latest windows11 or Windows 10 version (Windows 10 20H1 build 19041.264 ). Under VirtualBox VM settings. Under the system, you need to change Hyper-V as the paravirtualization acceleration. With these settings, you can have Hyper-V and VirtualBox co-exist on the same box.

With the above in mind, let’s go ahead and start the installation of the latest Ubuntu on windows Hyper-V.

Prerequisite:-

  • A windows 10 or 11 operating system.
  • Download the latest Ubuntu software image. I am using Ubuntu desktop version 21.04.

Steps to install ubuntu on Hyper-V hypervisor.

  1. Enable the Hyper-V feature on windows.
  2. Open the Hyper-V software on windows.
  3. Creation of the VM in Hyper-V.
  4. Configure the memory.
  5. Virtual machine network configuration.
  6. Configure the Virtual hard disk for the Hyper-V VM
  7. Install the Ubuntu operating system.
  8. Disable the Secure Boot.
  9. Initiate the ubuntu installation.

1. Enable the Hyper-V feature on windows.

If you are using windows 10 or windows 11 you first need to enable the Hyper-V feature on your machine because it is not enabled by default.

Goto >Start>Run

Type appwiz.cpl and hit enter.

appwiz.cpl wizard

You will be taken to the add or remove program options under windows.

On the left top corner of the screen, you should see something called, Turn Windows features on or off.

Click on that.

Note: You need to have admin rights to turn on this feature.

turn hyper-v features on or off

After few seconds, the windows features window will now appear.

Look for Hyper-V from the list and select that and click on OK.

turn on hyper-v feature

It will start searching for required files. After few seconds, you should see that it is applying the changes.

applying the hyper-v settings

Once done, you will get a message that says, windows completed the requested changes. You may click on Restart now to finish the required changes.

Completed the installation of hyper-v on your machine

It will take some time for windows to install the features and restart the machine. During this process, you will get a screen that says windows is working on features/updates. Do not turn off your computer. Wait for some time for the process to finish, and once completed you will be presented with the windows login screen.

2. Open the Hyper-V software on windows.

After you logged in, click on the start menu, and type Hyper-V.

You should see the program called Hyper-V manager. Click on it to open.

open hyper-v

Alternatively, In the start menu, you can go to windows administrative tools, and you should see the Hyper-V program there as well.

open hyper-v from start menu

3. Creation of the VM in Hyper-V.

On the Hyper-V manager, you should see your machine name, and currently, we don’t have any Virtual machine installed on it. We are now going to install Ubuntu in the Hyper-V.

Under Hyper-V Manager, right-click on your computer name and click New>Virtual machine.

Creation of ubuntu vm in hyper-v

A new virtual machine creation wizard window will now pop up.

Before you begin, you may click on next to create a virtual machine with custom values.

new virtual machine wizard

On the next screen, you need to specify the name of the VM we will install. Since I am installing the ubuntu version 21.04, I am naming it as Ubuntu 21.04.

By default, the Hyper-V would choose the default location to store the Virtual machine files. In case if you would like to change the storage to some other place, you may check the option that says Store the virtual machine in a different location, and browse for the location of your choice.

hyper-v name the virtual machine

As I have enough storage space, I am OK with the default location and click on Next.

You will have to choose what generation of Virtual machine you want to install, choose generation 2 here, and click Next.

choose the generation of the virtual machine in hyper-v

4. Configure the memory.

We are now going to configure the memory for your VM, by default, the hypervisor would pick up just 1GB of RAM, which will not be sufficient for the Ubuntu machine to run smoothly.  For a better experience, it is better to have at least 4GB of RAM.

Under Startup memory, choose the memory size, and leave the default option. Use Dynamic memory for this virtual machine, checked and click on Next.

hyper-v ubuntu configure memory

5. Virtual machine network configuration.

We have to connect this VM to the network. For that, from the connection drop-down, choose the default switch and click on Next.

hyper-v ubuntu configure the network

6. Configure the Virtual hard disk for the Hyper-V VM

Under Create a virtual hard disk, you should see the size of the VM picked up as default 127GB. If you have enough storage, you may leave the default or reduce it based on your hard drive free space.

I am providing 40GB of storage; after the selection, click on next.

configure the virtual hard disk for ubuntu in hyper-v

7. Install the Ubuntu operating system.

By default, you will have an option selected here that says install an operating system later, however, we already have the latest Ubuntu ISO image, so we can install it right now.

Check the option that says install an operating system from a bootable image, and click on Browse to attach the iso image that you downloaded. And click on Next.

Attach the ubuntu iso image to the hyper-v

You should get a basic summary of the Ubuntu Virtual machine that we are going to install. If you want to make any changes, you can do that by choosing the desired option on the left.

To create the Ubuntu virtual machine in Hyper-V, you may now click on Finish.

summary of the ubuntu virtual machine in hyper-v

8. Disable the Secure Boot.

You will see a newly created Ubuntu VM under a Virtual machine. For the Ubuntu virtual machine to boot correctly, you will need to disable the Secure Boot which is enabled by default.

Right-click on the VM, and click on settings.

disable the secure boot in hyper-v for the ubuntu machine to start.

In Security, uncheck the option that says, enable secure Boot and click on OK.

disable the secure boot.

Right-click on the VM and click on Connect.

connect ubuntu vm in hyper-v

You will see a new window that says the virtual machine Ubuntu 21.04 is turned off. You may click on start to power on the VM. Click on start.

start the ubuntu vm in hyper-v

9. Initiate the ubuntu installation.

Starting off the Ubuntu virtual machine will take some time.  After few seconds, you will see the menu to choose the operating system. Choose Ubuntu from the list.

choose ubuntu from the hyper-v vm list

You can either try Ubuntu or install it on the hypervisor, Click on install to proceed with the installation.

begin the ubuntu installation in hyper-v
  • Choose the language of your choice and click on Next.

By default, Ubuntu would pick up normal installation, which includes a media player, office utilities, and others. I will choose the minimal installation since this is a VM, and I do not intend heavy use.

Note: The Ubuntu will automatically start connecting to the internet and download the required update during the installation if you choose the default option. ‘Download updates while installing Ubuntu’. You need to make sure you uncheck this option, as it will delay the installation process for a long time. You can install the update later on post the installation.

After the selection, click on Continue.

begin the ubuntu installation in hyper-v

Under installation type, you need to choose to erase the disk and install the Ubuntu, so click on install now.

erase Hyper-V virtual hard disk during the installation

Write the changes to disks, click on Continue.

format the virtual hard drive
  • You need to choose your timezone based on your location and click on Continue.
  • Set the user credentials and click on Continue.

The installation will now begin, and this process will take some time to complete.

ubuntu installation in hyper-v is in progress

You will get a message that says installation complete and you can click on Restart now.

ubuntu installation is complete in hyper-v

That’s it you have successfully installed Ubuntu 21.04 on a Microsoft Hyper-V. Login to the machine and enjoy the Ubuntu Linux operating system on the native Microsoft hypervisor.

Ubuntu login screen in hyper-v

And with the default configuration that we followed, your virtual machine will have internet access as well.

ubuntu desktop in hyper-v

Saifudheen Sidheeq

Saifudheen is in the Computer networking and technology field for about a decade now. He loves technology and new ideas, and in his spare time, he loves to write about them.

Recent Posts