VMWare: Backup ESXi Host Config Using vCLI

This process uses the vmware command line interface tools to backup your ESXi host configuration – a must have for disaster recovery when your ESXi host has to be rebuilt / cloned etc. The tools from the link below have been tested on all versions of ESXi from 3.5  onwards.

Note: This *DOES NOT* back up your virtual machines!!

1. Download the vCLI:

The installer will install the tools and also the ActivePerl sdk – the download link is currently here:


2. Use the esxcfg-cfgbackup.pl to backup your host configuration:

vicfg-cfgbackup.pl –server <server_name> -s <backup_file_name>


C:\Program Files (x86)\VMware\VMware vSphere CLI\bin>perl esxcfg-cfgbackup.pl — server -s C:\Users\admin\Desktop\
Enter username: root
Enter password:
Saving firmware configuration to C:\Users\admin\Desktop\ …

3. Use the esxcfg-cfgbackup.pl to restore your host configuration to a host:

esxcfg-cfgbackup.pl –server <server_name> -l <backup_file_name>

Note: this will cause the host to reboot once the process is complete.

Command Line Options

C:\Program Files (x86)\VMware\VMware vSphere CLI\bin>perl esxcfg-cfgbackup.pl –help

Synopsis: esxcfg-cfgbackup.pl OPTIONS [<backupfile>]
Command-specific options:
Force the restore of the configuration.
Restore configuration onto the host
Do not prompt for user confirmation.
Resets host, restore to factory settings.
Backup the host configuration.

Common VI options:
–config (variable VI_CONFIG)
Location of the VI Perl configuration file
–credstore (variable VI_CREDSTORE)
Name of the credential store file defaults to <HOME>/.vmware/credstore/vicredentials.xml on Linux and <APPDATA>/VMware/credstore/vicredentials.xml on Windows
–encoding (variable VI_ENCODING, default ‘utf8’)
Encoding: utf8, cp936 (Simplified Chinese), iso-8859-1 (German), shiftjis (Japanese)
Display usage information for the script
–passthroughauth (variable VI_PASSTHROUGHAUTH)
Attempt to use pass-through authentication
–passthroughauthpackage (variable VI_PASSTHROUGHAUTHPACKAGE, default ‘Negotiate’)
Pass-through authentication negotiation package
–password (variable VI_PASSWORD)
–portnumber (variable VI_PORTNUMBER)
Port used to connect to server
–protocol (variable VI_PROTOCOL, default ‘https’)
Protocol used to connect to server
–savesessionfile (variable VI_SAVESESSIONFILE)
File to save session ID/cookie to utilize
–server (variable VI_SERVER, default ‘localhost’)
VI server to connect to. Required if url is not present
–servicepath (variable VI_SERVICEPATH, default ‘/sdk/webService’)
Service path used to connect to server
–sessionfile (variable VI_SESSIONFILE)
File containing session ID/cookie to utilize
–url (variable VI_URL)
VI SDK URL to connect to. Required if server is not present
–username (variable VI_USERNAME)
–verbose (variable VI_VERBOSE)
Display additional debugging information
Display version information for the script

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.