So you’ve set up your Nano server to work as a Hyper-V host, and now you’re ready to configure your teamed VM switch. Except you’re on Nano and have no console to do it, and only two NICs. What to do?
Well, you can get there, it just takes a little bouncing around.
Configure one of your NICs (make sure to note the MAC address) with an IP on your network so that you can make a connection. Leave the other NIC unconfigured.
Now you can connected with PowerShell. You first have to add the IP of the remote Nano server to a Trusted Hosts list for WinRM:
Set-Item WSMan:\localhost\Client\TrustedHosts -Value 10.0.0.2
Now you can create your remote session:
Enter-PSSession -ComputerName 10.0.0.2 -Credential HostName\Administrator
Now get your network adapters:
If you want to rename them, do that now:
Get-NetAdapter -Name 'Ethernet' | Rename-NetAdapter -NewName Team1
Get-NetAdapter -Name 'Ethernet 1' | Rename-NetAdapter -NewName Team2
Check to see which NIC you’re using now. I’ll assume that is Team1, so we’re create your VM Switch with just Team2:
New-VMSwitch -Name TeamedvSwitch -NetAdapterName "Team2" -EnableEmbeddedTeaming $true -AllowManagementOS $false
Now check that the team was created correctly:
Now you can add a management NIC and configure it (replace values as necessary for your environment):
Add-VMNetworkAdapter -ManagementOS -Name "Management" -SwitchName "TeamedvSwitch"
Set-VMNetworkAdapterVlan -ManagementOS -VMNetworkAdapterName "Management" -Access -VlanId 2
New-NetIPAddress –InterfaceAlias "vEthernet (Management)" –IPAddress 10.0.2.2 –PrefixLength 24 -DefaultGateway 10.0.2.1
Set-DnsClientServerAddress -InterfaceAlias "vEthernet (Management)" -ServerAddresses 10.0.2.10,10.0.2.11
Now you need to exit your remote session:
Then set up a rule to allow a connection to the new Team:
Set-Item WSMan:\localhost\Client\TrustedHosts -Value 10.0.2.2
Now you can connect to the server on the new connection:
Enter-PSSession -ComputerName 10.0.2.2 -Credential HostName\Administrator
Now you just need to add the Team1 NIC into the team:
Set-VMSwitchTeam -Name TeamedvSwitch -NetAdapterName "Team1","Team2"
Now your team is set up and you’re ready to start setting up the rest of your server. Don’t forget to close out your session when you’re done.