I was using my VM to create my previous post (How to query information from a zip code in SQL Server) and had some problems accessing the internet.
I have always used my VMs with the NAT (Network Address Translation) connection mode, which is the simplest and easiest of all to configure, works well and I have never had any difficulty with it. NAT mode allows your virtual machine to connect to the internal network using your physical machine's IP. For this reason, you cannot have more than one VM connected to the internet using the NAT connection.
As I had another VM running before opening this one, I was no longer able to use the network and did not want to close the other VM.
The solution to this problem is simple: Using mode Bridge VMware Player, which allows your VM to connect directly to the internet using your physical network card and assigning a unique LAN address to the VM. If your internal network has DHCP service, it will be responsible for providing a valid IP address for your VM itself.
This makes your VM available to your network as if it were a physical machine and you still have the advantage of being able to access services that are on that VM as a database, for example through the physical machine or other machines. from the Web.
Complications for our solution
After identifying the problem and defining the solution, we will deploy it. A task that seems simple, but proven otherwise.
On my physical machine, I have several network adapters:
- TAP-9 Local Connection (VPN)
- Wi-Fi (Where I am connected to the Internet)
- Ethernet (Connection via Network Cable - Disconnected)
- VMWare adapters
Note that VMware Player has created 2 network adapters for it to connect to:
- VMware Network Adapter VMnet1 for connection in Host-Only mode
- VMware Network Adapter VMnet8 for connection in NAT mode
The interface used by Bridge mode is VMNet0, which is not physical but virtual, where it is a pointing to a physical network adapter. The problem is that in environments with multiple adapters, this VMnet0 virtual connection may end up pointing to a network adapter that does not have an Internet connection, so you will not be able to use your VM in Bridge mode.
To make our problem a little more difficult, the installation of VMware Player DOES NOT COME with the virtual network configuration utility (Virtual Network Editor - vmnetcfg.exe).
Resolving Complications and Using the Bridge Mode VM
The first step we must do is to copy the virtual network configuration utility to the VMware Player installation directory. Download file vmnetcfg to VMware Player 7 and extract it to your VMware Player installation folder.
Because the settings are set to automatic, you are probably pointing to a connectionless adapter. Now, I will change the pointing to my physical machine's network adapter that is actually connected to the Internet:
After the changes are made, just restart the VM and it will have access to the network and the internet!
That's it, everybody!
Hope you enjoyed the post and see you next time!
If you also want to use VMware Player (which is free), but don't know how or are having difficulty installing, visit the post. Creating a virtual machine with VMware Player
UPDATE 22 / 03 / 2016:
vmnetcfg for VMware Player 12.1.0