Networking does not work in a cloned Linux virtual machine
search cancel

Networking does not work in a cloned Linux virtual machine

book

Article ID: 337212

calendar_today

Updated On: 03-17-2025

Products

VMware vSphere ESXi

Issue/Introduction

  • The network configuration in the Linux Guest operating system still refers to the original MAC addresses.
  • Mismatch between the MAC addresses in the virtual machine settings and the Linux operating system.
  • Networking does not work in a cloned Linux virtual machine.
  • 3rd party VM recovery applications like Dell RecoverPoint, tasks fail guest OS customization.

Cause

This issue occurs when a virtual machine is cloned. The network adapter(s) are given new MAC addresses during the process.

Resolution

The MAC address of the NIC(s) in the Linux operating system must be changed post task completion.

Note: To perform these steps, you should be familiar with Linux commands.

Redhat

  1. Connect to vCenter Server using the vSphere Client
  2. Right-click the virtual machine and click Edit Settings.
  3. Click Network adapter and note the MAC Address.

    For example, you see a MAC Address similar to:

    ##:##:##:##:##:01

  4. Power on the Linux virtual machine.
  5. Open a console and log in as root.
  6. Change directory to etc/sysconfig/network-scripts.
  7. Edit "ifcfg-eth0" using a plain text editor and update the MAC address to reflect the MAC address in Step 3.

    For more information, see Adding/Deleting/Editing a host entry on vCenter server or ESXi host using vi editor.

  8. Activate the ethernet card by running this command:

    ifup eth0.

    Notes:
    • ifup eth0 may be required in some instances to activate the ethernet card.
    • The /etc/udev/rules.d/70-persistent-net.rules may also need to be updated to the new MAC address.

SUSE

  1. Connect to vCenter Server using the vSphere Client.
  2. Select the virtual machine and click Edit Settings.
  3. Click Network adapter and note the MAC address. For example, you see a MAC Address similar to:

    ##:##:##:##:##:AA
  4. Power on the Linux virtual machine.
  5. Change directory to /etc/sysconfig/network.
  6. Run this command:

    ls -l if*

    /etc/sysconfig/network # ls -l if*

    # ifcfg-eth-id-##:##:##:##:##:BB

  7. Rename this file to match the MAC address in Step 3:

    #mv ifcfg-eth-id-##:##:##:##:##:BB ifcfg-eth-id-##:##:##:##:##:AA

  8. Activate the ethernet card by running this command:

    ifup eth0

    Note: If the /etc/sysconfig/network/ifcfg-eth-id-MAC file (where MAC is the hardware address of the interface) does not exist, perform these steps:

  9. Change directory to /etc/sysconfig/network.
  10. Run touch command to create the file.

    For example:

    touch ifcfg-eth-id-##:##:##:##:##:AA

  11. Set full read/write/execute permission to the file.
  12. Copy the contents of the /etc/sysconfig/network/ifcfg-eth0 file to the /etc/sysconfig/network/ifcfg-eth- id-##:##:##:##:##:AA file.
  13. Open the /etc/sysconfig/network/ifcfg-eth-id-##:##:##:##:##:AA file using a text editor.
  14. Add "PERSISTENT_NAME=eth0" line to the end of the file.
  15. Save and close the file.
  16. Run this command to activate the ethernet card:

    ifup eth0

Note: Please refer Operating System vendor documentation for latest changes and updates related to  Network Management files and applications.

Additional Information