Clone a Virtual Machine from the Command Line Using ESXi
It’s far simpler and quicker to duplicate or clone an existing VM, than it is to build one from scratch.
In this example you are cloning Host1 and calling it Host2
Note: Your datastore name may not be “datastore1”, so please modify these commands accordingly.
SSH into your ESXi host and create a directory to hold your new clone
This is the command line to clone (copy) your Host1 VM to Host2
Remember to use “-d thin” if you want to use thin provisioning for your virtual hard disks!
Register the Virtual Machine in ESXi
Creating a clone, from the command line, does NOT add it to your ESXi server’s inventory.
- Log in as root to the ESXi host with an SSH client.
- Run the command:
Note: Your datastore name may not be “datastore1”, so please modify this command accordingly.
I’ve had mixed results using this command to register the cloned VM. Sometimes it’s easier to run the New Virtual Machine wizard, select Custom, layout all the VM settings, then when its time to setup a Hard disk, select the option to use an existing hard disk and browse to the newly cloned vmdk file in the datastore.
This should be all you need to know to Clone a Virtual Machine from the Command Line Using ESXi.
Was this helpful?
If you found my posts interesting, or I helped you figure something out, please consider tossing me a tiny gratuity for my time, research, to help offset the web hosting/development costs or to buy me a cup of coffee.
* This post may contain affiliate links. This means that I “might” receive a tiny amount of money, if you make a purchase using one of our links. It does not cost you anything extra, and helps us defray the costs of hosting and maintaining this site.