mcottondesign

Loving Open-Souce One Anonymous Function at a Time.

How to replicate ubuntu vm on ESXi

I wanted to deploy multiple copies of a base ubuntu server, easy right?

Well it is now, but it took me a while to get it right. The whole problem comes from not having 'sysprep' for linux. (They probably have a much better way and I just don't know it). Because ESXi makes up a fake MAC address for the network interface, it is smart enough to make up a new MAC for the new machine. Your old VM is still expecting the old network settings and needs a minor change. I'm not changing the hostname, ssh keys, users, or any of that other jazz; just getting the network up and running.

  • browse the datastore
  • find the Ubuntu directory
  • make a new folder
  • copy the VM to the new folder
  • right click on the vmx file and 'add it to inventory'
  • start the new VM
  • vSphere will ask if you moved or copied it, answer that you copied it
  • log into your new VM from the console
  • figure out what the new interface is: ifconfig -a | grep 'eth'
  • it will most likely be eth1
  • sudo vi /etc/network/interfaces and change eth0 to the new interface eth1
  • save, reboot

You know have a clone of the first machine with a new MAC and IP address. I will revise this as I learn more and my process becomes more automated.