28 January 2013

PowerShell to "Allow management operating system to share this network adapter"

When you are configuring Hyper-V switches one should always keep in mind that the host needs a communication network too.   I was busy configuring network teams and virtual switches when I successfully managed to configure the following.  Three virtual switches, consuming all of the 5 network adapters, not one of them set to   "Allow management operating system to share this network adapter."

The net result of this configuration is that all the virtual machines are on the network and working perfectly but the host itself is not!  This effectively also cuts off all remote administration and ability to fix this remotely. One more thing....  I am using Hyper-V Server so no GUI tools to help out.

There was nothing left to do but physically log onto the host and fix it with PowerShell

First up check that all the NIC are up and running

Get-NetAdapter



Next up you need to get a list of the virtual switches and pick one to share with the host

Get-VMSwitch


Now you need to check the configuration of the switch.  In my case it is "Corporate Team"

Get-VMSwitch -name "corporate team" |select *

You will probably notice that the AllowManagmentOS value is False.  To chnages this and fix the problem you need to turn it on with the following command

Set-VMSwitch -name "corporate team" -AllowManagementOS 1



Once this has had a minute or so to readjust thing you should now be able to remote manage and connect to the host again.

2 comments:

Anonymous said...

Thank you!

I had locked myself out of my host server this way and no GUI version either. This did the trick. :)

Anonymous said...

Excellent article.
Thank you so much.

Post a Comment