SHIFT

--- Sjoerd Hooft's InFormation Technology ---

User Tools

Site Tools


Sidebar

Recently Changed Pages:

View All Pages


View All Tags


LinkedIn




WIKI Disclaimer: As with most other things on the Internet, the content on this wiki is not supported. It was contributed by me and is published “as is”. It has worked for me, and might work for you.
Also note that any view or statement expressed anywhere on this site are strictly mine and not the opinions or views of my employer.


Pages with comments

View All Comments

vmwarenicchange

VMware Change NIC VM Manually

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

  • vmware-cmd -l
[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:

  • Right-click My Computer.
  • Click Properties.
  • Click the Advanced tab.
  • Click the Environment Variables tab.
  • Set the variables in the System Variables box.
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

Different types of NICs
KB article for manually changing the NIC

You could leave a comment if you were logged in.
vmwarenicchange.txt · Last modified: 2021/09/24 00:25 (external edit)