Sign In
Sign In

Installing and Configuring Hyper-V Server 2019

Installing and Configuring Hyper-V Server 2019
Hostman Team
Technical writer
Virtualization
01.11.2024
Reading time: 8 min

Hyper-V is a hypervisor that provides hardware virtualization. Each virtual machine operates on virtual hardware. Hyper-V allows you to create virtual hard disks, virtual switches, and other devices that can be added to virtual machines.

Hyper-V Installation

The installation involves activating the corresponding role in Windows Server 2019 Datacenter or Standard.

  1. Launch the Server Manager.

  2. Select Add Roles and Features.

  3. Choose Hyper-V from the menu.

  4. Click Add Features to add all necessary Microsoft Hyper-V components.

  5. Next, configure the roles. This is done in three sections.

    • First, Virtual Switches: Select a network interface. It will serve as the virtual switch for the hypervisor. Do not use the primary interface for this, as you will need it for physical access to the server.

    • The next section is Migration. You can leave the default settings as they suit our purposes.

    • On the Default Stores tab, also leave the standard parameters. You can change the directories where the virtual hard disk and VM configuration files are stored at any time in the hypervisor settings.

  6. You have prepared the configuration for installation. To start it, click on Install.

Hyper-V Configuration

The next step in working with Hyper-V is configuration. But first, check the server configuration. Launch the Run window (press Win+R) and execute the command sconfig.

In response, a window displaying the configuration will appear. There is a lot of information, so pay attention to these key parameters:

  • Domain/Workgroup — specified when creating the server.

  • Computer Name — also set in the previous step.

  • Configure Remote Management — enabled by default. This feature will be useful later for management through special utilities or the PowerShell console.

  • Remote Desktop — an option that allows you to manage the machine remotely, enabled by default.

  • Network Settings — network parameters of the virtual switch. You specified these when configuring the server while working with the Virtual Switches section.

You do not need to change or configure anything further if you created virtualization servers according to the previous section. You can proceed to remotely manage the server.

Remote Management

You can manage the server in two ways. The most convenient method is through the Windows Admin Center (WAC) web interface. You can download it for free from the Microsoft website: Windows Admin Center Overview.

When installing WAC, use the default settings; there is no need to change any configurations. After installation, you will gain access to the web interface, which should be opened by the name or IP address of the remote host.

Another management method is through the PowerShell console. You enabled this capability when you installed several components along with the hypervisor. To verify that everything is working, launch the PowerShell console and execute:

Get-Command –Module Hyper-V | Measure-Object

In response, you will receive the number of cmdlets designed to manage the infrastructure. These cmdlets duplicate the capabilities of WAC. The difference is that with the web interface, you click buttons, while in PowerShell, you input commands.

For example, you can check network settings through the console with:

Get-NetIPConfiguration

The same information is displayed when connecting to the server through WAC.

Another example is checking for IPv6 support. Execute the following command in PowerShell:

Get-NetAdapterBinding -InterfaceDescription "Hyper-V Virtual Ethernet Adapter" | Where-Object -Property DisplayName -Match IPv6 | Format-Table -AutoSize

If the Enabled field shows True, then IPv6 support is enabled on the Hyper-V Server. You can try to disable it using the command:

Disable-NetAdapterBinding -InterfaceDescription "Hyper-V Virtual Ethernet Adapter" -ComponentID ms_tcpip6

After executing this cmdlet, there will be no output; it simply quietly disables IPv6 support. You can check the status with another command:

Get-NetAdapterBinding

All of this can also be done using Windows Admin Center.

The choice between WAC and PowerShell depends on the tasks you need to accomplish. For example, WAC is good for quickly changing settings, while PowerShell cmdlets are convenient for automation. Suppose setting up a virtual machine is a routine task. It can be tedious to configure another host through WAC each time. In that case, you can write a script executing the required commands through PowerShell.

Firewall Configuration

To manage the Windows Server 2019 firewall, you can use Advanced Firewall rules. It’s more convenient to configure them through PowerShell. To see the list of available requests for regulating the firewall, execute:

Get-Command -Noun *Firewall* -Module NetSecurity

Set the rules for remote access. To do this, execute the following commands sequentially in PowerShell:

Enable-NetFireWallRule -DisplayName "Windows Management Instrumentation (DCOM-In)"
Enable-NetFireWallRule -DisplayGroup "Remote Event Log Management"
Enable-NetFireWallRule -DisplayGroup "Remote Service Management"
Enable-NetFireWallRule -DisplayGroup "Remote Volume Management"
Enable-NetFireWallRule -DisplayGroup "Windows Defender Firewall Remote Management"
Enable-NetFireWallRule -DisplayGroup "Remote Scheduled Tasks Management"

You can conveniently check the status through the Windows Admin Center web interface. Launch it, connect to the server, and go to the Firewall section. The rules are divided into three tabs: GeneralInbound, and Outbound.

Creating Disk Storage

You have already created disk storage. Remember the Default Stores section when installing Microsoft Hyper-V Server? In that section, you needed to specify a folder where all the data would be stored.
If you left the default settings, that’s okay. They can be changed at any time through the web interface.
The Hyper-V settings are located in the Settings section. Here, the same two folders that were available when creating the server can be modified.

  • The first directory is the Virtual Hard Disk Path. This is the path to the folder that serves as the virtual hard disk.

  • The second directory is the Virtual Machines Path. This is where the configuration files for the virtual machines are stored.

You can specify any directories to use for storing data and configuration files.

Configuring Virtual Machines

Hyper-V virtualization is needed to create virtual hosts on a single physical server. Let’s finally move on to this part.

Download a trial virtual machine for Hyper-V from the official Microsoft website. In it, you will find a trial version of the OS, Visual Studio, an included Linux subsystem with pre-installed Ubuntu, developer mode enabled, and a Windows terminal: Microsoft Developer Downloads.

The Windows 11 virtual machine can be created through the Windows Admin Center in just a few clicks.

  1. Launch the WAC web interface.

  2. Go to the Virtual Machines section.

  3. Create a new virtual machine.

  4. Specify the path to the extracted files of the trial image.

  5. Add the hard disk image.

  6. Click Create to start the virtual machine creation process.

You can also start the VM through WAC.

Creating Backups

For security and data preservation, it is necessary to create backups of virtual machines. Typically, the built-in utility wbadmin is used for this purpose. However, the default installation of Hyper-V does not add it to the server. To fix this, add a new role — Windows Server Backup.

  1. Open the Server Management Console.

  2. Click Add Roles and Features.

  3. Select Windows Server Backup from the list.

After adding the role, the wbadmin utility will be available on the server. To check that it is working and to get a list of all virtual machines, execute the command:

wbadmin get virtualmachines

The command will return a list of virtual machines. Note the host name for which you want to create a backup. You need to add it to the command syntax:

wbadmin start backup -backuptarget:D: -hyperv:"Windows11" -quiet

Replace "Windows11" with the name of your virtual machine. This command will initiate the backup creation process. After completing the process, a log will be saved in the backup folder.

You can also manage backups on Microsoft Hyper-V through the Windows Server Backup application.

  1. Open the Server Management Console.

  2. In the Tools menu, select Windows Server Backup.

  3. Open the Action tab and start a one-time backup — Backup Once.

  4. Select Different Options.

  5. Choose the Full Server configuration to back up all data on the server, including applications and even the system state.

  6. Specify a remote shared folder as the destination.

  7. Enter the address of the remote shared folder. Enable inheritance (the Inherit option) if you want the backup to be accessible to everyone who has access to the remote shared folder.

  8. Provide the credentials of a user with write permissions to the shared network directory.

  9. Confirm the backup configuration.

After the process is complete, open the remote shared folder you specified as the destination for the backup using File Explorer. You should see a directory named WindowsImageBackup containing the backup data.

Scheduled Backups

The utility for backups on MS Hyper-V Server can also be used to create backups on a schedule.

  1. In the Windows Server Backup application, select Backup Schedule.
  2. Specify that you need to back up the entire server.
  3. Configure the frequency of the backups. For example, you can set it to back up every day at 11:00 PM.
  4. Choose the destination; it can be a separate disk or a remote shared folder.
  5. Save the configuration.

You can flexibly configure the scheduled backup settings: change the time, store backups on separate disks, or transfer them to a network folder. The key is to ensure that the data is easy to restore. Windows Server Backup provides all the necessary tools for this.

Virtualization
01.11.2024
Reading time: 8 min

Do you have questions,
comments, or concerns?

Our professionals are available to assist you at any moment,
whether you need help or are just unsure of where to start
Email us