Written on 13. Juli 2022

VMware ESXi free backup with ghettoVCB

For some servers, which run in a development enviromente on a free ESXi, I needed a solution to backup them daily. I deciced to do it with https://github.com/lamw/ghettoVCB, because it is easy to handle. Unfortunately it only takes full backups, which can be a problem in the duration of a very large vm, but for the development system it works perfectly.


The ssh services needs to be permanently activated on the ESXi Server.


Download the latest .vib file from the mentioned github repository and place it on your ESXi datastore. Switch to the datastore and install it.

cd /vmfs/volumes/datastore1/ghettoVCB
esxcli software vib install -v /vghetto-ghettoVCB.vib -f

Now you should see a new folder structure /opt/ghettovcb.


Switch to the /bin folder and open the ghettoVCB.sh.

cd bin
vi ghettoVCB.sh

In this file you can do some initial configuration. I configured the following parts:

  • NFS_MOUNT=/backup
  • NFS_LOCAL_NAME=backup
  • NFS_VM_BACKUP_DIR=vm_backups

Also it’s very nice to receive an E-Mail about the backup status. You can configure the neccessary fiels in the EMAIL CONFIGURATIONS section:

  • EMAIL_FROM=ghettoVCB@stangneth.com
  • EMAIL_TO=mailbox@stangneth.com

E-Mail Firewall rule

To allow E-Mail traffic on port 25 through the ESXi Firewall you need to create an firewall entry. Create a file called smtp.xml.

vi /etc/vmware/firewall/smtp.xml

File it with the following information.

  <service id='1010'>
    <rule id='0000'>

Restart the firewall service.

esxcli network firewall refresh

These configuration is lost after a reboot. Copy the smtp.xml file to a datastore.

cp /etc/vmware/firewall/smtp.xml /vmfs/volumes/datastore1/ghettovcb/

In the section „Automation / cron“ of this article you can find the config for recopying this file to the neccessary location.


Now the initial configuration is done an we can check if we can backup a vm with the following command.

./ghettoVCB.sh -m VMNAME

If everything works you should see a new folder on your NFS store (or what you configured) with all VM-Files.

Automation / cron

If you just create a task in /var/spool/cron/crontabs/root you’ll lose the entries after a reboot of the ESXi server. To recreate the entry every startup to the following.

vi /etc/rc.local.d/local.sh

Here you can enter your backup command before the exit 0

### ghettoVCB Cronjob
/bin/kill $(cat /var/run/crond.pid)
/bin/echo "0 14 * * 1-5 /opt/ghettovcb/bin/ghettoVCB.sh -f /vmfs/volumes/datastore1/ghettoVCB/server.txt"
/usr/lib/vmware/busybox/bin/busybox crond
### SMTP Firewall rule
/bin/cp /vmfs/volumes/datastore1/ghettovcb/smtp.xml /etc/vmware/firewall
/bin/esxcli network firewall refresh

I used the -f command to attach a list of the vms which should be in the backup task instead of -m for every single vm.

Be sure to make a backup of ghettoVCB.sh on a persistent datastore so you won’t loose it due to an update.

cp -a /opt/ghettovcb/bin/ghettoVCB.sh /vmfs/volumes/datastore1/ghettovcb/ghettoVCB.sh

Keine Kommentare zu VMware ESXi free backup with ghettoVCB

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert