Windows Server 2019 CoreFebruary 15th, 2020, 01:52pm
Despite now utilizing Linux and KVM/libvirt for all of my virtualization needs, when I first re-built my lab back in 2018 the first thing that I had tried was Windows Server 2016 Core. Then upon purchasing my R620 I once again gave it ago, this time using Windows Server 2019 Core.
I did some chicken-scratch notes on my wiki at the time but wanted to eventually do a full write-up.
For my testing environment the goal was to setup the server in a way where the built-in quad gigabit NIC's would be utilized one for a management interface and the other three in a NIC team for the Hyper-V virtual switch (vSwitch). Hyper-V also obviously needed to be setup and configured with a few default VMs. Finally since it was running Server Core, remote management has to be enabled. As a bonus I also got Dell OMSA (OpenManage Server Administrator) installed.
Given that Windows Server Core comes with no GUI, upon booting the machine up
for the first time you will be presented with a command prompt window. To launch
PowerShell you can merely type
powershell at the prompt.
First start out by renaming the computer on the network and joining the current workgroup.
Rename-Computer -NewName "NATASHA" Add-Computer -WorkGroupName "KYAULABS"
Next pull up a list of all network interfaces on the current machine.
The two Dell servers I own both come with built-in quad-port NICs. I will be assigning one as a management interface and using the other three in a NIC team.
First create the NIC team, keep in mind if you need to specify a VLAN use the
-VlanID 123 option with the folowing command.
New-NetLbfoTeam -Name "Hyper-V Team" -TeamMembers "Ethernet 2", "Ethernet 3", "Ethernet 4"
You can verify this was done correctly.
Feel free to also rename the interfaces to make things easier.
Rename-NetAdapter -Name "Ethernet" -NewName "Management" Rename-NetAdapter -Name "Ethernet 2" -NewName "Ethernet Team 1" Rename-NetAdapter -Name "Ethernet 3" -NewName "Ethernet Team 2" Rename-NetAdapter -Name "Ethernet 4" -NewName "Ethernet Team 3"
Setting up DHCP is easy as it is the default option, no other configuration is needed.
In order to setup a static IP address, DHCP must be disabled and then IP information can be assigned.
Set-NetIPInterface -InterfaceAlias "Management" -Dhcp Disabled Set-NetIPInterface -InterfaceAlias "Hyper-V Team" -Dhcp Disabled
Remove the current IP information on the NICs.
Get-NetAdapter -InterfaceAlias "Management" | Remove-NetIPAddress Get-NetAdapter -InterfaceAlias "Hyper-V Team" | Remove-NetIPAddress
Set the IP information for both adapters.
New-NetIPAddress -InterfaceAlias "Management" -IPAddress 10.0.10.15 -AddressFamily IPv4 -PrefixLength 24 -DefaultGateway 10.0.10.1 New-NetIPAddress -InterfaceAlias "Hyper-V Team" -IPAddress 10.0.10.16 -AddressFamily IPv4 -PrefixLength 24 -DefaultGateway 10.0.10.1 Set-DnsClientServerAddress -InterfaceAlias "Management" -ServerAddress 10.0.10.1 Set-DnsClientServerAddress -InterfaceAlias "Hyper-V Team" -ServerAddress 10.0.10.1
Put both interfaces on Private Networks.
$Profile1 = Get-NetConnectionProfile -InterfaceAlias "Management" $Profile2 = Get-NetConnectionProfile -InterfaceAlias "Hyper-V Team" $Profile1.NetworkCategory = "Private" $Profile2.NetworkCategory = "Private" Set-NetConnectionProfile -InputObject $Profile1 Set-NetConnectionProfile -InputObject $Profile2
In order to be able to remotely manage the machine from another Windows machine, you must enable remote management access. Enable WinRM and remote authentication acceptance.
Enable-PSRemoting -Force Enable-WSManCredSSP -Role server
Finally firewall rules also need to be added.
Set-NetFirewallRule -DisplayGroup 'Windows Management Instrumentation (WMI)' -Enabled true -PassThru Set-NetFirewallRule -DisplayGroup 'Remote Event Log Management' -Enabled true -PassThru
After getting all of the IP information and remote management set up correctly it would be a good idea to restart the machine to confirm all of the changes.
After the machine has restarted re-open PowerShell and install Hyper-V and related pre-requisites.
Install-WindowsFeature -Name Hyper-V -IncludeManagementTools -Restart
Connection via Hyper-V Manager on a remote machine should now be available.
If you need to run the virtual machine without secure boot or with nested virtualization you can set these parameters with PowerShell on an individual VM basis.
Set-VMFirmware 'VMNAME' -EnableSecureBoot off Set-VMProcessor -VMName "VMNAME" -ExposeVirtualizationExtensions $True