Free VMware ESXi backup script

ghettoVCB: Free VM Backup for VMware ESXi

ghettoVCB is an open-source shell script by William Lam that creates backups of running virtual machines directly on an ESXi host. It takes a temporary snapshot, copies the VM’s disks and configuration to a datastore or NFS share, then cleans up — no backup appliance, agent or vCenter Server required.

Illustrative render of a ghettoVCB backup run in the ESXi Shell.

Open source

Script and docs published on GitHub

Host-side

Runs inside the ESXi Shell itself

ESX(i) 3.x – 9.x

Long-running community project

Cron-ready

Non-interactive, easy to schedule

About ghettoVCB

What is ghettoVCB?

ghettoVCB is a Bourne-shell script that backs up VMware virtual machines from inside the ESXi host. William Lam first published it during the ESX 3.5 era as a free alternative to VMware Consolidated Backup, and it has been maintained on GitHub ever since.

Each backup is a plain copy of the VM folder — the .vmx file plus cloned VMDKs — so you can register it on any ESXi host or restore it with the bundled ghettoVCB-restore.sh. Because it only needs the ESXi Shell, it suits home labs and single-host setups where commercial backup suites are overkill.

Key features

ghettoVCB features that matter day to day

A short tour of what the ghettoVCB script actually does, based on the project’s own documentation.

Hot backups of running VMs

A temporary snapshot freezes the base disk so it can be copied while the VM keeps working. The snapshot is removed when the copy finishes.

Local, SAN or NFS targets

Write backups to any datastore the host can see. ghettoVCB can also mount an NFS export for the run and unmount it afterwards.

No proxy or appliance

Everything runs in the ESXi Shell with built-in tools such as vim-cmd and vmkfstools. Nothing extra has to be deployed.

Backup rotation

VM_BACKUP_ROTATION_COUNT keeps the newest copies and deletes older ones, so a backup volume does not silently fill up.

Choice of disk format

Store backups as thin, zeroedthick, eagerzeroedthick or 2gbsparse disks. Thin is the usual pick when space matters.

Per-VM policy files

Point the -c flag at a folder of policy files named after each VM to override rotation, format or power settings per machine.

Dry-run mode

Run with -d dryrun to see each VM's disks, total size and any blockers before a single byte is copied.

Email log reports

Optionally email the log after each run, so failed jobs are noticed without logging in to the host.

Built-in restore

ghettoVCB-restore.sh copies a backup to a target datastore, converts the disk format if needed and registers the VM.

Before you start

ghettoVCB system requirements

ghettoVCB is not a desktop program, so there is no Windows or Linux installer. It runs on the ESXi host; your PC is only used to copy files over.

RequirementDetails
HypervisorVMware ESX / ESXi 3.x through 9.x (check the README for notes on your exact release)
Host accessESXi Shell or SSH enabled, logged in as root
PackageVIB or offline bundle (ESXi 5.x and later), or the raw shell scripts on older hosts
Backup storageA datastore with room for every VM × your rotation count — local VMFS, SAN or NFS
Your workstationAny Windows PC, Linux or macOS machine with an SSH/SCP client (for example OpenSSH or WinSCP)
vCenter ServerNot required — ghettoVCB talks to the host directly

ghettoVCB download

Download ghettoVCB from the official source

The only official place to get ghettoVCB is William Lam’s GitHub repository. Releases include a VIB and an offline bundle for esxcli, and the source tree contains the plain scripts. Version numbers and file sizes are listed on the release page itself — we link there instead of rehosting files.

Before you download

  • Read the README for the release that matches your ESXi version.
  • Compare the file you receive with what the GitHub release page lists.
  • Test on a non-critical VM first and run a dry run.
  • Keep at least one backup copy off the host itself.

ghettovcb.com is an independent informational site. It is not affiliated with William Lam, VMware or Broadcom, and it does not host ghettoVCB files.

Installation

How to install ghettoVCB on ESXi

The steps below follow the project’s README. File names can change between releases, so check the release page before you copy commands.

1. Download

Grab the VIB or offline bundle from GitHub Releases on your PC or Linux machine.

2. Copy to the host

Enable SSH on the ESXi host, then copy the file to /tmp with scp or WinSCP.

3. Install with esxcli

Install the VIB (-v) or offline bundle (-d). Use update instead of install to keep an existing config.

4. Configure & test

Edit /etc/ghettovcb/ghettoVCB.conf, list your VMs, then run a dry run before the first real backup.

Illustrative render: VIB install and the resulting folders.
# from your workstation
scp vghetto-ghettoVCB.vib root@esxi01:/tmp/

# on the ESXi host (SSH)
esxcli software vib install -v /tmp/vghetto-ghettoVCB.vib -f

# or, using the offline bundle
esxcli software vib install -d /tmp/<offline-bundle>.zip -f

# remove later if needed
esxcli software vib remove -n ghettoVCB

Guide

How to use ghettoVCB

Day-to-day use comes down to a handful of flags. Scripts live in /opt/ghettovcb/bin/ after a VIB install.

CommandWhat it does
ghettoVCB.sh -f vms_to_backupBack up the VMs listed (one name per line) in the file
ghettoVCB.sh -aBack up every VM on the host
ghettoVCB.sh -f vms_to_backup -d dryrunPreview what would be backed up, without copying anything
ghettoVCB.sh -f vms_to_backup -g /path/ghettoVCB.confUse a specific global configuration file
ghettoVCB.sh -f vms_to_backup -c /path/vm_configsApply per-VM policy files from a folder
ghettoVCB.sh -f vms_to_backup -l /vmfs/volumes/ds1/ghettoVCB.logWrite the log to a datastore instead of volatile /tmp

Schedule nightly backups with cron

ESXi keeps root’s crontab in /var/spool/cron/crontabs/root. Changes there do not survive a reboot on their own, so also add the cron line to the host’s startup script (/etc/rc.local.d/local.sh on current ESXi) and run /sbin/auto-backup.sh to save the configuration.

# run every night at 01:00
0 1 * * * /opt/ghettovcb/bin/ghettoVCB.sh \
  -f /vmfs/volumes/datastore1/vms_to_backup \
  -l /vmfs/volumes/datastore1/ghettoVCB.log > /dev/null 2>&1

# reload cron after editing
kill $(cat /var/run/crond.pid)
crond

Under the hood

How ghettoVCB works

Every run follows the same predictable sequence for each VM in your list.

First the script reads the global ghettoVCB.conf and any per-VM policy file. It then creates a snapshot so the original VMDK stops changing, and uses vmkfstools to clone each disk into a timestamped folder on the backup volume. When cloning finishes, the snapshot is removed and the changes written in the meantime are merged back.

Finally, folders beyond VM_BACKUP_ROTATION_COUNT are deleted. Every run is a full copy — there is no change-block tracking or deduplication — which keeps restores simple but means each backup takes as long as copying the whole VM.

Compatibility

ghettoVCB compatibility at a glance

Version support below reflects the project documentation. Always read the README for the release you install.

PlatformSupported?Notes
ESX / ESXi 3.x – 4.xYes (legacy)Copy the scripts manually; very old releases
ESXi 5.x – 6.xYesInstall the VIB with esxcli
ESXi 7.xYesVIB or offline bundle
ESXi 8.x and later (incl. 9.x)YesVIB or offline bundle
vCenter ServerNot neededRuns per host; schedule each host separately
Windows PC / Linux desktopNoUse them only to download and upload files
Hyper-V, Proxmox, VMware WorkstationNoghettoVCB targets ESX/ESXi only

Honest assessment

ghettoVCB pros and cons

ghettoVCB is excellent at one job. Knowing its limits helps you decide whether it fits your environment.

Pros

Cons

Who uses it

Common ghettoVCB use cases

Typical situations where a lightweight ghettoVCB backup is the right tool.

Home labs

Protect a single lab host's VMs on a schedule without paying for a backup suite.

Small offices

Copy a few business VMs nightly to a NAS share on one or two standalone hosts.

Before upgrades

Take a full, restorable copy of a VM before patching the guest OS or the host.

Moving VMs between hosts

Back up on one host and restore on another when there is no vMotion.

Offsite copies

Point backups at an NFS export that is replicated or synced to another site.

Test and dev clones

Restore a backup under a new name to build a disposable test copy of production.

Screenshots

ghettoVCB in action

Illustrative renders of real ghettoVCB commands and output formats. Your host names, paths and timings will differ.

Dry run: check disks and total size first.
Global settings in ghettoVCB.conf.
Timestamped backups with rotation.
Restoring a VM with ghettoVCB-restore.sh.

Troubleshooting

Fixing common ghettoVCB problems

Most ghettoVCB backup failures come from a handful of predictable causes.

VM skipped: snapshots exist

Consolidate or delete existing snapshots first. ALLOW_VMS_WITH_SNAPSHOTS_TO_BE_BACKEDUP exists, but read the README's warnings before enabling it.

NFS share will not mount

Check that the export allows the host's IP with root access, the VMkernel port can reach the NAS, and the NFS client firewall rule is enabled.

Cron job gone after reboot

ESXi rebuilds crontab at boot. Add the line to /etc/rc.local.d/local.sh and run /sbin/auto-backup.sh.

Backup stopped half-way

Kill the leftover ghettoVCB, tail and vmkfstools processes, then remove the ghettoVCB snapshot in Snapshot Manager.

Log file disappeared

/tmp is wiped on reboot. Pass -l with a path on a datastore so logs survive.

Email reports not arriving

Confirm EMAIL_SERVER and port, and allow outbound SMTP in the ESXi firewall for that port.

Security & privacy

Keep your ghettoVCB backups safe

A VM backup contains everything inside that VM — databases, keys and user data. Treat the backup volume with the same care as production.

About this website

ghettovcb.com is an independent guide. We do not collect data from your hosts, do not bundle or modify ghettoVCB, and do not run download mirrors. Links send you straight to the original GitHub project.

Read our Privacy Policy and Disclaimer for details.

Alternatives

ghettoVCB alternatives worth comparing

If you need incremental backups, a dashboard or vendor support, these are the tools people usually compare ghettoVCB with. Check each vendor’s site for current pricing.

ToolApproachCostGood fit for
ghettoVCBShell script on the ESXi hostFree, open sourceHome labs and standalone hosts
Vinchin Backup & RecoveryAgentless backup platform with web consoleCommercial, free trialTeams wanting incremental backups and a GUI
Veeam Backup & ReplicationFull backup suite using vSphere APIsCommercial; free Community Edition with limitsLicensed vSphere environments
NAKIVO Backup & ReplicationBackup software / applianceCommercial, free trialSMBs and service providers
XSIBackupHost-side ESXi backup toolCommercial editionsHost-side backups with deduplication

Looking for a Vinchin download? Get the trial only from the vendor’s official website. Note that tools built on the vSphere Storage APIs generally need a licensed ESXi edition, while ghettoVCB works locally on the host.

User reviews

What ghettoVCB users say

We publish only reviews we can verify. Used ghettoVCB in your lab or business? Tell us how it went.

★★★★★

[Placeholder — replace with a real, verified user review before publishing.]

Reviewer name
Role · ESXi version

★★★★★

[Placeholder — replace with a real, verified user review before publishing.]

Reviewer name
Role · ESXi version

★★★★★

[Placeholder — replace with a real, verified user review before publishing.]

Reviewer name
Role · ESXi version

FAQ

ghettoVCB frequently asked questions

Straight answers to the questions people ask most about ghettoVCB download, installation and backups.

Download, installation & licensing

Yes. ghettoVCB is free and open source, published by William Lam on GitHub. There is no paid edition, license key or trial period. The repository includes the license terms, so read them if you plan to redistribute or modify the script inside your own tooling or products.

The official source is the lamw/ghettoVCB repository on GitHub. Its Releases page provides the VIB and offline bundle used with esxcli, and the main branch contains the plain scripts. Avoid third-party mirrors: you cannot easily confirm that a rehosted copy has not been modified.

No. ghettoVCB runs on the VMware ESXi host itself. A Windows PC, Linux machine or Mac is only used to download the package and copy it to the host with scp or WinSCP. After that, you run every ghettoVCB command over SSH inside the ESXi Shell.

The project documentation covers ESX and ESXi 3.x through 9.x. ESXi 5.x and 6.x use the VIB, while 7.x and later can use either the VIB or the offline bundle. Very old releases require copying the scripts manually. Check the README for notes specific to your build.

Copy the VIB to /tmp on the host, then run esxcli software vib install -v /tmp/vghetto-ghettoVCB.vib -f. For an offline bundle use -d with the .zip path instead. The scripts land in /opt/ghettovcb/bin and the configuration in /etc/ghettovcb. Use update rather than install to keep your existing settings.

No. ghettoVCB works directly on each ESXi host using local tools such as vim-cmd and vmkfstools. That is a big part of its appeal for standalone hosts. The trade-off is that schedules and configuration are managed per host, so a multi-host cluster means repeating the setup on every host.

To upgrade, copy the new package to the host and run esxcli software vib update with the same -v or -d option; this keeps your ghettoVCB.conf. To remove it completely, run esxcli software vib remove -n ghettoVCB. Your existing backup folders on the datastore are not touched either way.

Normally no. The esxcli output shows a Reboot Required field, which is usually false for the ghettoVCB VIB. If your host reports otherwise, follow that instruction. Remember that cron entries still need the startup-script step to survive any future reboot of the host.

No. ghettovcb.com is an independent informational site that explains how to install, configure and use ghettoVCB. It is not affiliated with William Lam, VMware or Broadcom and does not host the files. Download buttons point to the original GitHub project so you always get the genuine release.

Features, security & troubleshooting

Yes. ghettoVCB creates a temporary snapshot so the base VMDK stops changing, clones the disks with vmkfstools, then removes the snapshot. The VM stays online throughout. For databases, consider enabling quiescing with VMware Tools or stopping the service first so the backup is application-consistent rather than crash-consistent.

No. Each run makes a full copy of every selected VM. That keeps restores very simple because each folder is complete, but it uses more storage and time than incremental tools. Rotation through VM_BACKUP_ROTATION_COUNT limits how many full copies are kept on the backup volume.

Any datastore visible to the host works: local VMFS, a SAN LUN or an NFS export on a NAS. NFS is popular because it keeps backups off the host’s own disks, and ghettoVCB can mount it just for the run. Ideally keep a further copy off-site or offline.

Create a restore file with the backup folder, destination datastore, disk format number and, optionally, a new VM name, then run ghettoVCB-restore.sh -c with that file. The script copies the disks and registers the VM. You can also register the backed-up .vmx manually from the datastore browser.

The most common reason is an existing snapshot on the VM; ghettoVCB skips those by default to avoid corrupting the snapshot chain. Independent disks and VMs whose names do not match the list file exactly are other causes. Run a dry run with -d dryrun to see the reason.

Yes. Add a line to /var/spool/cron/crontabs/root that calls ghettoVCB.sh with your VM list and log path, then restart crond. Because ESXi rebuilds crontab at boot, also place the line in /etc/rc.local.d/local.sh and run /sbin/auto-backup.sh so the schedule survives reboots.

Many administrators run it in production, but it is community-supported software with no vendor SLA. Test it on non-critical VMs, watch the logs, monitor free space on the backup volume and restore a VM regularly. If you need guaranteed support, a commercial tool may be a better fit.

Compression is optional through the ENABLE_COMPRESSION setting, but test restores carefully if you use it, particularly with large VMs. ghettoVCB does not encrypt backups itself, so protect them at the storage level with an encrypted NAS volume, restricted NFS exports and physical security.

Start with the log; write it to a datastore with -l because /tmp is cleared on reboot. Check free space, existing snapshots and NFS connectivity. If a run was interrupted, kill leftover ghettoVCB and vmkfstools processes and remove the ghettoVCB snapshot before trying again.

Blog

Latest ghettoVCB guides

Step-by-step tutorials on ghettoVCB backup, ghettoVCB configuration and ESXi housekeeping.

Need help with your ghettoVCB setup?

Spotted an error on this site, or have a question we have not covered? Send us a message and we will do our best to point you in the right direction.

Scroll to Top