This website use cookies to help you have a superior and more admissible browsing experience on the website.
Loading...
GhettoVCB is a popular, free, open-source backup script designed by William Lam to create backups of VMware ESXi virtual machines. It runs directly on ESXi Shell, requires no vCenter, and works with ESXi free edition. Ghettovcb.
It will create a snapshot of your VM, and use vmkstools to clone the VMDK(s) to the backup destination. After a successful copy, the snapshot will be automatically deleted.
► Key features and advantages of ESXi backup using Ghettovcb script:
► Limits of Ghettovcb:
► Best Use Cases:
GhettoVCB is particularly suitable for:
In the next section, we will walk you through the whole ghettovcb process, from installation and scripts. In addition, we will introduce a comprehensive backup solution that offers better backup strategy (such as incremental and differential backup)
In this section, you will know how to install ghettoVCB and set up VMware ESXI VMs backups step by step.
From the official GitHub repository: https://github.com/lamw/ghettoVCB to Download ghettoVCB.
►Manual Installation (Script Upload)
1. SSH into your ESXi host as root.
2. Create a directory on a datastore (e.g., /vmfs/volumes/datastore1/scripts):
mkdir -p /vmfs/volumes/datastore1/scripts
3. Upload ghettoVCB.sh to that directory using SCP or by copying from a USB.
4. Make it executable:
chmod +x /vmfs/volumes/datastore1/scripts/ghettoVCB.sh
5. Run a test:
cd /vmfs/volumes/datastore1/scripts
./ghettoVCB.sh -h
►VIB Installation
For ESXi 5.0 and above, the VIB package installs ghettoVCB persistently:
1. Download the offline bundle (VIB) from the GitHub releases.
2. Place it on a datastore or serve it via HTTP.
3. Install using ESXCLI:
esxcli software vib install -v /path/to/lamw-ghettoVCB.vib
4. After installation, the script is available at /opt/ghettoVCB/ghettoVCB.sh.
ghettoVCB uses a global configuration file (default: /etc/ghettoVCB/ghettoVCB.conf). Below are the most important parameters to customize:
| Parameter | Description |
| VM_BACKUP_VOLUME | Backup destination path |
| DISK_BACKUP_FORMAT | thin, thick, eagerzeroedthick, rdm, etc. |
| VM_BACKUP_ROTATION_COUNT | Number of backup copies kept per VM |
| EMAIL_LOG | Send log via email (needs sendmail configured) |
| ENABLE_COMPRESSION | Use compression (tar + pigz) |
| ENABLE_NON_PERSISTENT_NFS | Mount NFS on‑the‑fly, unmount after backup |
| SNAPSHOT_TIMEOUT | Timeout for snapshot creation (seconds) |
| POWER_VM_DOWN_BACKUP | Power off VM before backup (use for special cases) |
| EMAIL_ALERTS | Configure SMTP settings to receive backup success and failure logs. |
| EXCLUDE_DISKS | Enable rules to skip independent non-persistent disks during backup. |
For users backing up VMs to Unraid or external NAS, you will also need to configure persistent NFS mounts directly within the ESXi host to ensure the backup destination remains accessible after reboots.
Once configured, you can run backup tasks directly from the ESXi SSH shell with simple, intuitive commands.
► Backup a Single VM
./ghettoVCB.sh -m "MyVM"
► Backup Multiple VMs from a List File
1. Create a list file (one VM name per line), e.g., /backup/vm_list.txt
2. Run the command:
./ghettoVCB.sh -f /backup/vm_list.txt
► Backup All Running VMs
./ghettoVCB.sh -a
Use a Custom Configuration File
./ghettoVCB.sh -c /path/to/my_backup.conf -m "MyVM"
► Exclude Specific VMs
Create an exclude list file and use -e:
./ghettoVCB.sh -a -e /backup/exclude_list.txt
► Validate Backup Configuration with Dry-Run Test
The Dry-Run test provides a quick summary of details on whether a given set VMs will be backed up. Before creating an actual backup, you can run the following command to validate:
~ # ./ghettoVCB.sh -f vms_to_backup -d dryrun
► Debug Mode
If backups fail, always start with debug output:
./ghettoVCB.sh -d debug -m "MyVM"
Debug logs show exact vmkfstools commands and snapshot operations.
One of the most requested features for ghettoVCB backup is automated, scheduled backups. ESXi supports cron jobs to run backup scripts daily, weekly, or on custom schedules.
1. Edit the ESXi crontab for root:
vi /var/spool/cron/crontabs/root
2. Add a backup schedule. For example, backup all running VMs every day at 2 AM.
0 2 * * * /opt/ghettoVCB/ghettoVCB.sh -a -c /etc/ghettoVCB/ghettoVCB.conf
3. Make Cron persist Across Reboots
Add the following line to /etc/rc.local (or use the VIB’s built‑in persistence):
/bin/kill $(cat /var/run/crond.pid) 2>/dev/null
/usr/lib/vmware/busybox/bin/busybox crond
Better yet, install the ghettoVCB VIB – it includes a startup script that restores cron jobs.
4. Log Management: ghettoVCB writes logs to the backup destination by default. You can also set a global log file in the config:
LOG_DIR=/vmfs/volumes/datastore1/logs
To email logs, configure sendmail on ESXi (complex) or use a script that mails after cron.
ghettoVCB provides ghettoVCB-restore.sh. to restore ghettoVCB backup.
►Basic restore command:
./ghettoVCB-restore.sh -p /backup/path/MyVM
This command will:
►Manual Restore (Alternative)
If you prefer manual control:
1. Browse the backup directory. You’ll find a folder like MyVM-2025-03-15_02-00-01/ containing .vmdk and .vmx files.
2. Copy the .vmx and .vmdk files to your desired datastore using cp or mv.
3. Register the VM via vSphere Client: Create / Register VM → Register an existing virtual machine.
4. Power on and verify.
If you encounter a problem when perform ghettoVCB’s commands, there are common issues and solutions.
Ensure you’re logging in as root and SSH is enabled. Some ESXi builds restrict root SSH – enable via DCUI or advanced settings.
If ghettoVCB is interrupted, a snapshot may remain. Check with:
vim-cmd vmsvc/getallvms
vim-cmd vmsvc/snapshot.get <vmid>\
Remove it manually:
vim-cmd vmsvc/snapshot.removeall <vmid>
Solution: Increase VM_BACKUP_ROTATION_COUNT to keep fewer copies, or add more storage. Use du -sh /backup/* to see which VMs consume most space.
For NFS shares, confirm they are mounted correctly:
esxcli storage nfs list
If using ENABLE_NON_PERSISTENT_NFS, verify credentials and path.
Set DEBUG_LOG=1 inside the script or run with -d debug. For even deeper vmkfstools logging, modify the script to add -v 10 to the vmkfstools cloning line (advanced users only).
ghettoVCB is a good solution for home labs, small deployments, and budget‑conscious environments. It has served the VMware community faithfully for over a decade. However, as your virtual environment grows from a handful of VMs to dozens or hundreds, you may require incremental backup, better backup and restore performance, and anti-ransomware protection.
Here we would like to introduce an enterprise backup and recovery solution – i2Backup. It offers reliable, agentless, scalable, and secure data protection for VMware VMs across physical, virtual, and cloud environments. You can easily create backup schedules for all VMware VMs from one console without installing an agent on guest VMs.
i2Backup and ghettoVCB comparison:
|
Features |
ghettoVCB |
i2Backup |
|
Backup Types |
Full backup only |
Full, incremental, differential, incremental‑forever |
|
Management interface |
Command line (SSH + text files) |
Web‑based B/S graphical interface with centralized management |
|
Recovery scope |
Entire VM (full VMDK restore) |
VM restore + granular file‑level restore + single‑file recovery |
|
Backup deduplication |
None |
Advanced intelligent deduplication (variable‑block) |
|
Backup Security |
None |
AES-256 backup encryption, Immutable backup (ransomware protection), Role-based Access Control |
|
Storage destinations |
Local datastores, NFS |
Local disks, NAS, tape libraries, object storage, deduplicated storage, S3 cloud |
|
Backup rotation |
Simple rotation count |
Intelligent retention policies, customizable lifecycle governance |
You can click the download button below to get a 60-day free trial:
In this article, we provide the step-by-step ghettoVCB backup for VMware ESXi virtual machines. It is a great method for free ESXi users, home labs, and small businesses.
However, ghettoVCB is not an enterprise backup solution with incremental forever, deduplication, and centralized management. If you need a professional and robust backup solution, Info2Soft’s i2Backup. Besides VMware, i2Backup also supports backing up Hyper-V, OpenStack, and other virtual machines.