Virtualization

Install and Configure Hyper-V on Windows Server Server 2019, and 2022 via the Server Manager, PowerShell or DISM

Hyper-V installation

Hyper-V is Microsoft’s hardware virtualization product. It lets you create and run a software version of a computer, called a virtual machine. Each virtual machine acts like a complete computer, running an operating system and programs. In this article, we shall discuss how to Install and Configure Hyper-V on Windows Server Server 2019, and 2022 via the Server Manager, PowerShell or DISM. Please see how to Troubleshoot Unable to Install Office, and Backup Repository: How to Create Amazon S3 buckets

Hyper-V in Windows and Windows Server replaces older hardware virtualization products, such as Microsoft Virtual PC, Microsoft Virtual Server, and Windows Virtual PC. Hyper-V offers networking, performance, storage, and security features not available in these older products.

See the following guide on how to set up a VM via PXE boot on a Generation 1 VM and how to set up a VM via PXE boot on a Generation 2 VMhow to deploy images to computers or virtual machines using WDS and Windows deployment cannot continue, the operating system is missing via MDT deployment.

Benefits of Hyper-V

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.

  • Establish or expand a private cloud environment. Provide more flexible, on-demand IT services by moving to or expanding your use of shared resources and adjust utilization as demand changes.
  • Use your hardware more effectively. Consolidate servers and workloads onto fewer, more powerful physical computers to use less power and physical space.
  • Improve business continuity. Minimize the impact of both scheduled and unscheduled downtime of your workloads.
  • Establish or expand a virtual desktop infrastructure (VDI). Use a centralized desktop strategy with VDI can help you increase business agility and data security, as well as simplify regulatory compliance and manage desktop operating systems and applications.

    Deploy Hyper-V and Remote Desktop Virtualization Host (RD Virtualization Host) on the same server to make personal virtual desktops or virtual desktop pools available to your users.
  • Make development and test more efficient. Reproduce different computing environments without having to buy or maintain all the hardware you’d need if you only used physical systems

Install and Configure Hyper-V on Windows Server Server 2019, and Windows Server 2022

This section is divided into three parts which are HyperV installation via Server Manager, PowerShell or DISM.

Here is a guide on how to install “How to install free Hyper-V Server in Core Mode on a VMware Workstation“, how to create an EBS environment in AWS, and Enable HyperV on Windows: How to install Windows 11 on HyperV.

Part A – HyperV installation Via Server Manager:

There are many ways to configure Hyper-V on Windows Server and add the Hyper-V roles via the Server Manager.

You can either click on the Local Server, then click on Manage, and finally, click on Add Servers and Features.

Windows Server 2022

Alternatively, click on the Dashboard on the Server Manager and Click on Add roles and Features.

Windows Server 2019

On the “Before you begin” page, you can just click on Next. If you do not want the page to appear subsequent times, check the button to skip the page by default.

Server Manager

On the next Window, select “Role-based or feature-based installation” as you configure Hyper-V on Windows Server, and then click on “Next”

PowerShell

If you have multiple servers, please ensure you select the right server to have the HyperV role installed. I only have one server, therefore it is selected by default.

DISM

As you can see below, I havn’t previously installed the hyper Role. To do this, please check the Hyper-V role .

At this point, if you are unable to add a HyperV role on a Server running on VMware Workstation.

Windows Server 2019

Upon clicking on the Hyper-V role, you will be requested to add the Hyper-V Management Tools additionally. To configure Hyper-V on Windows Server, follow these steps carefully.

Please refer to this guide: The validation process found problems on the server to which you want to install features, the features are not compatible with the current configuration of your server.

Click on Add Features

Windows Server 2022

As you can see below, we have successfully selected the HyperV role, which will be installed on the server shortly.

Server Manager

These Administration Tools are already pre-selected on the Features Windows because we added them in the previous steps above. In this way, you can also uninstall the HyperV management tools in the future.

DISM

On the Hyper-V introductory window with the basic information and things to note and the pre-installation checklist, you do not have to do anything here. Click on Next to proceed!

Hyper-V installation

Kindly select the physical Ethernet adapter to host a Hyper-V virtual switch. vSwitch (External) makes it possible for VMs to communicate with the external network.

Note: This can be done later. Kindly refer to this guide on how to create the “External, Private and Internal vSwitch).

Screenshot-2021-07-07-at-19.44.37
Screenshot-2021-07-07-at-19.44.58

The configuration of this step depends on whether you have a cluster. I will be discussed how to set up a Hyper-V Cluster in my next guide.

Therefore, I will leave this windows as defaults and click on “Next“ to continue.

Screenshot-2021-07-07-at-19.46.29

I will leave this location as default. For your production setup, please specify where Hyper-V will store its virtual hard disk files and virtual machine configuration files.

Screenshot-2021-07-07-at-19.47.39

Configure Hyper-V on Windows Server

To avoid restarting the Server when a restart is needed, you can check the button “Restart the destination server automatically if required.” For this deployment, this is needed anyway, but I will still not check it.

Confirm you have selected the right role and mamangemt tools needed to administer Hyper. When done with the check, click on INSTALL.

Screenshot-2021-07-07-at-19.48.10

Once your installation of Hyper-V on Windows Server is complete, click on “Close” and ensure you close and initiate a restart yourself.

Screenshot-2021-07-07-at-19.49.47
Screenshot-2021-07-07-at-19.59.03

There are various ways to access the HyperV manager from the Server Manager console.

You can right click on the Hyper-V Server and select Hyper-V Manager or click on Tools from the Server Manager and select Hyper-V Manager

Screenshot-2021-07-07-at-20.04.32

Also, see How to Create Hyper-V Virtual Switch, and how to fix “An error occurred while attempting to connect to the server: Check if the Virtual Machine Management service is running or you are not authorized to connect to this server“.

Create vSwitch – Modes for the Hyper-V Virtual Switch

The Hyper-V virtual switch presents three different operational modes.

  • Private Virtual Switch: A Hyper-V virtual switch in private mode allows communications only between virtual adapters connected to virtual machines.
  • Internal Virtual Switch: A Hyper-V virtual switch in internal mode allows communications only between virtual adapters connected to virtual machines and the management operating system.
  • External Virtual Switch: A Hyper-V virtual switch in external mode allows communications between virtual adapters connected to virtual machines and the management operating system. It uses single or teamed physical adapters to connect to a physical switch, thereby allowing communications with other systems.

We will have to create the internal and Private vSwitch which we have not created uptill now. To do this, click on the Virtual Switch Manager as shown below.

Screenshot-2021-07-07-at-20.08.43

Select External Network

During our Hyper-V role setup, we created an external switch, therefore, we will have to rename it. To do this, click on the vswitch to open up the virtual switch Properties window.

Screenshot-2021-07-07-at-20.09.48-1024x649-1

In the name field, enter “External” and click on OK.

Screenshot-2021-07-07-at-20.10.17

To create an Internal switch, follow the same steps as discussed above. Click on Virtual Switch Manager. This will open the Virtual Switch Manager for the HyperV server.

Screenshot-2021-07-07-at-20.11.19-1024x653-1

Enter the Virtual Switch Name and click on Ok.

Screenshot-2021-07-07-at-20.12.00

Follow the same steps above to create a Private vSwitch. To do this, launch the virtual Switch manager and select the private vSwitch, and then click on Create Virtual Switch

Screenshot-2021-07-07-at-20.15.49

Enter the Private Virtual Switch Name as shown below and click on Ok.

Screenshot-2021-07-07-at-20.16.27

Part B: Install Hyper-V with PowerShell

You can install HyperV also via PowerShell and it is very straightforward. Start the PowerShell in an elevated prompt and run the below command and you have to restart after the successful installation.

Install-WindowsFeature -Name Hyper-V -IncludeManagementTools
Restart-Server

You can install Hyper-V with automatic restart also using the below command

Install-WindowsFeature -Name Hyper-V -IncludeManagementTools -Restart

Part C – Install Hyper-V with DISM

Start the PowerShell in an elevated prompt and run the below command and you have to restart after the successful installation.

dism /Online /Enable-Feature /FeatureName:Microsoft-Hyper-V /All

I hope you found this blog post on how to Install and Configure Hyper-V on Windows Server Server 2019, and 2022 via the Server Manager, PowerShell or DISM helpful. If you have any questions, please let me know in the comment session.

Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x