VirtualBox Unidentified Network

February 2nd, 2012

Thanks to Oisin Grehan and his Nivot Ink blog for providing the foundation of this post!
VMWare VMNET Adapters Triggering Public Profile for Windows Firewall


I use Oracle’s VirtualBox to run x64 SharePoint virtual machines from my laptop. I’ve also noticed an Unidentified Network in my Windows 7 list of networks. That is caused by VirtualBox’s Host-Only Network Adapter. It wasn’t harming anything at the time so I left it alone.

However, I later attempt to enable PowerShell remoting on my host laptop for work with SharePoint scripting. Upon doing so, I was greeted with the following error message while attempting the Enable-PSRemoting cmdlet:

Set-WSManQuickConfig : WinRM firewall exception will not work since one of the network connection types on this machine is set to Public. Change the network connection type to either Domain or Private and try again.

Another helpful error message! That seems easy enough; Windows makes it very easy to modify the settings for each individual network adapter to Private, Work, or Public depending on your personal preference. However, this is not the case with an unidentified network. With an unidentified network, Windows sticks to its Public settings and will not change it.

So can I now not enable PowerShell remoting since I can’t remove the Public designation of VirtualBox’s unidentified network? No! VirtualBox’s Host-Only network isn’t really a true network connection at all. It is an endpoint adapter. Kudos to Oisin Grehan for developing a nice PowerShell script that will solve the issue by telling Windows, via the registry, that the network adapter is an endpoint device and not a true external network connection. This will cause Windows to stop treating the VirtualBox Host-Only adapter as a network and thus remove the unidentified network (and its public designation) from my list of networks. Problem solved! I’ve modified Oisin’s script to account for VirtualBox’s Host-Only instead of VMware adapters.

Note: This script will need to be executed every time VirtualBox is updated because the update will replace the existing adapter and cause the settings in the registry to be lost.

Tags: , , ,

5 Responses to “VirtualBox Unidentified Network”

  1. Deploying a .Net Web Application to IIS with Powershell | codealoc Says:

    […] Run this powershell script: http://sharepoint.smayes.com/2012/02/virtualbox-unidentified-network/ […]

  2. jrg Says:

    Hi,
    wait a minute. It is very interesting… but it fails on my pc. It tried following use cases:
    – execute the above script on the host -> the adapter disappears as described, but then when I call Enable-PSRemoting, I get the same error…
    – execute the above script on the guest (by changing “*virtualbox host-only*” by “*Intel(R) PRO/1000 MT Desktop Adapter*”) –> fails exactly in the same way…

    … need help …!
    jrg

  3. Steve Mayes Says:

    JRG – The script above is just to get the VirtualBox adapter to disappear. It’s possible that you could continue getting the same error (even after running the script) due to another public network on your PC. Make sure that all of your networks do not appear as public networks!

    Best of luck,
    Steve

  4. kiquenet Says:

    What about this?

    $nlm = [Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]”{DCB00C01-570F-4A9B-8D69-199FDBA5723B}”))
    $connections = $nlm.getnetworkconnections()
    $connections |foreach { if ($_.getnetwork().getcategory() -eq 0) { $_.getnetwork().setcategory(1) }
    }

    Which is better solution ?

    Use
    $nlm.getnetworkconnections
    or
    modify NdisDeviceType in “HKLM:\SYSTEM\CurrentControlSet\Control\Class\*”

    https://powertoe.wordpress.com/2009/12/28/enable-powershell-remoting-while-running-vmware-workstation-in-a-domain

    thx

  5. Steve Mayes Says:

    kiquenet – Great blog post. I agree that there is always more than one way to do something. I had found some articles that led me to changing the registry and it appears your version uses COM to make the registry changes (and perhaps do other necessary changes along with the registry change). The key to my code was getting the device to behave as an endpoint instead of a network interface. Assuming that the setcategory method does just that when given a parameter 1, your code should also do the trick! Thanks for the tip.

Leave a Reply