Change the NIC address after cloning the Virtual Machine (RHEL) (1) Change the hostname
# vi /etc/sysconfig/networkNETWORKING=yesHOSTNAME=your-vm-hostname-here
(2) Change the NIC address
After cloning the RHEL6 virtual machine using virt-manager or virtual-box, you must manually change the NIC address.
First, View the Virtual Machine properties in virt-manager: View-> Details
Overview | Basic Details
Name: vm-rhel64-aa
UUID:6529d110-4191-e724-9c4d-aaa5db31fefd
NIC: 22: d6: 4b | Virtual Network Interface
Source device: Virtual network; default ': NAT
Device model: virtio
MAC address:52: 54: 00: 22: d6: 4b
Write down the UUID and MAC above.
1) log on to the VM and edit the file:
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
The content is as follows:
DEVICE=eth0HWADDR=52:54:00:22:D6:4BTYPE=EthernetUUID=6529d110-4191-e724-9c4d-aaa5db31fefdONBOOT=yesNM_CONTROLLED=yesBOOTPROTO=dhcp
2) delete the file: 70-persistent-net.rules
# rm /etc/udev/rules.d/70-persistent-net.rules
3) restart the system
# reboot
Now the VM should have a new hostname and MAC address.