Let’s say you have a Windows computer with one network card. You are running VMWare on this computer, and you want to have network access from your Virtual Machine(s). There are many ways to accomplish this with VMWare, i.e. NAT, but for true separation you need another hardware network card.
This article explains how to create a setup where Windows uses one network card, and VMWare uses the other.
- Install the second network card and power on the Windows. Windows will automatically install the drivers and start using the second network adapter alongside the existing one – it will request an IP for both network adapters.
- Configure Windows to not use the second network adapter [VMWare KB]:
To disassociate the network adapter from all protocols except the VMware Bridge protocol:
- In the Windows host, open the network adapter settings within Control Panel.
- Windows XP – Click Start > Control Panel and open Network Connections.
- Windows Vista or Windows 7 – Click Windows > Control Panel and open View network Status and Tasks > Change Adapter settings.
- Right-click the network adapter and click Properties.
- Deselect all protocols except VMware Bridge Protocol.
- Click OK. The network adapter is now available in the Virtual Network Editor and is not used by the host. Virtual machines can use this adapter and the traffic does not have any effect on the host.
Next, we must create a properly bridged connection in VMWare [VMWare KB]. This will allow the VM to use the second network adapter.
- Open a VMWare Workstation window.
- Choose Edit > Virtual Network Settings.
- Configure one of the VMNet# interfaces to be Bridged. Select your second network adapter In the Bridged to dropdown. It should look somewhat like this:
Now, we must assign the Bridged interface to our Virtual Machine:
- Open the Virtual Machine Control Panel (Edit > Virtual Machine Settings).
- Select the adapter you want to modify
- Select Custom, and choose the VMnet virtual network you just configured from the drop-down list.
- Click OK to save your changes and close the Virtual Machine Control Panel.
Now after booting up your Virtual Machine, you will see that the VM’s connection is bridged through the second network adapter, and it should be fully functional. However, the MAC address your Virtual Machine uses is (by default) not the hardware address of the second network card. Instead, VMWare generates and uses a MAC address in a specific range.
If you want to use the original MAC address (of the new network card), use these steps [VMWare KB]:
- Open the virtual machine’s
.vmxconfiguration file with a text editor. For more information about editing a virtual machine’s configuration file (
.vmx) check out this page.
Remove the three lines from the configuration file that begin with:
To change the MAC address to a non-vmware address (in the case of a P2V where software on the PC is licensed against the original MAC address) add these lines to the .vmx:
ethernetN.addressType = “static”
ethernetN.address = “<address>”
- Save the configuration file.
For example, add these lines:
ethernet0.addressType = "static"
ethernet0.address = "01:2A:54:34:B3:FF"
Now the Virtual Machine will use the MAC address