10 August, 2011

Add a network adapter to your VMware VM

I recently downloaded 5 VMs from a cloud service my company is using, and 4 of them couldn't create a network connection. I discovered that the 4 that failed had named network connections for their network adapters, and that it required VMware Workstation to change (which I didn't have).

Through some research and help from others I discovered that additional network adapters could be added to an existing VM by editing its *.vmx file with a text editor such as Notepad. As noted in Step 2 of Jesin's Blog post, "Adding Custom Network Adapter in VMware Player", you can added a few lines to the end of the file to add the new network adapter.

I didn't follow Step 1, which is defining another network card on the Host, I just modified the file to use the existing network card. The key is to reference the next available network card in the VM and the network card reference in your Host. I did use the VMware Network Editor (vmnetcfg.exe), which came with the VMware Workstation trial, to identify the VMnetwork name (VMnet0) on my PC (the Host). I suspect if you're running this on a PC, yours will also have the same name (VMnet0).
Here's my entry:
ethernet1.present = "TRUE"
ethernet1.virtualDev = "vmxnet"
ethernet1.startConnected = "TRUE"
ethernet1.connectionType = "custom"
ethernet1.vnet = "VMnet0"
Be sure you add it to the end of the file, and replace ethernet1 with the appropriate value if there's already 2 or more network adapters defined (starts at 0).
Once the file has been updated, run the VM with VMware Player. If it doesn't immediately recognize the new adapter and connect the network, then restart the VM OS and it should recognize the new adapter.

No comments: