Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Standalone ESXi (4.1) host without any vCenter Server.

How to backup virtual machines as quickly and storage-friendly as possible?

I know I can access the ESXi console and use the standard Unix cp command, but this has the downfall of copying the whole VMDK files, not only their actually used space; so, for a 30-GB VMDK of which only 1 GB is used, the backup would take 30 full GBs of space, and time accordingly.

And yes, I know about thin-provisioned virtual disks, but they tend to behave very badly when physically copied, and/or to blow up to their full provisioned size; also, they are not recommended for actual VM performance.

It is ok for me to shut down the VMs before backing them up (i.e. I don't need "live" backups); but I need a way to copy them around efficiently; and yes, a way to automate shutdown/startup when taking a backup would also help.

I only have ESXi; no Service Console, no vCenter Server... what's the best way to handle this task? Also, what about restores?

share|improve this question

My preferred solution for this is to simply export them to an ovf or ova file using either the vSphere client or the command line ovftool.

In the vSphere Client, make sure the VM is off, then highlight it and go to File->Export->Export OVF Template. Then just follow the prompts.

Restoring is a piece of cake, just do the reverse (the menu option is "Deploy OVF template", I think).

You may also wish to check out some of the options at, I know these are very popular and I think there are some good choices for backups, although I haven't looked at any of them too recently.

share|improve this answer
OVF backup and restore seems to work great as a poor man's VMWare backup option. Eventually I intend to automate using the cli ovftool, but shutting down the vm inside the script while the backup runs will be the tricky part. – steampowered Nov 24 '15 at 16:33

I don't know if this fits the bill for you, but VM Explorer does a nice job of performing hot or cold backups of virtual machines. I believe that with ESXi 4.1 VM Explorer allows you to perform VM guest backups from one host to another host as well.

share|improve this answer
I will have to look at this more but right from the start I see something I like - Licensed per installation. – Chadddada Sep 16 '11 at 13:33
The basic version is free – Matthew Lock Jul 5 at 7:48

Ghetto VCB can do the backup while the machine is running. For the space you can use a deduplication+compression filesystem like lessfs on the backup server.

share|improve this answer
If you don't mind the VMs being stopped during some minutes you can have unattended backups with automatic space provisioning in the backup disk and a detailed report by e-mail after each backup cicle with XSIBackup a free Open Source command line tool that executes directly in the ESXi Hypervisor and can be programmed directly in the root crontab – Daniel J. Sep 7 '13 at 13:37
up vote 2 down vote accepted

I ended up writing a script which copies the VM configuration files and uses vmkfstools -d to clone the VMDKs while preserving the thin provisioning.

For reference:


if [ $# != 2 ]; then
        echo "Usage: $(basename $0) <SOURCE VM PATH> <DESTINATION PATH>"
        echo "Example: $(basename $0) /vmfs/volumes/datastore1/VM1 /vmfs/volumes/datastore2"

vmx=$(basename $(/bin/ls $1/*.vmx))
name=$(grep displayName $1/$vmx | /bin/awk -F\" '{print $(NF-1)}')
vmxf=$(grep vmxf $1/$vmx | /bin/awk -F\" '{print $(NF-1)}')
nvram=$(grep nvram $1/$vmx | /bin/awk -F\" '{print $(NF-1)}')
vmdks=$(grep vmdk $1/$vmx | /bin/awk -F\" '{print $(NF-1)}')

echo "Started copying VM $name"

vmdir=$(basename $1)

echo "Source path: $1"
echo "Destination path: $destpath"

echo "Creating destination path $destpath"
/bin/mkdir -p $destpath

echo "Copying configuration files:"
echo $vmx
/bin/cp $1/$vmx $destpath
echo $vmxf
/bin/cp $1/$vmxf $destpath
echo $nvram
/bin/cp $1/$nvram $destpath

echo "Copying virtual disks:"
for vmdk in $vmdks;
        echo $vmdk
        /sbin/vmkfstools -d thin -i $1/$vmdk $destpath/$vmdk

echo "Completed copying VM $name"

This requires the VM to be powered off and have no active snapshots.

share|improve this answer
Hi, what about thick lazy? – rovshango Sep 9 '15 at 19:22

You can have unattended backups with automatic space provisioning in the backup disk and a detailed report by e-mail after each backup cicle with XSIBackup a free Open Source command line tool that executes directly in the ESXi Hypervisor, now capable of hot backups with no downtime, and it can be programmed directly in the root crontab

share|improve this answer

I'm exporting to OVF format, too. It's fine because it compress on the fly the image with gzip.

But the licenses are gone, because with importing an OVF file into an ESXI a machine with new hardware is created.


I backup (download) the file folder of the virtual machine without the big image and compress them.

Both - ovf folder and compressed copy of virtual image files (without big image) - are in the same folder.


-> Importing OVF into ESXI and upload the uncompressed config (from backuped file folder) -> Virtual Machine is fine again


share|improve this answer

cpio can copy sparse files while preserving the "holes" in them.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.