Install & Remotely Manage Hyper-V Server 2016

Posted on • 12 min read

Tags: hyper-v, windows server, virtualisation

03/11/2018 - You may notice that all the images from within this post have gone "missing". I had issues with a VM migration that went slightly wrong. I'll need to manually re-create all of them... which will take a while :( The content is still here, but if you like pictures you'll be sad. Remember kids "the condition of any backup is unknown until a restore is attempted"!!

I started looking into Hyper-V Server last week when I noticed it on Microsoft Evaluation Center and realised that Microsoft offer it for free. So, I thought I'd write up the process I went through to get it installed and remotely manage it.

I have a computer I use for stuff like this, it's not the best in the world but I've "suped" it up a bit. It's running an Intel i5-4570 CPU @ 3.20 GHz, 20GB RAM, and a 480GB SanDisk SSD I had "lying" around, as well as two 1TB mechanical drives.

It does the job well enough for my needs, but going forward I only want it to do one thing, and that is for it to be my go-to machine for virtualisation.

The beauty of using Hyper-V Server for the job is that it doesn't seem to take up a lot of memory. I was using Windows 10 Pro previously, but there's a lot going on that takes away some of that valuable 20GB.
As you can see below, with no virtual machine's running my Hyper-V box is using just over 1GB of memory which means I can make full use of the remaining 19GB for VM's.

2018-07-23-19_40_54-PROXIMA---Remote-Desktop-Connection

What is Hyper-V Server exactly though? Well in the words of Microsoft:

Microsoft Hyper-V Server is a free product that delivers enterprise-class virtualization...

Couldn't put it simpler then that!

It's command prompt only but does still have a mouse cursor and graphical command prompt windows, but you won't be opening Control Panel on it and you certainly won't be playing Minesweeper...

You can still remote in to it using Remote Desktop Connection however, but one of the great things about it is you can remotely connect to it using Hyper-V Manager - although on a non-domain machine that takes some configuring - thankfully I've been through that pain, so you don't have too.


Downloading & Installing Hyper-V Server 2016

Downloading Hyper-V Server 2016

Let's start by downloading Hyper-V Server from Microsoft's Evaluation Center.

Fill in some details. They don't have to be real. When done, untick Yes and click Continue. I like to have some fun with the details I put in, hopefully Microsoft will appreciate my Rick and Morty mention...

2018-07-21-10_36_53-Window

Next you need to Select your language, and then you'll be able to click Download. It's a 2.6GB file and is an .ISO.

Once downloaded, it's time to install.

You could use a tool to make a bootable USB drive with the ISO or you could do the geeky thing and use DiskPart. If you do want to use a tool however, download Rufus. You'll probably be finished before me!

Using DiskPart to make a bootable USB disk

Grab yourself a USB disk you're willing to wipe and we'll use that to boot to the Hyper-V Server installation image. It should be at least 8GB storage wise.

Start by opening an elevated Command Prompt and type diskpart and Diskpart will open in the command prompt.

2018-07-21-11_16_57-Administrator_-Command-Prompt---diskpart

Type list disk to see a list of connected disks. Identify the disk number of your USB drive, in this case disk 1 and type select disk 1 (it should be obvious which one it is by the size - unless you're using a huge USB disk!).

2018-07-21-11_18_56-Administrator_-Command-Prompt---diskpart

We now need to "clean" the disk, which wipes all current configuration data. To do that we type clean into the prompt. All being well you'll get the below information returned.

2018-07-21-11_20_53-Administrator_-Command-Prompt---diskpart

Next up we need to create a new partition, and then select that partition. Type create partition primary and then select partition 1.

2018-07-21-11_30_00-Administrator_-Command-Prompt---diskpart

We're nearly there now, just a couple more steps.

Let’s format our newly selected partition. Type format fs=fat32 quick

Note: I'm formatting the drive to be UEFI compatible, so I'm using FAT32. If you just want it to be plain old BIOS compatible use NTFS instead of FAT32. E.g. format fs=ntfs quick.

All being well the disk will format and you'll be told the format was successful.

2018-07-21-11_31_43-Administrator_-Command-Prompt---diskpart

We now need to assign a drive letter. We can simple type assign letter=H . Feel free to replace H with whatever letter you want to assign to the drive. It doesn't really matter.

2018-07-21-11_32_57-Administrator_-Command-Prompt---diskpart

That's the preparation of the disk complete. We can now copy the ISO over using XCOPY. Type exit to leave DiskPart.

Extract the ISO you downloaded, and then rename the folder to something more manageable, like hyper-v-server.

In the command prompt, navigate to where you extracted the ISO. In my case it's in my Downloads folder, so I would type CD C:\Users\Jake\Downloads

Next, we'll set up the XCOPY command, so type xcopy hyper-v-server H: /S /E /F.
You should be able to see how that breaks down, but for more information on the structure and the flags you can type xcopy /? to view the help.

XCOPY will now run through the extracted ISO as it moves all the folders and files to the USB drive, it can take a couple of minutes so wait for it to finish and then it'll return you to a blank prompt like below and tell you how many files were copied.

2018-07-21-15_37_17-Administrator_-Command-Prompt

Once the copy finishes you are good to boot your computer from it. Make sure you configure your firmware to use UEFI and to boot from USB.

Installing Hyper-V Server 2016

Ironically the next steps are done in a Hyper-V virtual machine...

Once you get to the Install Microsoft Hyper-V Server 2016 screen after booting from your USB drive, select the language and time formats and click Next.

You can now click Install now.

2018-07-21-10_50_58-Window

It's just like any other Windows installation, so if you've done lots of them you'll be quite comfortable with this.

Accept the license terms and then at Which type of installation do you want? select Custom: Install the newer version of Hyper-V Server only (advanced).

2018-07-21-10_53_45-Window

Now we need to do some partitioning. On your main system drive (should be Drive 0 just in case you have multiple drives) delete all previous partitions (if you've backed them up) using the delete button, and then when it shows as one big lump of Unallocated Space click New and then Apply to confirm the changes.

2018-07-21-10_55_50-Window

You'll get the standard pop-up box from Microsoft to let you know they'll be creating some additional partitions. You can just click OK to these.

2018-07-21-10_56_35-Window

When the partitioning completes, your partitions will look like the below if you're using UEFI firmware.

2018-07-21-10_57_09-Window

You can now click Next.

2018-07-21-10_57_27-Window

Hyper-V Server 2016 will now begin to install.

All being well, it'll reboot a few times, and you'll face some screens a bit like the below screen.

2018-07-21-10_59_07-Window

It shouldn't take long to install at all, it's very light weight.

Setting up Hyper-V Server 2016

Eventually you'll be faced with a command prompt called LogonUI. You're going to need to set a password for the Administrator account before you can go any further.

2018-07-21-11_00_39-Window

Press Enter on Ok and enter a password.

2018-07-21-11_01_23-Window

The password will change, and you'll get confirmation it's changed. You can then hit enter on Ok again.

2018-07-21-11_02_03-Window

You'll now be faced with a blue command prompt, which allows you to configure your server, as well as a bog standard black command prompt hiding behind the blue one.

The blue command prompt is the Server Configuration (sconfig.cmd) prompt and it allows you to change some settings on the server.

At this stage I change a few things:

  • Workgroup
  • Computer Name
  • Remote Desktop
  • Telemetry Settings.

It's simply a matter of entering the number for the option you wish to select and following the prompts. For instance, if I want to enable Remote Desktop on this server I would do the following.

remote

At this stage you are good to go, the server is ready to use. However, you are probably going to want to manage it remotely, so if that's all you were after there's no need to read on, but if you're interested in remotely managing and remotely creating virtual machines on it then read on!

Connecting to Hyper-V Server using Hyper-V Manager in a Workgroup environment

Long title that, but hopefully it's clear what we're now going to accomplish.

Configure Hyper-V Server using sconfig.cmd

Join a Workgroup

Firstly, we need to add the server to our workgroup. I tend to rename my workgroup, so to change it on the server we would follow the below steps.

  1. Type 1 for Domain/Workgroup.
  2. Type W for Workgroup.
  3. Enter the name of your workgroup.

The server will then join the workgroup and confirm once it's joined.

2018-07-21-22_21_42-HVS2016-on-CENTAURI---Virtual-Machine-Connection

Rename the Server

I need a memorable name for my server. Going with the space theme, I'll be naming it PROXIMA. Follow the below steps.

  1. Type 2 for Computer Name.
  2. Enter your new computer name.
  3. The name will change and then you will be prompted to restart the server, which you can do.

2018-07-21-22_23_35-HVS2016-on-CENTAURI---Virtual-Machine-Connection

Enable Remote Access using RDP

It'll be handy to use Remote Desktop to manage your server, and it's simple to turn it on. I'd say it's much quicker than doing the same on Windows 10!

  1. Type 7 for Remote Desktop.
  2. Type E to enable Remote Desktop.
  3. Type 2 to allow clients running any version of Remote Desktop to connect.
  4. Clear the confirmation.

2018-07-21-22_25_18-HVS2016-on-CENTAURI---Virtual-Machine-Connection

That's all we need to do in the sconfig program.

Configure Hyper-V Server for Remote Management within a Workgroup

We need to switch to the black command prompt hiding in the background, and then in the command prompt type powershell to open PowerShell.

Next, we need to set the Connection Profile to Private. We can do this using the Set-NetConnectionProfile cmdlet.

Set-NetConnectionProfile -InterfaceAlias Ethernet -NetworkCategory Private

We should then check it's worked, by using the Get-NetConnectionProfile cmdlet.

Get-NetConnectionProfile

You should see that the NetworkCategory property shows as Private.

We now need to enable PowerShell remoting.

Enable-PsRemoting

Then we need to enable CredSSP on the Server.

Enable-WSManCredSSP -Role Server

That's all you need to do on the server side. Next steps are to configure the device you'll be remoting in from.

Configure a remote machine to remotely manage your Hyper-V Server within a Workgroup

First things first we need to enable Hyper-V Management Tools. We can do this simply using PowerShell or the GUI. I'll just show you how to do it in the GUI for now.

Open the start menu and search for turn windows features on or off

2018-07-24-07_16_09-Window

In the box that pops up you can then simply scroll down to Hyper-V, click the plus to open it and tick Hyper-V Management Tools.

2018-07-22-15_25_53-Windows-Features-1

You'll then get a box which goes through the short process of installing it and then you're good to go. No restart required.

2018-07-22-15_26_59-Windows-Features

Next let’s check if the network profile is set to Private or not, and if it's not change it. Type the following into an elevated PowerShell prompt.

Get-NetConnectionProfile

The cmdlet will return the below. It NetworkCategory shows as Public we need to change it to Private. If it shows as Private you can skip this step.

`Set-NetConnectionProfile -InterfaceAlias WiFi -NetworkCategory Private`

Substitute InterfaceAlias for whatever yours says.

You can then run Get-NetConnectionProfile afterwards to double check your now set to Private.

Next, we need to enable PowerShell remoting on our remote machine, which will start the WinRM service and automatically create a firewall exception for us.

Enable-PSRemoting

Then we need to add our Hyper-V Server to our TrustedHosts. You'll be prompted to continue, so just hit Y to do so.

Set-Item wsman:\localhost\Client\TrustedHosts -Value PROXIMA`

Then we need to enable CredSSP. Again, you'll be prompted to continue, so hit Y to move on.

Enable-WSManCredSSP -Role Client -DelegateComputer PROXIMA

All being well you should see an output in PowerShell like the below.

2018-07-22-15_19_08-Window

We're nearly there. We now need to make a change to the Local Group Policy on our machine.

Quickest way to do that is to hold Windows Key + R to open a Run command box. Then type in gpedit.msc to open the Local Group Policy Editor.

2018-07-24-07_49_06-Run

In the navigation tree, navigate to the following.

Computer Configuration > Administrative Templates > System > Credential Delegation.

Then in the right-hand panel look for and double click on Allow delegating fresh credentials with NTLM-only server authentication.

2018-07-22-17_29_34-Local-Group-Policy-Editor-1

Switch its state to Enabled, and under Options, click the Show button and add our Hyper-V server to the list wsman/SERVERNAME.

Once done, click OK and then OK again and close the group policy window.

2018-07-22-15_21_15-Window

2018-07-22-15_22_17-Show-Contents

Now we're finally there, it's time to test it out and connect to our remote Hyper-V server. Use the start menu to search for and open Hyper-V Manager

2018-07-22-15_30_16-Window

Under the Actions sidebar click Connect to Server...

2018-07-22-15_31_23-Hyper-V-Manager

You then need to enter the name of your Hyper-V server.

2018-07-22-15_31_52-Select-Computer

Then click the tick box for Connect as another user: and then press the Set User... button.

Enter the server name, and administrator username like SERVERNAME\Administrator and then enter the password and click remember me and hit OK.

2018-07-22-15_32_49-Windows-Security

You can now click OK to remotely connect to the server.

2018-07-22-15_33_36-Select-Computer

If you've done everything correctly you'll now be remotely connected to PROXIMA and can create and manage virtual machines on the server. How cool is that?

2018-07-22-15_34_10-Hyper-V-Manager

Thanks for following along, especially if you've got this far. The remote management side of this was initially quite challenging to get working, and I went down a few paths that turned up no results, but I had some helpful pointers when I stumbled across this site.

Let me know if you have any questions. I'll do my best to answer them.