Migrate E1000 Adapter to vmxnet3 with Linux Virtual Machines

When you select Debian or Ubuntu as Operating System during the creation of virtual machines the wizard automatically selects E1000 as virtual network adapter. To get better network performance it is a best practice to change this to vmxnet3. But what if the virtual machine is already installed and running? The Adapter Type is grayed out, even when the virtual machine is powered off. How to change the Adapter Type later?

Change the Adapter Type with PowerCLI
The easiest method to change the adapter type is by using this little PowerCLI command. Just replace <VM> with your virtual machines name. You can run this script without disruption while the virtual machine is running but it's not active until you have powered off the virtual machine. A reboot does not activate the configuration.

Get-VM -name "<VM>" | Get-NetworkAdapter | Where { $_.Type -eq "E1000"} | Set-NetworkAdapter -Type "vmxnet3"

Prior to change please make sure that your operating system contains the vmxnet3 driver or you have installed the VMware Tools. To check the required kernel module type "modprobe vmxnet3". If you don't get an error message you should be fine.

Current Debian and Ubuntu releases have the driver installed by default:

  • Ubuntu 10.04 LTS
  • Ununtu 11.10
  • Ubuntu 12.04 LTS
  • Ubuntu 12.10
  • Debian 6.x

Beside the list this should probably work with any supported Linux based operating system.

Change the Adapter Type inside the vSphere Client
You can't change the adapter Type directly in the vSphere client, so you have to remove the adapter and add it again with the vmxnet3 type. Please be carefull with Red Hat (RHEL) for example, where the network devices are pinned to MAC-Addresses as this process generates a new MAC-Addresses.

Change the Adapter Type by editing the .vmx File
You can change the adapter type by editing the virtual machine configuration file. This can be done by connection the the ESXi host with SSH or by simply downloading, changing and uploading the configuration file. Steps:

  1. Power off the virtual machine
  2. Remove the virtual machine from inventory
  3. Change ethernetX.virtualDev parameter in the the .vmx File
  4. Register the virtual machine
  5. Power on the virtual machine

change-e1000-to-vmxnet3

 

Leave a comment ?

11 Comments.

  1. Thank you very much. It was such helpful tip. We had a outage when in we changed the Network card type by the method you described in "Change the Adapter Type inside the vSphere Client"

    Can you provide further information on "where the network devices are pinned to MAC-Addresses as this process generates a new MAC-Addresses". I have also created a small step by step guide on how to install Vmware tools on Linux. I would like your assistance in reviewing it.

    • In RHEL or CentOS for example you have the network adapter configured in /etc/sysconfig/network-scripts/ifcfg-ethX. There is the parameter called "HWADDR" by default, where the MAC-Address is configured. When you use the vSphere client to remove and add a new adapter you get a new MAC-Address and thus the server will boot without active network adapters. You have to edit the configuration file and change the HWADDR to the new MAC-Address.

      Feel free to send me your VMware Tools guide and i will review it. Would like to see whether you are using original VMware Tools, OSPs or open-vm-tools.

      • I think this is the exact thing happened with us. We changed the network card type and re-configured the IP but it couldn't reach the outside network.
        How can I get your email Id? I have tweeted you.

  2. Hello,

    Thanks for the post, I used your last method to switch interface configuration from Flexible to VMXNET3 in my VM.

    I am really hoping to workaround installing the VMware tools on this VM as it is quite specialized and doesn't have the proper toolchain for the install (no gunzip, no tar, no perl, etc).

    Would there be any drawbacks to having a Linux VM run VMXNET3 interfaces with the proper driver while not having installed VMware Tools?

    • I would not recommend using a virtual machine without VMware Tools. But there are no additional drawbacks, except the lack of additional VMware Tools features, when using VMXNET3 interfaces without VMware Tools.

  3. Nice post. Quick question - if you use the PowerCLI method does it retain the guest OS configuration? I've got quite a few servers I'd like to upgrade but resetting the IP/gateway on them all isn't feasible. Thanks.

    • It changes the driver only, the MAC address and PCI Bus ID retains. Maybe some Linux versions might have problems with that. I tested it with Debian/Ubuntu and RHEL5/6. No problems there...

  4. Top 10 Posts of 2013 | Virten.net - pingback on February 2, 2014 at 8:18 pm
  5. Thanks a lot for this post! It really saved me some time. :smile:

  6. I have forgot to remove the virtual machine from inventory...... Thank you very much

  7. Thank's for this post.

    If you choose incorrectly during the installation of the VM, Other gnu / linux instead of Ubuntu or Debian, you can not select vmxnet3 as network device. Although vmxnet3 module is loaded as a module (check with lsmod).

    By example, in the PowerCLI you will have the following error:

    The specified network adapter type 'Vmxnet3' is not supported by the guest os 'otherLinux64Guest'. Supported types are: e1000

    So pay attention to controlling that you have select Ubuntu or Debian xxx xxx. You can change the version, but only when the VM is stopped.

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Trackbacks and Pingbacks: