Change network adapter type with PowerCLI

This posting is ~6 years years old. You should keep this in mind. IT is a short living business. This information might be outdated.

Today I found this neat PowerCLI One-liner in my Twitter timeline:

A nice side effect of this one-liner is, that the mac-address doesn’t change, as you can see in the screenshots.

change_adapter_type_vmxnet3

Patrick Terlisten/ www.vcloudnine.de/ Creative Commons CC0

change_adapter_type_e1000

Patrick Terlisten/ www.vcloudnine.de/ Creative Commons CC0

If you have ever changed the adapter type of a vNIC you will know, that this leads to a changed mac-address and a new adapter in the OS. Windows will show a “Local Area Connection 2”, Linux will show a eth1 instead of eth0. So you need to lend a hand. If you use Linux and you’ve changed the adapter type using this one-liner, everythings fine. eth0 will stay eth0, but the kernel loads another driver. No need to modify or delete the 70-persistent-net.rule file under /etc/udev/rules.d. But how does Windows handle it? Unfortunately Windows doesn’t handle it. Windows detects a new device, because the hardware ID changed.

change_adapter_type_e1000_hw_id

Patrick Terlisten/ www.vcloudnine.de/ Creative Commons CC0

change_adapter_type_vmxnet3_hw_id

Patrick Terlisten/ www.vcloudnine.de/ Creative Commons CC0

The only way to fix this, is to delete the old, non-present adapter. In order to do that, open a CMD and enter the following command:

Then open the Device Manager, choose “View” and click “Show hidden devices”. Then delete all non-present network adapters and the newly detected VMXNET3 adapter.

change_adapter_type_remove_e1000_devmgmt

Patrick Terlisten/ www.vcloudnine.de/ Creative Commons CC0

After that, right click the computer icon (in my case LABLAB-V4143BPG) and select “Scan for hardware changes”. Windows will detect a new VMXNET3 adapter, which you can finally configure with the hopefully documented IP settings.

Follow me

Patrick Terlisten

vcloudnine.de is the personal blog of Patrick Terlisten. Patrick has a strong focus on virtualization & cloud solutions, but also storage, networking, and IT infrastructure in general. He is a fan of Lean Management and agile methods, and practices continuous improvement whereever it is possible.

Feel free to follow him on Twitter and/ or leave a comment.
Patrick Terlisten
Follow me

Leave a Reply

Your email address will not be published. Required fields are marked *

I accept!