Table of Contents

VMware Change NIC VM Manually

Summary: How to manually change the NIC in an vSphere VM.
Date: Around 2011
Refactor: 1 May 2025: Checked links and formatting.

This is a procedure to change the network adapter of a VM after the hardware version has been upgraded to version 7. This is only compulsory when you were using the old VLANCE adapter. This adapter will simply disappear from your guest as it is no longer supported. As far as I've noticed all other adapters keep working fine (but should be upgraded to benefit from the new performance possibilities).

List all VMs

[root@ESXACC-02 ~]# vmware-cmd -l
...<cut>...
/vmfs/volumes/8b5842d9-53d1244d-806c-00145ec26a9c/WINXP-SJOERD/WINXP-SJOERD.vmx
...<cut>...

You could request all VMs Display Names and NIC Type like this:

for vm in `vmware-cmd -l`; do grep -i displayname "$vm"; grep -i 'ethernet..virtualdev' "$vm" ; done

See in the reources for a link with what the types stand for.

Before Changing the NIC

Record IP Address

Do record the IP-address, this will make it easier to configure the NIC after changing it, since it doesn't keep the IP-address. You could do this automatically like this:

Use the following command to backup your network configuration:

netsh interface dump > netcfg.dat

Use the following command to restore your network configuration. This only works if the name of the network connection is the same, most times Local Area Connections. New network connections get a sequence number so you should change the name of the network connection before you run the restore command:

netsh exec netcfg.dat

Another benefit from this way is that the file is readable by notepad in case restoring fails.

Note: This only works if the name of the network connect is the same, most times Local Area Connections. New network connections get a sequence number so you should change the name of the
Note: I had one problem though, even though it's meant to also save the DNS suffix this wasn't the case with me.

VM

Before you can manually change the NIC you'll have to shut the VM down and unregister it from the host/virtual center:

vmware-cmd /vmfs/volumes/8b5842d9-53d1244d-806c-00145ec26a9c/WINXP-SJOERD/WINXP-SJOERD.vmx stop trysoft
vmware-cmd /vmfs/volumes/8b5842d9-53d1244d-806c-00145ec26a9c/WINXP-SJOERD/WINXP-SJOERD.vmx stop hard
vmware-cmd -s unregister /vmfs/volumes/8b5842d9-53d1244d-806c-00145ec26a9c/WINXP-SJOERD/WINXP-SJOERD.vmx
Note that when the “stop trysoft” works you won't have to do the “stop hard” command.

Changing the NIC

Open the vmx file with your favourite and available editor:

vi /vmfs/volumes/8b5842d9-53d1244d-806c-00145ec26a9c/WINXP-SJOERD/WINXP-SJOERD.vmx

And find the section for the ethernet card:

ethernet0.present = "true"
ethernet0.networkName = "VLAN 666"
ethernet0.addressType = "vpx"
ethernet0.generatedAddress = "00:50:56:92:99:66"

And add this line:

ethernet0.virtualDev = "vmxnet3"

Now it looks like this:

ethernet0.present = "true"
ethernet0.virtualDev = "vmxnet3"
ethernet0.networkName = "VLAN 666"
ethernet0.addressType = "vpx"
ethernet0.generatedAddress = "00:50:56:92:99:66"

After Changing the NIC

VM

Now you have to register and start the VM again:

vmware-cmd -s register /vmfs/volumes/8b5842d9-53d1244d-806c-00145ec26a9c/WINXP-SJOERD/WINXP-SJOERD.vmx
vmware-cmd /vmfs/volumes/8b5842d9-53d1244d-806c-00145ec26a9c/WINXP-SJOERD/WINXP-SJOERD.vmx start

NIC Change

After the machine has started you have to enter the recorded IP settings. After configuring the NIC you'll be notified the IP-address is already assigned on a NIC on the system, it's just hidden:

vmwarenicchange.jpg


You can ignore this message by clicking “NO”.

Remove Old NIC

You should remove the old NIC since it's not longer present on the Windows VM anymore:

From the MS knowledgebase:

devmgr_show_nonpresent_devices=1

Now, open the device manager (devmgmt.msc), go to View and enable “Show hidden devices”. Go to the Network Adapters section and expand it. It should be really obvious what the old adapter is, it should be greyed out. Select it, right click and choose “uninstall”.

Resources

Extra command for rebooting the VM:

vmware-cmd /vmfs/volumes/8b5842d9-53d1244d-806c-00145ec26a9c/WINXP-SJOERD/WINXP-SJOERD.vmx reset trysoft