SHIFT

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

User Tools

Site Tools


vmwarenicchange
Differences

This shows you the differences between two versions of the page.

Link to this comparison view

vmwarenicchange [2013/04/20 13:43] (current)
sjoerd created
Line 1: Line 1:
 += VMware Change NIC VM Manually =
  
 +This is a procedure to change the network adapter of a VM after the [[vmhardwareupgrade|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
 +<​code>​
 +[root@ESXACC-02 ~]# vmware-cmd -l
 +...<​cut>​...
 +/​vmfs/​volumes/​8b5842d9-53d1244d-806c-00145ec26a9c/​WINXP-SJOERD/​WINXP-SJOERD.vmx
 +...<​cut>​...
 +</​code>​
 +
 +You could request all VMs Display Names and NIC Type like this:
 +<​code>​
 +for vm in `vmware-cmd -l`; do grep -i displayname "​$vm";​ grep -i '​ethernet..virtualdev'​ "​$vm"​ ; done
 +</​code>​
 +
 +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:​
 +<​code>​
 +netsh interface dump > netcfg.dat
 +</​code>​
 +
 +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:
 +<​code>​
 +netsh exec netcfg.dat ​
 +</​code>​
 +
 +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:
 +<​code>​
 +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
 +</​code>​
 +
 +> 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:
 +<​code>​
 +vi /​vmfs/​volumes/​8b5842d9-53d1244d-806c-00145ec26a9c/​WINXP-SJOERD/​WINXP-SJOERD.vmx
 +</​code>​
 +And find the section for the ethernet card:
 +<​code>​
 +ethernet0.present = "​true"​
 +ethernet0.networkName = "VLAN 666"
 +ethernet0.addressType = "​vpx"​
 +ethernet0.generatedAddress = "​00:​50:​56:​92:​99:​66"​
 +</​code>​
 +And add this line:
 +<​code>​
 +ethernet0.virtualDev = "​vmxnet3"​
 +</​code>​
 +Now it looks like this:
 +<​code>​
 +ethernet0.present = "​true"​
 +ethernet0.virtualDev = "​vmxnet3"​
 +ethernet0.networkName = "VLAN 666"
 +ethernet0.addressType = "​vpx"​
 +ethernet0.generatedAddress = "​00:​50:​56:​92:​99:​66"​
 +</​code>​
 +
 += After Changing the NIC =
 +
 +== VM ==
 +
 +Now you have to register and start the VM again:
 +<​code>​
 +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
 +</​code>​
 +
 +== 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 [[http://​support.microsoft.com/​kb/​315539|knowledgebase]]:​
 +
 +* Right-click My Computer.
 +* Click Properties.
 +* Click the Advanced tab.
 +* Click the Environment Variables tab.
 +* Set the variables in the System Variables box.
 +
 +<​code>​
 +devmgr_show_nonpresent_devices=1
 +</​code>​
 +    ​
 +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:
 +<​code>​
 +vmware-cmd /​vmfs/​volumes/​8b5842d9-53d1244d-806c-00145ec26a9c/​WINXP-SJOERD/​WINXP-SJOERD.vmx reset trysoft
 +</​code>​
 +[[http://​kb.vmware.com/​selfservice/​microsites/​search.do?​language=en_US&​cmd=displayKC&​externalId=1001805|Different types of NICs]] \\
 +[[http://​kb.vmware.com/​selfservice/​microsites/​search.do?​language=en_US&​cmd=displayKC&​externalId=1003020|KB article for manually changing the NIC]]
 +
 +{{tag>​vmware network}}
vmwarenicchange.txt ยท Last modified: 2013/04/20 13:43 by sjoerd