Prepare RHEL 6 base VM image for cloning

When you install a fresh RHEL(/CentOS/Scientific Linux…) 6 VM and then clone it including MAC address change, it won’t get IP from DHCP because there is a persistent udev rule and a network script bound to the old MAC.

You can remove/modify them manually at /etc/udev/rules.d/ and /etc/sysconfig/network-scripts/ or you can use virt-sysprep to do it for you:

virt-sysprep --enable net-hwaddr,udev-persistent-net -d virt-vm-name

This tool can do more stuff to clean/configure your VM, see:

virt-sysprep --list-operations

You can run it on inactive virt domain (-d) or a disk image (-a).

blogroll

social