+3 votes
279 views
Create and configure Hyper-V virtual machine in another MV Windows Server 2016 or 2019

in Virtualization by (552k points)
reopened | 279 views

1 Answer

+4 votes
Best answer

1. Configure the Hyper-V role in the Windows Server 2019 Hyper-V virtual machine

Virtualization technology has become one of the best support and management tools not only for IT administrators , but for all users who are interested in trying new operating systems, new applications, etc. All this without investing in expensive hardware or without jeopardizing both the infrastructure and the operation of a real environment. Thanks to virtualization we can have several systems, even incompatible with each other, in a single physical device using all virtual machines the same disk resources, memory and CPU of the physical equipment, so that this translates into a centralized and complete administration ..

Hyper-V features
One of the best platforms for virtualization is Hyper-V, which is developed by Microsoft, and through which we have several features such as:
  • Nested virtualization
  • Host Resource Protection
  • PowerShell Direct
  • Creation of virtual machine control points using VSS
  • Storage replica
  • Hyper-V Administrator
  • Armored virtual machines and much more.

Now, as a rule, when we create a virtual machine, there is no compatibility to create another virtual machine within it for testing purposes, which can affect certain tasks. One of the most practical and useful virtual machines that we can create are the production machines with Windows Server 2016 operating systems, or the newest 2019 , and we may want to create within it a client machine to validate server roles, configuration of Policies and more.

TechnoWikis will explain how to create and configure a virtual machine within an existing virtual machine in Hyper-V with Windows Server 2016 or 2019 , for this study we will try to install a virtual machine with Fedora 29 in Windows Server 2019 from Hyper-V..

Initial requirements
The initial requirements we must have are:
  • The Hyper-V host and guest must have the Windows 10 / Windows Server2016 Anniversary Update or later.
  • Virtual machine configuration version 8.0 or higher.
  • An Intel processor with VT-x and EPT technology: nesting is currently only for Intel CPUs.
  • As a basic requirement we must create our Windows Server 2019 virtual machine in Hyper-V.
image
Note
The whole process is identical for Windows Server 2016.

1. Configure the Hyper-V role in the Windows Server 2019 Hyper-V virtual machine

Step 1

Once the Windows Server 2019 virtual machine is created, the next step is to enable the Hyper-V role which by default is disabled, for this we will go to the Server Administrator where we will see the following: image
Step 2

There we click on the “Add roles and features” line and the following wizard will be displayed: image
Step 3

There we click on Next and now we define the type of installation, in this case we select the option “based on features or roles”: image
Step 4

In the following window we select the server where the Hyper-V role is to be enabled: image
Step 5

In the following window, Server Roles, we locate the “Hyper-V” role: image
Step 6

When you activate your box, the following pop-up window will appear: image
Step 7

There we click on the “Add features” button and we will see that, as we have indicated, there is a compatibility failure as it is a virtual machine, we will see the following: image
Step 8

To correct this error, we must access Windows PowerShell as administrators and there execute the following syntax:
 Set-VMProcessor -VMName <VM Name> -ExposeVirtualizationExtensions $ true 
Step 9

Before executing this, the machine must be deactivated: image
Step 10

Now we can execute the command in PowerShell in order to enable nested virtualization which allows you to run Hyper-V inside a Hyper-V virtual machine (VM). When executing this cmdlet we will see the following: image
Note
If at any time we wish to disable nested virtualization, we will execute the following:
 Set-VMProcessor -VMName <VM Name> -ExposeVirtualizationExtensions $ false 
Step 11

Now, we start the virtual machine again and now we can see that the Hyper-V role can be activated normally: image
Step 12

With the active role, click on Next and you can skip the Features section to go to the “Hyper-V” window where we will see a brief summary of the role: image
Step 13

There we click on Next and then we can configure or not the virtual switches which allow communication with both the host computer and the external network: image
Step 14

In the next window we will have the option to enable the Windows Server 20109 virtual server so that you can send and receive virtual machine migrations live: image
Step 15

This is optional, now, in the following window we will see the routes where the values ​​of the virtual machines created are hosted: image
Step 16

Click on Next and we will see a summary of the role of Hyper-V: image
Step 17

Click on the "Install" button to start the process of installing this role in the Windows Server 2019 virtual machine: image
Step 18

Once this process is finished we will see the following message: image
Step 19

As we see, you need to restart the operating system for the changes to be applied: image
Step 20

After this, we will be able to log in and we will see that the Hyper-V role has been enabled in the Server Manager: image
image

Login Join up!


by (3.5m points)
edited

Related questions

+4 votes
1 answer
+5 votes
1 answer
asked Nov 3, 2022 in Virtualization by backtothefuture (552k points) | 81 views
+3 votes
1 answer
asked Mar 10, 2020 in Virtualization by backtothefuture (552k points) | 593 views
+3 votes
1 answer
+3 votes
1 answer
Sponsored articles cost $40 per post. You can contact us via Feedback

Most popular questions within the last 30 days

10,659 questions
10,791 answers
510 comments
3 users