VMware Virtual Machines Back up With Bacula and GhettoVCB

Enable SSH service on ESXi

On the vSphere Client click on the configuration tab

VMware ESXi vSphere Client Configuration

Click on Security Profile

VMware ESXi vSphere Client Security Profile

Now open the Properties tab so you cen see the Security Profile properties and the Remote Access services.

VMware ESXi vSphere Client Security Profile Properies

Select the SSH Service and click on Options. This will open up a new Windows where you can start the SSH service for your VMware ESXi 5.5 host and also set the startup properties for the service.

VMware ESXi vSphere Client Start SSH Service

Now you should be able to access your VMware vSphere ESXi host via SSH. If you have any problems to connect you should also check out the firewall of your ESXi server.

VMware ESXi 5.5 Firewall

Ghetto VCB Download and Configuration:

Get the GhettoVCB zip package from your workstation (master.zip):


Copy the package to the root of the ESXi server (example):

scp master.zip root@

Access the ESXi server via SSH. Unzip the master.zip file:

cd /
unzip master.zip

Ascend to the created script folder:

cd ghettoVCB-master

Configure the script:

vi /backup/ghettoVCB-master/ghettoVCB.conf

The core values ​​are to change the directory where the intermediate backup of the VM and the amount of versions of local back ups to be stored. As I intend to copy them with Bacula it is not necessary to store more than one version.


Alternatively you could save this backup ghuetto on another server via NFS and also configure sending e-mail , which is not included in this guide as I want to leave these functions to Bacula .

Give execute permission on the script of the ghetto that starts backups:

chmod o+rx ghettoVCB.sh

Run the script for testing purposes . You can back up all the machines with the -a option or you can specify the name of the same ( the name of the configured virtual machine on the client cSphere – case sensitive):

ghettoVCB.sh -g /ghettoVCB-master/ghettoVCB.conf -m VM-NAME

Bacula Configuration

You can configure the ESXi cron to run the ghetto in a desired frequency or can set up a script before Bacula backup Job .

Because you can not install Bacula client on the ESXi alternative is to call the script from another server and copy the generated backup. You can also have a post- backup script to delete the ghetto inermediário go up after the Bacula have copied to the storage .

To call the script remotely installe the sshpass . Example:

apt-get install sshpass

Configure a backup job to call the script (in this case did a job for each VM):

<code>Job { Name = “Backup_Esxi_VM-NAME”<code>
JobDefs = "DefaultJob"
Client = srv-backup-fd
 FileSet = VM-NAME ClientRunBeforeJob = "sshpass -p 'xxxx' ssh -o StrictHostKeyChecking=no root@ /ghettoVCB-master/ghettoVCB.sh -g /ghettoVCB-master/ghettoVCB.conf -m VM-NAME"
 ClientRunAfterJob = "sshpass -p 'xxxx' ssh -o StrictHostKeyChecking=no root@ rm -rf /vmfs/volumes/datastore1/backup/VM-NAME"
Schedule = vms-schedule
Priority = 10

To copy the backup intermediate ghetto to another server, an scp script could be done or can be used bpipe plugin Bacula for this purpose , with the advantage of going straight for data backup and do not occupy space on another server:

<code>FileSet { Name = “VM-NAME<code>
Include {
Options {
signature = MD5
Compression = GZIP1
 Plugin = “bpipe:/mnt/bkp_VM-NAME.tar:sshpass -p ‘xxxx’ ssh -o StrictHostKeyChecking=no root@192.168.10.x /bin/tar -c /vmfs/volumes/datastore1/backup/VM-NAME:/bin/tar -C /backup/bacula-restores -xvf -“}
Exclude {

In this example the Bacula will restore the backup on the machine where your client is installed (/backup/bacula- restores). For the restore will be necessary to copy the files to the ESXi server and using the script of the ghetto (ghettoVCB-restore.sh) to import the back up to vSphere .

Disponível em: pt-brPortuguês (Portuguese (Brazil))enEnglish

This Post Has 3 Comments

  1. Aleksandr

    Hi! That is a great method to backup VMs.

    Please, tell me what client I had to set here “Client = srv-backup-fd”. I can’t setup file daemon on ESXi host…

    1. hfaria

      Hello. You cant install a bacula-fd in the ESXi. You must run it in another machine.

      1. Aleksandr

        I understand this. The question is which client I had enter in the parameter “Client” in “Job” section?
        [quote]Job {
        Name = “Backup_Esxi_VM-NAME”
        JobDefs = “DefaultJob”
        Client = srv-backup-fd[/qoute]
        What is srv-backup-fd?

Leave a Reply