How to Recover Virtual Machine Data on Hyper-V Server 2019
Tags: testing, tutorial, beginners
Published: 2021-07-15 19:20:02

In this tutorial, we’ll explore installation and configuration of Hyper-V Server 2019 operating system. You’ll see how to create a virtual machine, recover data from a Hyper-V Server physical disk, from a virtual machine drive, and how to convert a virtual dynamic hard disk into a fixed-size one.

![How to Recover Virtual Machine Data on Hyper-V Server 2019](https://hetmanrecovery.com/pic/blog/a267/how-to-recover-virtual-machine-data-on-a-server-running-hyper-v-server-2019_en.jpg)

Hyper-V Server 2019 is a free operating system by Microsoft for hardware virtualization that lets you create and run virtual machines, each of them working as a full-featured computer with its own operating system and programs.

With Hyper-V, you can create as many virtual machines as you want, and have them running various operating systems, and do it on a physical Windows server. Hyper-V’s hardware resources and computing power let you isolate the guest operating system of the virtual machine from the server’s operating system which guarantees its uninterrupted work.

There are two versions of Hyper-V:

Hyper-V Server – an autonomous server that only contains a Windows hypervisor (Hyper-V).

And Windows Server with Hyper-V – an autonomous computer controlled by Windows Server operating system, where Hyper-V is enabled.

Now I’ll show you how to configure an autonomous Hyper-V Server containing only a Windows hypervisor.

##Installing Hyper-V Server 2019

![Installing Hyper-V Server 2019](https://hetmanrecovery.com/pic/blog/a267/01-en-microsoft.jpg)

An ISO image of Hyper-V Server 2019 can be downloaded from the Microsoft official website. To download the image, log in to your account, and the ISO download link will become active. For the download to start, fill in these fields.

![An ISO image of Hyper-V Server 2019](https://hetmanrecovery.com/pic/blog/a267/02-en-microsoft.jpg)

I recommend choosing the English version as it will make the configuration process easier, help you avoid errors, and let you fix possible errors more quickly.

![help you avoid errors](https://hetmanrecovery.com/pic/blog/a267/03-en-microsoft.jpg)

When the download is complete, you need to create a bootable drive, or boot from this image in any other way possible.

YouTube: {% youtube YUOLPBSgwI4 %}

The installation process is typical and looks like the installation of Windows 10 – just follow the wizard’s directions. There are hardly any peculiarities in installing Hyper-V.

YouTube: {% youtube lb7P2iATJwc %}

When the process is over, the operating system will ask you to change the administrator’s password. As you enter it, the hypervisor console appears.

![ask you to change the administrator’s password](https://hetmanrecovery.com/pic/blog/a267/04-en-hyper-v-server.jpg)

Hyper-V Server doesn’t have the Windows graphical interface we have all got used to. Many settings will require using the Command Prompt.

![Hyper-V Server doesn’t have the Windows graphical interface](https://hetmanrecovery.com/pic/blog/a267/05-en-hyper-v-server.jpg)

##Finding your way through Hyper-V Server settings
To change the operating system settings, you have two windows to work in, sconfig.cmd and the standard Command Prompt.

Initial configuration can be performed with the management console.

The first item on this menu lets you connect a server to the domain or workgroup.

Now change the server name – choose a name that is both short and informative, because you’ll be using it often during the configuration process. Agree to restart.

![Finding your way through Hyper-V Server settings](https://hetmanrecovery.com/pic/blog/a267/06-en-hyper-v-server.jpg)

The next item lets you add one more administrator. Give the name, and then the password.

![Give the administrator name, and then the password](https://hetmanrecovery.com/pic/blog/a267/07-en-hyper-v-server.jpg)

Another important thing to configure is to enable remote access to this computer. When you enable this option, you’ll be able to control your server remotely with Server Manager, MMC and PowerShell consoles, connect to it with RDP, check its availability with ping, and so on…

![able to control your server remotely](https://hetmanrecovery.com/pic/blog/a267/08-en-hyper-v-server.jpg)

The fifth item is Windows Update settings.

After that, you can install available updates.

There is one more important thing – enable RDP access. Type E to enable it, and 2 for all clients.

![enable RDP access](https://hetmanrecovery.com/pic/blog/a267/09-en-hyper-v-server.jpg)

The next item is network settings. To select a specific adapter, type its index – in my case, it is 3. Now press 1, set a static IP address (by pressing S), enter IP address, subnet mask and default gateway. Then 2 – set DNS servers. When this configuration is over, type 4 to return to the main menu.

![next item is network settings](https://hetmanrecovery.com/pic/blog/a267/10-en-hyper-v-server.jpg)

Set the date and time.

The last one is telemetry settings. Hyper-V doesn’t let you disable it, so select the mode you prefer. I choose the first option, Security.

![I choose the first option, Security](https://hetmanrecovery.com/pic/blog/a267/11-en-hyper-v-server.jpg)

That’s all about primary configuration, now let’s move on to connection settings.

##Configure connection to Hyper-V
To manage a server with Hyper-V Manager, you’ll need a computer with Windows 10.

To establish a connection, you should set the host name for the server on the client computer. Find and edit the file “hosts” on the Windows 10 computer. Add the IP address, press Space, type the name of the Hyper-V server. This is how it looks like:
```
192.168.1.111 WHS2019
```

![To establish a connection](https://hetmanrecovery.com/pic/blog/a267/12-en-hosts.jpg)

The account on the client computer should differ from the Hyper-V administrator account. Now you need to save your account data which is used to connect to the hypervisor. Launch the Command Prompt as administrator on the client computer and type this command:
```
cmdkey /add:server name /user:administrator name /pass:administrator’s password
```
![Launch the Command Prompt as administrator on the client computer](https://hetmanrecovery.com/pic/blog/a267/13-en-cmd.jpg)

In my case, I type this:
```
cmdkey /add:WHS2019 /user:Administrator /pass:123456
```

It gives the server name, administrator name, and password.

Configuring firewall in Hyper-V Server
By default, a firewall is enabled for the hypervisor to block any external connections. You should either disable it completely by running the following command:
```
netsh advfirewall set currentprofile state off
```

![You should either disable it completely by running](https://hetmanrecovery.com/pic/blog/a267/14-en-cmd.jpg)

Or add several permissions for remote management. Here are some commands to be typed in PowerShell. You can run this tool from the Command Prompt.

Type - powershell
```
powershell
```

And then run this:
```
Set-NetFirewallRule -DisplayGroup 'Windows Management Instrumentation (WMI)' -Enabled true -PassThru
```
```
Set-NetFirewallRule -DisplayGroup 'Remote Event Log Management' -Enabled true -PassThru
```
```
Set-NetFirewallRule -DisplayGroup 'Remote Volume Management' -Enabled true -PassThru
```

![Or add several permissions for remote management](https://hetmanrecovery.com/pic/blog/a267/15-en-cmd.jpg)

Now use the “ping” command to check the server availability by its name. Launch the Command Prompt as administrator on the client computer and type “ping” followed by the server name:
```
Ping WHS2019
```

![Now use the “ping” command to check the server availability by its name](https://hetmanrecovery.com/pic/blog/a267/16-en-cmd.jpg)

The server can be pinged all right, so let’s move on.

Start PowerShell as administrator and run this command:
```
winrm quickconfig
```

Type “y” to agree. This way, we have just configured the winrm service to run automatically and enabled remote management rules in the firewall.

![just configured the winrm service to run automatically and enabled remote management rules ](https://hetmanrecovery.com/pic/blog/a267/17-en-powershell.jpg)

Now you need to add the Hyper-V server to the list of trusted hosts with this command:
```
Set-Item WSMan:\localhost\Client\TrustedHosts -Value "WHS2019"
```
The last element is the server name.

![add the Hyper-V server to the list of trusted hosts](https://hetmanrecovery.com/pic/blog/a267/18-en-powershell.jpg)

The next step is to set permissions for the Anonymous Logon group. To do it, you have to start Component Services by running the command dcomcnfg in the Command Prompt.
```
dcomcnfg
```

Go to Component Services – Computers – My Computer. Right-click on My Computer and open Properties, jump to the tab COM Security.

Click Edit Limits in the Access Permissions section, scroll down and set remote access permission for the group Anonymous Logon - OK.

![Edit Limits in the Access Permissions section](https://hetmanrecovery.com/pic/blog/a267/19-en-component-services.jpg)

Installing Hyper-V Manager to a Windows 10 computer. Right-click on Start – Apps and Features – Programs and Features – Turn Windows features on or off. Find Hyper-V on the list, unfold it and check the box next to Hyper-V Management Tools - click OK.

![Installing Hyper-V Manager to a Windows 10 computer](https://hetmanrecovery.com/pic/blog/a267/20-en-hyper-v.jpg)

Wait until the installation is complete, and then connect to the remote server .

Open Start – Windows Administrative Tools – Hyper-V Manager – Connect to Server. In this field, type the Hyper-V server name.

![Open Start – Windows Administrative Tools – Hyper-V Manager – Connect to Server](https://hetmanrecovery.com/pic/blog/a267/21-en-hyper-v.jpg)

If you configured everything properly, you’ll be able to connect to the server and manage it.

Now that Hyper-V Server is installed, and the primary configuration for your connection is complete, the final step is to create a virtual machine.

YouTube: {% youtube 2FcU_3JGReI %}

How to recover data from a Hyper-V Server and virtual machine
When the operating system is damaged, the Hyper-V server’s hard disk is formatted accidentally, or the virtual machine is out of order, you can still read and extract the required information from the disk if you use a specialized tool - [Hetman Partition Recovery](https://hetmanrecovery.com/hard-drive-data-recovery-software).

Remove the hard disk from the Hyper-V server and connect it to a Windows computer. Download, install and run the program, open the disk and start the scan.

![Download, install and run the program](https://hetmanrecovery.com/pic/blog/a267/22-en-hetman-partition-recovery.jpg)

If the Hyper-V operating system has crashed, you still have good chances to recover virtual machine files from this drive. By default, they are stored in this directory:
```
С:\Users\Public\Documents\Hyper-V\Virtual hard disks
```
![If the Hyper-V operating system has crashed](https://hetmanrecovery.com/pic/blog/a267/23-en-hetman-partition-recovery.jpg)

Select the files you want to recover, click Recovery select where you want to save them, and click Recovery again. When the recovery operation is complete, the files will be placed into the specified directory.

![Select the files you want to recover](https://hetmanrecovery.com/pic/blog/a267/24-en-hetman-partition-recovery.jpg)

fter that, you’ll be able to connect a virtual machine and boot it.

##How to convert a dynamic virtual hard disk into a fixed-size one
When a virtual machine is created by the hypervisor, it receives a virtual hard disk which is dynamic by its type. Due to certain peculiarities of the file system and permanent defragmentation of such disks, deleted files are soon erased, so recovering data from images of such disks often ends in a failure. However, you can change the disk type in the virtual machine settings of your Hyper-V Manager.

![How to convert a dynamic virtual hard disk into a fixed-size one](https://hetmanrecovery.com/pic/blog/a267/25-en-hyper-v.jpg)

Select a virtual machine and open its Settings - in the window that opens, look to the left, select the hard disk, then look at the right side of the window, click Edit.

![Select a virtual machine and open its Settings](https://hetmanrecovery.com/pic/blog/a267/26-en-hyper-v.jpg)

Select Convert and click Next, and don’t change the disk format. At the next step, select disk type as Fixed size – Next.

![Select Convert and click Next](https://hetmanrecovery.com/pic/blog/a267/27-en-hyper-v.jpg)

In the process of conversion, the program will not change the main file of the virtual disk - instead, it will save its copy, but with the fixed size. Give the file name and click Next, and then hit Finish.

![the program will not change the main file of the virtual disk](https://hetmanrecovery.com/pic/blog/a267/28-en-hyper-v.jpg)

Wait until the virtual disk is converted.

Now let’s check if we managed to change the disk type. Click “Inspect” and you can see that the disk type has changed to fixed-size.

![Click “Inspect” and you can see that the disk type has changed to fixed-size.](https://hetmanrecovery.com/pic/blog/a267/29-en-hyper-v.jpg)

##How to recover data from a virtual disk image file
Now upload this file into our program. Open the tab Tools – Mount Disk, specify the path to the fixed-size virtual disk file and click “Open.” After that, it will appear in the Drive Manager.

![How to recover data from a virtual disk image file](https://hetmanrecovery.com/pic/blog/a267/30-en-hetman-partition-recovery.jpg)

All you have to do now is to scan it, select the necessary files and recover them.

![select the necessary files and recover them](https://hetmanrecovery.com/pic/blog/a267/31-en-hetman-partition-recovery.jpg)

You will find the recovered files in the directory you have chosen.