# Part 2 - The Host and Hyper-V Configuration

## BEFORE YOU BEGIN

{% hint style="warning" %}
**Disclaimer**: All information and content in these blog posts is provided without any warranty whatsoever. The entire risk of using this information or executing the provided content remains with you. Under no circumstances should Microsoft, its author, or anyone else involved in the creation of these blog posts be held liable for any damage or data loss.
{% endhint %}

## HOST CONFIGURATION

In my previous blog post [Part 1](https://www.osdsune.com/home/blog/2020/configmgr-lab/part-1) I did a quick hardware configuration walk-through and installed Windows 10 on my host. In Part 2, I will walk you through the Hyper-V configuration and build a Virtual Machine for my Domain Controller (**DC**) where we in [Part 3](https://www.osdsune.com/home/blog/2020/configmgr-lab/part-3) will be setting up Active Directory, DHCP, and DNS.

After finishing the Windows 10 installation the first thing I want to do is change the computer name to eg. OSDSUNE-LAB-01 and then check for Windows Updates. Since my Windows 10 image is offline serviced every month, Windows Updates won't find anything exciting!&#x20;

If you don't offline servicing your Windows 10 image, my recommendation is that you run Windows Updates and get the latest cumulative and other updates installed before moving forward with the configuration.

### Windows Update

Log into the host we created in [Part 1](https://www.osdsune.com/home/blog/2020/configmgr-lab/part-1).

**Step 1.** Type "**Check for updates**" in the search line next to the start button, and click "**Check for updates**"

![Windows 10 (1909) - Windows Update](/files/-LyDyVM58pUHig_Z2Og7)

**Step 2.** Click "**Check for updates**" and wait.

![Windows 10 (1909) - Windows Update](/files/-LyDynA-QFcLimSCqu7R)

**Step 3.** After a few seconds it should start downloading and install required updates for the host.

![Windows 10 (1909) - Windows Update](/files/-LyDyxlG1dURyIB3EWk2)

**Step 4.** When it's done, reboot the host.

### Windows Features

After a reboot, log into the host again and we will now be adding the Hyper-V feature role to the host.

**Step 1.** In the search line, type "**Add features**" and click "**Turn Windows features on or off**"

![Windows 10 (1909) - Add Feature](/files/-LyE1OlGs1q1J75X54nz)

**Step 2.** Check the "**Hyper-V**" box and click "**OK**"

![Windows 10 (1909) - Add Feature](/files/-LyE2VNRGbrzMILOlk1s)

**Step 3.** Click "**Restart now**"

![Windows 10 (1909) - Add Feature](/files/-LyE3kSA9vffpsdl2uqs)

**Step 4.** After a reboot, log into the host and check for Windows Updates once again. In the search line, type "**Check for updates**" and click "**Check for updates**". The reason for this is that since we have add a new feature to Windows it need to re-apply the cumulative update in order for the feature to function correct.

![Windows 10 (1909) - Windows Update](/files/-LyE5_GotZt_n9-xEDmB)

**Step 5.** As mentioned it will re-apply the latest cumulative update. (And yes I has gone to the dark side...) reboot the host when it's done.

![Windows 10 (1909) - Windows Update](/files/-LyE67PIXKPhlDl4DqXQ)

## HYPER-V CONFIGURATION

After a reboot, log into the host again and we will start setting up the Hyper-V role.

{% hint style="info" %}

#### WHAT IS HYPER-V?

Hyper-V is Microsoft's Hypervisor, which give you the ability to run Virtual Machines (**Guests**) on a Physical Machine (**Host**).&#x20;

Hyper-V was introduced back in 2008, a lot has happened since then, and today Hyper-V is a great alternative to other Virtualization Technologies from eg. VMware and Citrix.
{% endhint %}

### Hyper-V NAT Virtual Switch

I will be using Windows PowerShell to create a Virtual Switch that uses Network Address Translation (**NAT**), this will keep the LAB environment separate from the rest of the network, but still provide internet access to the Virtual Machines.

{% hint style="info" %}
I will not be diving deep into the details about Virtual Switch or NAT, so please read this excellent [blog](https://www.petri.com/using-nat-virtual-switch-hyper-v) on this topic by [Aidan Finn](https://twitter.com/joe_elway) if you need more information.
{% endhint %}

**Step 1.** Open Windows PowerShell in Administrator elevated mode.&#x20;

![PowerShell - NAT Virtual Switch](/files/-LyGl256FaEISRI45Vrp)

**Step 2.** To create the Virtual Switch run the below New-VMSwitch command.

```
New-VMSwitch -SwitchName "NAT Switch" -SwitchType Internal
```

![PowerShell - NAT Virtual Switch](/files/-LyEQIzkis82UIvtDWMa)

**Step 3.** The below New-NetIPAddress command, assigns an IP address to the Virtual NIC. Which also will be the default gateway IP address for the NAT Network that we are creating.

```
New-NetIPAddress -IPAddress 192.168.0.1 -PrefixLength 24 -InterfaceAlias "vEthernet (NAT Switch)"
```

![PowerShell - NAT Virtual Switch](/files/-LyESNx3DWrDQXRhHh4B)

**Step 4.** The below New-NetNAT command assigns a private range of IP addresses that the Virtual Machines will use on the Virtual Switch we have just created.

```
New-NetNAT -Name "NAT Network" -InternalIPInterfaceAddressPrefix 192.168.0.0/24
```

![PowerShell - NAT Virtual Switch](/files/-LyEUj1OUjdfklp0LaLs)

We have now create a NAT Virtual Switch that will keep the LAB environment separate from the rest of the network, but still provide internet access to the Virtual Machines - Now That's Awesome!:sunglasses:&#x20;

### Hyper-V Manager

Now that we have configured the Virtual Switch, it's time to launch the Hyper-V Manager and configure a Virtual Machine for the Domain Controller.

**Step 1.** In the search line, type "**Hyper-V**" and click "**Hyper-V Manager**"

![Windows 10 (1909) - Hyper-V Manager](/files/-LyEZwbdnd7n45fzbr0T)

**Step 2.** Right-click on the Hyper-V Server and click "**Hyper-V Settings...**"

![Windows 10 (1909) - Hyper-V Manager](/files/-M-1m9znRBuTRbk4EQyB)

**Step 3.** You don't have to perform this step, but by habit I like to change the default path for Virtual Hard Disks and Virtual Machines. Leave the rest as default and click "**OK**"

![Windows 10 (1909) - Hyper-V Manager](/files/-LyEaBumsmSiJzjaRsiD)

**Step 4.** Open File Explorer and go to "**C:\Hyper-V**", confirm that the folders has been created.

![Windows 10 (1909) - Hyper-V Manager](/files/-LyEaI78qUk2D8nQpTqv)

**Step 5.** Right-click on the Hyper-V Server again, but this time you click "**New**" and then "**Virtual Machine...**"

![Windows 10 (1909) - Hyper-V Manager](/files/-M-1mQ48EQApqJ0tCgov)

**Step 6.** Click "**Next**"

![Windows 10 (1909) - Hyper-V Manager](/files/-LyEaZ-FU76UuM3E9ViG)

**Step 7.** Enter a name for the Virtual Machine (**DC**) and leave "**Location**" as default and click "**Next**"

![Windows 10 (1909) - Hyper-V Manager](/files/-LyEajmsj5fvkZPjfXwu)

**Step 8.** Select "**Generation 2**" and click "**Next**"

![Windows 10 (1909) - Hyper-V Manager](/files/-LyEaopiaME8GvMdpF-4)

**Step 9.** Type in the amount of memory (**RAM**) you want to dedicate to the Virtual Machine (I'll give a DC server, 4 GB of memory). Uncheck "**Use Dynamic Memory for this virtual machine**" and click "**Next**"

![Windows 10 (1909) - Hyper-V Manager](/files/-LyEawCifut4LYEiQUcl)

**Step 10.** Now select the newly created "**NAT Switch**" from the drop-down menu and click "**Next**"

![Windows 10 (1909) - Hyper-V Manager](/files/-LyEb1vSZrqE6x5OTtXo)

**Step 11.** Select "**Create a virtual hard disk**" and enter a name (**DC.vhdx**). Leave the "**Location**" and "**Size**" as default and click "**Next**"

![Windows 10 (1909) - Hyper-V Manager](/files/-LyEb6vhwyToSoMSNrCc)

**Step 12.** Select "**Install an operating system from a bootable image file**". Enter a path or browse to the "**Windows Server 2019**" ISO file and click "**Next**"

![Windows 10 (1909) - Hyper-V Manager](/files/-LyEbE1rV1gX3I7WcUlF)

**Step 13.** Review the settings and click "**Finish**" to create the Virtual Machine.

![Windows 10 (1909) - Hyper-V Manager](/files/-LyEbKqs4He601228tMJ)

**Step 14.** We should now see a new Virtual Machine in the Hyper-V Manager.

![Windows 10 (1909) - Hyper-V Manager](/files/-LyEbT1EleL5lFGx7lwa)

**Step 15.** Right-click on the Virtual Machine and then click "**Connect**"

![](/files/-M-1mi4mC_MmgNqtRJ4y)

**Step 16.** Select "**File**" and click "**Settings...**" or click Ctrl+O to enter the settings for the Virtual Machine.

![Windows 10 (1909) - Hyper-V Manager](/files/-M-1nB-e-GzPDKr8rtKp)

**Step 17.** Select "**Processor**" and change the "**Number of virtual processors**" to at least 2 and click "**OK**"

![Windows 10 (1909) - Hyper-V Manager](/files/-LyEbpdlasZq4mg2zeb1)

**Step 18.** Now click "**Start**"

![Windows 10 (1909) - Hyper-V Manager](/files/-LyEbyL9VoW1F6624vel)

**Step 19.** Windows Server 2019 are now ready to be installed on the Virtual Machine in [Part 3](https://www.osdsune.com/home/blog/2020/configmgr-lab/part-3).

![Windows Server 2019 - Installation](/files/-LyEc3S_j_0zTLv2ocQr)

And that's it, folks! This should conclude the host and Hyper-V configuration. In [Part 3](https://www.osdsune.com/home/blog/2020/configmgr-lab/part-3) I will walk you through the installation of Windows Server 2019 on my Domain Controller and we will be setting up a basic Active Directory, DHCP, and DNS configuration.

If you have any questions regarding this topic, feel free to reach out to me. I am most active on [Twitter](https://twitter.com/SuneThomsenDK)!


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.osdsune.com/home/archive/microsoft-configuration-manager/configmgr-lab/part-2.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
