Meza/Cloning VirtualBox VMs

From mediawiki.org

This manual explains how to create clones of your VMs. A clone is a copy of the entire VM. A snapshot is just a saved point of a VM in the configuration over time. Sometimes it is useful to have a clone of a VM. For example, you may wish to run more than one server at a time.

Case 1: Cloning after OS install, before dev-networking step[edit]

This assumes you setup your VM with the Meza/Install on Virtual Box, but you haven't done the sudo meza setup dev-networking step yet.

Run the following steps to create the clone VM:

  1. Shut down your VM with shutdown -h now
  2. In the VirtualBox Manager window, select your VM and click on the "Machine" menu
  3. Click "Clone"
  4. Name your clone
  5. Select "Reinitialize the MAC address of all network cards" and click "Next". This is necessary if you want to run the clones at the same time with successful networking capability.
  6. Select "Full clone" and click "Next"
  7. Select "Everything" and click "Clone"

Now you must do a little work to fix the networking settings for the clone:

  1. Start your VM
  2. Log in
  3. Open your VM network settings, find the MAC Address for Adapter 1
  4. vi /etc/sysconfig/network-scripts/ifcfg-eth0
  5. Change HWADDR to match your clone's Adapter 1 MAC Address
  6. rm -f /etc/udev/rules.d/70-persistent-net.rules

At this point you either need to reboot shutdown -r now or shut down shutdown -h now for the settings to update. Then your clone should have functioning networking. In this case, you can now follow the steps to set up SSH.


Case 2: Cloning after OS install, after dev-networking step[edit]

This assumes you setup your VM with the Meza/Install on Virtual Box, and you've already completed the sudo meza setup dev-networking step.

Run the following steps to create the clone VM:

  1. Shut down your VM with shutdown -h now
  2. In the VirtualBox Manager window, select your VM and click on the "Machine" menu
  3. Click "Clone"
  4. Name your clone
  5. Select "Reinitialize the MAC address of all network cards" and click "Next". This is necessary if you want to run the clones at the same time with successful networking capability.
  6. Select "Full clone" and click "Next"
  7. Select "Everything" and click "Clone"

Now you must do a little work to fix the networking settings for the clone. Note that for CentOS 7, some steps are not necessary.

  1. Start your VM
  2. Log in
  3. Optional: If you want to access this VM from a different IP address, change that in ifcfg-enp0s8 as well.

At this point you either need to reboot shutdown -r now or shut down shutdown -h now for the settings to update. Then your clone should have functioning networking.