How to get started with Hyper-V and virtualization

How to get started with Hyper-V and Virtualization

A beginner’s guide to virtualization.

Hyper-V is a virtualization product by Microsoft, a feature that allows you to create virtual machines on Windows. IT professionals and businesses can run multiple operating systems on a single host, cutting down on cost and physical space.

Why Hyper-V?

  • Native integration: Hyper-V comes built into Windows and doesn’t require third-party tools.
  • Cost-effeciency: Reduces hardware costs, allowing you to manage resources within one unit.
  • Isolation: Allows you to implement configurations in a controlled environment.
  • Checkpoints: Create backup points of the entire virtual machine.
  • Networking: Native support for VLANS, LAN and SAN.
  • Resource control: Dynamically allocate resources and scale to meet changes in demand.

System Requirements for Hyper-V

  • Windows 10/11 Pro or Enterprise.
  • Windows Server 2008 and later.
  • A 64-bit processor with second-level address translation (SLAT).
  • 4GB RAM minimum (preferably more since the virtual machines share resources from the host).
  • Virtualization support should be turned on in the BIOS or UEFI.

Objectives

In this guide, we will cover the following aspects of Hyper-V.

  • Enable the Hyper-V feature on Windows.
  • Create a new virtual machine for Windows Server 2019.
  • Create a new virtual machine for Ubuntu Server 24.04.2 LTS.

Pre-requisites

This guide will primarily cover Windows Server 2019 and Ubuntu 24.04.2 LTS; however, any operating system with its respective versions should apply the same. We won’t cover licensing or pro versions; we will mainly focus on the basics.

I’ve already downloaded Windows Server 2019 and Ubuntu 24.04.2 LTS and have them in my Downloads folder. Visit the following links to download your copy and proceed with the following steps.


Step 1: Enable Hyper-V

  • Open PowerShell as an administrator and run the following command to check if the Hyper-V feature is enabled. Then, check the state to see if it is enabled or disabled.
  • If Hyper-V is not enabled, run the following command and reboot when prompted.

Alternatively, you can enable Hyper-V through the Windows features menu in the control panel.

  • Open Control Panel > Programs > Turn Windows features on or off.
  • Check Hyper-V and click OK.
  • Restart.

Open the start menu, type Hyper-V Manager and open it.

  • Open Start > Search Hyper-V Manager > Open.
  • Navigate to Actions > Hyper-V Manager > Connect to Server > Local Computer > click OK.

You have now enabled Hyper-V and opened the Hyper-V Manager. Currently, there aren’t any virtual machines. In the next section, we will see how to start creating them.

Step 2: Create a new Virtual Machine for Windows Server 2019

You should now be using the Hyper-V Manager tool. Run the following steps to create a new Windows Server 2019 virtual machine. Please note that words marked inside “[]” are variables and may change based on your choice.

  • Navigate to Actions > New > Virtual Machine > click Next to get started with OS setup.
  • Specify name and location > [Windows Server 2019] and leave the default location > click Next.
  • Specify generation > Generation 1 > click Next.
  • Assign memory > [1024MB] and leave dynamic memory checked for now > click Next.
  • Configure networking > Not Connected > click Next.
  • Connect virtual hard disk > Create a virtual disk [Windows Server 2019.vhdx], leave default location and set size [48GB] > click Next.
  • Installation options > Install an operating system from a bootable CD/DVD-ROM > click Image file (.iso) and browse OS [C:\Users\rf1admin\Downloads\Windows Server 2019.iso] > click Next.
  • Complete the new virtual machine wizard > review your installation, and click Finish.

You should now have a new Windows Server virtual machine that is turned off, but just for now. We will turn it on, and later look at how to run a complete operating system installation.

  • Go to Windows Server 2019 > double-click on it, and a console should appear > click Start.
  • Alternatively, go to Windows Server 2019 menu > click Start.
  • Your virtual machine’s state should now switch to Running. Other options, such as CPU Usage, Assigned Memory, and Uptime, have also changed to reflect this change. A checkpoint has also been created as an initial point, but we will cover those later.
  • Go back to the Windows Server 2019 menu and click Connect. You can also double-click on your running virtual machine to connect to it.

Step 3: Create a new Virtual Machine for Ubuntu

The previous process applies if you want to create a virtual machine to run Ubuntu. Run the following steps to create a new Ubuntu Server 24.02.2 LTS virtual machine. Again, note that words marked inside “[]” are variables and may change based on your choice.

  • Navigate to Actions > New > Virtual Machine > click Next to get started with OS setup.
  • Specify name and location > [Ubuntu Server 24.04.2 LTS] and leave default location > click Next.
  • Specify generation > Generation 1 > click Next.
  • Assign memory > [1024MB] and leave dynamic memory checked for now > click Next.
  • Configure networking > Not Connected > click Next.
  • Connect virtual hard disk > Create a virtual disk [Ubuntu Server 24.04.2 LTS.vhdx], leave default location and set size [48GB] > click Next.
  • Installation options > Install an operating system from a bootable CD/DVD-ROM > click Image file (.iso) and browse OS [C:\Users\rf1admin\Downloads\Ubuntu Server 24.04.2 LTS.iso] > click Next.
  • Complete the new virtual machine wizard > review your installation, and click Finish.

You should now have a new Ubuntu Server virtual machine. Let’s turn it on, and later we’ll run a complete operating system installation.

  • Go to Ubuntu Server 24.04.2 LTS > double-click on it and a console should appear > click Start.
  • Alternatively, go to Ubuntu Server 24.04.2 LTS menu > click Start.
  • Your virtual machine’s state should now switch to Running. Other options, such as CPU Usage, Assigned Memory, and Uptime, have also changed to reflect this change. A checkpoint has also been created as an initial point, but we will cover those later.
  • Go back to the Ubuntu Server 24.04.2 LTS menu and click Connect. You can also double-click on your running virtual machine to connect to it.

Congratulations. You should now have a virtual machine for Windows Server 2019 and Ubuntu Server. We’ve started connecting to them. Next, we will configure them and test connectivity. Head over to the following links to get started with the installations.

  • How to install and configure Windows Server 2019 on Hyper-V.
  • How to install and configure Ubuntu Server 24.04.2 LTS on Hyper-V.