Setting the Loopback Adapter Connection to Private in Windows Vista

This one has been killing me for a while now and of what I noticed, a large number of other people. The problem is that after you install the Loopback Adapter under Vista, the virtual network is identified as public. That also makes your PC invisible to other machines and vice versa. This isn’t good as I am sure we are all setting up the Loopback Adapter to interact with virtual networks. I searched the net but couldn’t find an answer but finally I figured out a workaround. I have set my virtual machine’s IP address as the default gateway on the loopback adapter connection settings (IPv4). Vista then prompts me to set a location for this network. I was more than happy to set it as Private and even name it virtual network and change the icon. If you run multiple VMs you can always set one machine as the gateway while connecting only that one to the loopback adapter and connect all virtual machines together in an internal (virtual) network.

[Update] It appears that Windows identifies networks via the DHCP server. Some virtualisation software (VMWare Workstation is one of those) allows you to setup a DHCP server on your virtual network. I have to admit I am no longer affected by this issue as I have moved away from the Loopback adapter and I am now using Bridged Networking or NAT (Hyper-V and Oracle VirtualBox).

About Lambros Vasiliou

I work as SharePoint Lead Developer at Outsourcery in London. View all posts by Lambros Vasiliou

4 Responses to “Setting the Loopback Adapter Connection to Private in Windows Vista”

  • Unknown

    Wow, thanks! As you suggest, I have been searching for an answer for this for several days now… I’m using Windows 7 RC, and the same issue applies. Loopback Adapter defaults to "Public" no possibility to change it (that can’t be the desired behavior can it?). Nothing I have tried allowed me to connect to my VM until setting the loopback’s gateway to the VM’s IP.

  • Unknown

    OK, so, after working for a month or so, the connection has reverted to unidentified network, and no amount of uninstall/install, unenable/reenable changes the situation. The only changes to the systems have been windows updates, on the virtual machine and on the host machine. I’m not sure, but perhaps some security update broke this work around. Any other ideas?

  • James

    I cam across this quite some time ago and managed to find a powershell script to change how VMWare network adapters look to Vista. I modded it to also sort out the loopback adapter. I can’t remember where I got it from so unfortunatley can’t give creditPut the script below into a text file called VistaVMWareNetwork.ps1 and follow instructions in the comments of the script.# Set execution policy for powershell first set-executionpolicy unrestricted## see http://msdn2.microsoft.com/en-us/library/bb201634.aspx # # *NdisDeviceType # # 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. # # check the executionpolicy# PS> executionpolicy# Set run policy to unrestricted# PS> set-executionpolicy unrestricted## Usage: run in an elevated shell (vista/longhorn) or as adminstrator (xp/2003). # # PS> .\VistaVMWareNetwork.ps1 # boilerplate elevation check $identity = [Security.Principal.WindowsIdentity]::GetCurrent() $principal = new-object Security.Principal.WindowsPrincipal $identity $elevated = $principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) if (-not $elevated) { $error = "Sorry, you need to run this script" if ([System.Environment]::OSVersion.Version.Major -gt 5) { $error += " in an elevated shell." } else { $error += " as Administrator." } throw $error } function confirm { $host.ui.PromptForChoice("Continue", "Process adapter?", [Management.Automation.Host.ChoiceDescription[]]@("&No", "&Yes"), 0) -eq $true } # adapters key pushd ‘hklm:\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}’ # ignore and continue on error dir -ea 0 | % { $node = $_.pspath $desc = gp $node -name driverdesc if (($desc -like "*vmware*") -or ($desc -like "*Loopback*")) { write-host ("Found adapter: {0} " -f $desc.driverdesc) if (confirm) { new-itemproperty $node -name ‘*NdisDeviceType’ -propertytype dword -value 1 } } } popd # disable/enable network adapters gwmi win32_networkadapter | ? {(($_.name -like "*vmware*") -or ($_.name -like "*Loopback*"))} | % { # disable write-host -nonew "Disabling $($_.name) … " $result = $_.Disable() if ($result.ReturnValue -eq -0) { write-host " success." } else { write-host " failed." } # enable write-host -nonew "Enabling $($_.name) … " $result = $_.Enable() if ($result.ReturnValue -eq -0) { write-host " success." } else { write-host " failed." } }

  • 5 mistakes

    Your blog is really interesting to me and your topics are very relevant. I was browsing around and came across something you might find interesting. I was guilty of 3 of them with my sites. “99% of website managers are committing these five errors”. http://bit.ly/ts0ScL You will be suprised how easy they are to fix.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.