FIX: VirtualBox Host-Only Network Adapter Creates a Virtual “Public Network” Connection That Causes Windows to Disable Services
September 18, 2010 12 Comments
VirtualBox creates a “VirtualBox Host-Only Network” device which is essentially a loopback adapter for creating network connections between virtual machines and between the host and virutal machines. Unfortunately, it shows up to Windows as an unidentified public network. Connecting to a “public network” ratchets up your firewall and disables network discovery and SMB/CIFS network shares. This is kind of a big side effect of installing some VM software.Fortunately, Windows does have a way to mark a network device as virtual by creating a registry value.
The type of the device. The default value is zero, which indicates a standard networking device that connects to a network. Set *NdisDeviceType to NDIS_DEVICE_TYPE_ENDPOINT (1) if this device is an endpoint device and is not a true network interface that connects to a network. For example, you must specify NDIS_DEVICE_TYPE_ENDPOINT for devices such as smart phones that use a networking infrastructure to communicate to the local computer system but do not provide connectivity to an external network.
This powerhsell script will find the “VirtualBox Host-Only Ethernet Adapter device entry in the registry and adds the ‘*NdisDeviceType’ value of 1. After reboot, the “VirtualBox Host-Only Ethernet Adapter” will no longer be monitored by the Network and Sharing center.
# tell windows that VirtualBox Host-Only Network Adapter # is not a true network interface that connects to a network # see http://msdn.microsoft.com/en-us/library/ff557037(VS.85).aspx pushd echo 'Marking VirtualBox Host-Only Network Adapter as a virtual device.' cd 'HKLM:\system\CurrentControlSet\control\class\{4D36E972-E325-11CE-BFC1-08002BE10318}' ls ???? | where { ($_ | get-itemproperty -name driverdesc).driverdesc ` -eq 'VirtualBox Host-Only Ethernet Adapter' } |` new-itemproperty -name '*NdisDeviceType' -PropertyType dword -value 1 echo 'After you reboot the VirtualBox Host-Only Network unidentified public network should be gone.' popd