Hyper-V:Install: Difference between revisions

From Wiki³
No edit summary
Line 68: Line 68:
Finally reboot the machine to commit the machine name and IP changes.
Finally reboot the machine to commit the machine name and IP changes.
{{console|prompt=false|powershell=true|1=PS C:\> {{yellowBold|Restart-Computer}}}}
{{console|prompt=false|powershell=true|1=PS C:\> {{yellowBold|Restart-Computer}}}}
== {{Icon|notebook}} PowerShell ==
Since PowerShell will be used for a lot of the remote management it is a good idea to update to the latest [//github.com/PowerShell/PowerShell/releases version].
To install, copy to the server via windows SMB.
{{console|prompt=false|powershell=true|1=PS C:\> msiexec /i PowerShell-6.1.0-preview.3-win-x64.msi}}
= {{Icon24|sitemap}} Hyper-V Configuration =
You should now be able to connect to the machine remotely from Hyper-V Manager.
Be sure to run through the Hyper-V Settings, I typically setup a VM and VHD directory (eg. {{mono|D:\VMs\}}, {{mono|D:\VHDs\}}) and then enable {{mono|Enhanced Session Mode Policy}}.
Next open {{mono|Virtual Switch Manager}} and create a new {{mono|External}} virtual switch bound to the {{mono|Microsoft Network Adapter Multiplexor Driver}}.
Make sure {{mono|Allow management operating system to share this network adapter}} is enabled.


= {{Icon24|sitemap}} Dell OpenManage System Administrator =
= {{Icon24|sitemap}} Dell OpenManage System Administrator =
Line 84: Line 99:
Once installed a firewall rule will be needed to access OMSA from another computer.
Once installed a firewall rule will be needed to access OMSA from another computer.
{{console|prompt=false|powershell=true|1=PS C:\> {{yellowBold|New-NetFirewallRule}} {{white|-Name}} Dell_OMSA {{white|-DisplayName}} {{blueBold|"Dell OMSA"}} {{white|-Description}} {{blueBold|"Dell OMSA Web Management"}} {{white|-Protocol}} TCP {{white|-Enabled}} True {{white|-Profile}} Any {{white|-Action}} Allow {{white|-LocalPort}} 1311}}
{{console|prompt=false|powershell=true|1=PS C:\> {{yellowBold|New-NetFirewallRule}} {{white|-Name}} Dell_OMSA {{white|-DisplayName}} {{blueBold|"Dell OMSA"}} {{white|-Description}} {{blueBold|"Dell OMSA Web Management"}} {{white|-Protocol}} TCP {{white|-Enabled}} True {{white|-Profile}} Any {{white|-Action}} Allow {{white|-LocalPort}} 1311}}
= {{Icon24|sitemap}} Conclusion =
The server should now be completely setup for production VMs.


= {{Icon24|book-brown}} References =
= {{Icon24|book-brown}} References =

Revision as of 15:29, 7 July 2018

IconUNDER CONSTRUCTION: The document is currently being modified!
Icon  Back to Category:Windows

Icon Introduction

Microsoft Hyper-V Server 2016 is a stand-alone product that contains only the Windows hypervisor, a Windows Server driver model, and virtualization components. The Windows hypervisor technology in Microsoft Hyper-V Server 2016 is the same as what's in the Hyper-V role on Windows Server 2016.[1] Hyper-V Server has a Windows Server Core experience and as such doesn't have a graphical user interface (GUI).

Testing was done on my Dell PowerEdge R610, the following image was used:

Icon en_microsoft_hyper-v_server_2016_x64_dvd_9347277.iso

Icon Installation

Insert the Hyper-V Server boot media into the machine and reboot (or power on) the machine, booting from the inserted media. Follow the instructions on the screen to install and reboot.

IconHyper-V Server only requires ~32GB of hard drive space. Perform a "Custom" install, partitioning the C: drive accordingly, then assign the rest to D: for virtual machines.

Upon reboot you will be prompted to set an Administrator password, doing so will log into the machine finalizing the installation.

Use the command prompt provided to launch Windows PowerShell.

C:\> powershell

Icon Networking

Before Hyper-V itself can be setup, a strong networking backbone needs to be setup.

Rename the computer.

PS C:\> Rename-Computer -NewName SKYE

List the current network adapters.

PS C:\> Get-NetAdapter -Physical

The Dell R610 comes with a built-in quad-port NIC, one will be assigned to management while the other three will be teamed together for VMs.

First create the NIC team.

PS C:\> New-NetLbfoTeam -Name "Hyper-V Team" -TeamMembers "Ethernet 2", "Ethernet 3", "Ethernet 4"

Verify it created the team correctly.

PS C:\> Get-NetLbfoTeam
IconIf you need to specify a VLAN for the NIC team, use Set-NetLbfoTeamNic -Team "Hyper-V Team" -VlanID 123.

Rename the original adapters for consistency.

PS C:\> Rename-NetAdapter -Name "Ethernet" -NewName "Management"


PS C:\> Rename-NetAdapter -Name "Ethernet 2" -NewName "Ethernet Team 1"


PS C:\> Rename-NetAdapter -Name "Ethernet 3" -NewName "Ethernet Team 2"


PS C:\> Rename-NetAdapter -Name "Ethernet 4" -NewName "Ethernet Team 3"

Static IP

In order to setup a static IP address DHCP has to be disabled, the current IPs have to be removed, then new IPs can be assigned.

Remove DHCP from both adapters.

PS C:\> Set-NetIPInterface -InterfaceAlias "Management" -Dhcp Disabled


PS C:\> Set-NetIPInterface -InterfaceAlias "Hyper-V Team" -Dhcp Disabled

Remove the current IP addresses from both adapters (use A to choose Yes to All when removing).

PS C:\> Get-NetAdapter -InterfaceAlias "Management" | Remove-NetIPAddress


PS C:\> Get-NetAdapter -InterfaceAlias "Hyper-V Team" | Remove-NetIPAddress

Set the IP information for both adapters.

PS C:\> New-NetIPAddress -InterfaceAlias "Management" -IPAddress 10.0.42.10 -AddressFamily IPv4 -PrefixLength 24 -DefaultGateway 10.0.42.1


PS C:\> New-NetIPAddress -InterfaceAlias "Hyper-V Team" -IPAddress 10.0.42.11 -AddressFamily IPv4 -PrefixLength 24 -DefaultGateway 10.0.42.1

Also add DNS servers for both.

PS C:\> Set-DnsClientServerAddress -InterfaceAlias "Management" -ServerAddress 10.0.42.1


PS C:\> Set-DnsClientServerAddress -InterfaceAlias "Hyper-V Team" -ServerAddress 10.0.42.1

Icon Remote Management

In order to use RSAT and Windows Admin Center remotely a few changes need to be made.

Enable WinRM.

PS C:\> Enable-PSRemoting -Force

Enable remote authentication acceptance.

PS C:\> Enable-WSManCredSSP -Role server

Enable firewall rules for remote management.

PS C:\> Set-NetFirewallRule -DisplayGroup 'Windows Management Instrumentation (WMI)' -Enabled true -PassThru


PS C:\> Set-NetFirewallRule -DisplayGroup 'Remote Event Log Management' -Enabled true -PassThru

Icon Housekeeping

Remove Windows Defender.

PS C:\> Uninstall-WindowsFeature -Name Windows-Defender

Finally reboot the machine to commit the machine name and IP changes.

PS C:\> Restart-Computer

Icon PowerShell

Since PowerShell will be used for a lot of the remote management it is a good idea to update to the latest version.

To install, copy to the server via windows SMB.

PS C:\> msiexec /i PowerShell-6.1.0-preview.3-win-x64.msi

Icon Hyper-V Configuration

You should now be able to connect to the machine remotely from Hyper-V Manager.

Be sure to run through the Hyper-V Settings, I typically setup a VM and VHD directory (eg. D:\VMs\, D:\VHDs\) and then enable Enhanced Session Mode Policy.

Next open Virtual Switch Manager and create a new External virtual switch bound to the Microsoft Network Adapter Multiplexor Driver.

Make sure Allow management operating system to share this network adapter is enabled.

Icon Dell OpenManage System Administrator

If you are running this on a Dell server, you might also want to install OMSA. At this point you should be able to access the administrative shares for windows.

Copy the OMSA installer onto the Hyper-V Server using the admin shares (eg. \\SKYE\d$).

Run the EXE from the command prompt or PowerShell to extract to C:\OpenManage.

Run the pre-requisite checker.

PS C:\> C:\OpenManage\windows\PreReqChecker\RunPreReqChecker.exe /s

Provided no errors are seen, install OMSA.

PS C:\> msiexec /i C:\OpenManage\windows\SystemsManagementx64\SysMgmtx64.msi

During the installation it might be beneficial to choose Custom and then add the Remote Manager.

Once installed a firewall rule will be needed to access OMSA from another computer.

PS C:\> New-NetFirewallRule -Name Dell_OMSA -DisplayName "Dell OMSA" -Description "Dell OMSA Web Management" -Protocol TCP -Enabled True -Profile Any -Action Allow -LocalPort 1311

Icon Conclusion

The server should now be completely setup for production VMs.

Icon References