VMWare ESXi

Clone VM on VMware ESXi using vmkfstools

Free version of VMware ESXi don’t provide option to clone virtual machine. If you want to clone a VM, you need to purchase expensive vSphere license.

There is a work around for this, you need to clone disk of an existing Virtual machine using vmkfstools.

To make clone of a VM disk, SSH into your VMWare ESXi server as user root. Then create clone of disk with

For new VM, i created a directory. Path to datastore directory may be differnt on your server, you can find it using “df -h” command and checking the file system.

Shutdown the Virtual Machine you want to clone the disk from. Run

In screenshot below, i first tried to clone with out creating destination folder. That resulted in error. After creating destination folder, vmkfstools command worked.

vmkfstools

Creating VM using cloned disk

Login to VMware ESXi web interface. Create a new VM. On the step where you select hardware, delete existing Disk. Add a new disk, browse and select the newly created clone disk. In this case – “/vmfs/volumes/disk2/ubuntu-clone/ubuntu-clone.vmdk”

VMWare ESXi

Once the VM creation is finished, you will be able to start the new VM. You can create a VM, then use it as template for creating new virtual machines.

See VMWare

Create VM

Create Virtual Machine in VMware ESXi Server

To create Virtual Machine, login to VMware ESXi, click on “Create/Register VM” link on top.

Create VM

On next page, it ask you to “Select creation type”.

Select “Create a new virtual machine”. Click next.

On next page, you need to “Select a name and guest OS”.

It ask for datastore, select the datastore you need to use for your VM.

On “Customize settings” page you need to select Virtual Machine CPU/RAM/Disk etc..

If you need to boot from ISO, set “CD/DVD Drive 1” to “Datastore ISO file”. This will show you datastore browser, you need to select the ISO file you need to install. Make sure you select “Connect at power on” option for VM to boot from ISO file.

On next screen, it shows information about the virtual machine you are going to create.

Click “Finish” to create the Virtual Machine.

Click on “Virtual Machines” link on left side menu, you will see all your Virtual Machines

Click on the VM to start the Virtual Machine, this will boot the VM from ISO, you can do the installation of Guest OS.

Posted in vmware