VMware vSphere Hypervisor (ESXi) 5.1.0 Patch 2 (Build 914609) with ghettoVCB from January 2013

This article describes how to run the latest build of ESXi 5.1 Patch 2 (Build 914609) with the newest backupscript ghettoVCB (from William Lam). This article also includes an update from ESXi 5.x to the newest version.

You can see an overview of all the releases, patches and updates here.

If you don’t have a ESXi 5.1 P2 follow the upgrade process described here. You can skip this.

Download the patch from here and select the newest update (Patch Release ESXi510-201210001)

The easiest way is to provide the image on a http server so it is very easy to get. (You can also copy it via WinSCP or similar)

Login to your server via PuTTY or similair and get your image via

wget -O /vmfs/volumes/datastore1/ESXi510-201212001.zip

After you downloaded the update execute the update process via esxcli (don’t reboot, there is more to do!)

esxcli software vib update -d /vmfs/volumes/datastore1/ESXi510-201212001.zip

If you have ESXi 5.1 P2 installed you can continue here

It is on to deploy our custom package. Last time a filesystem within a tgz-file was created. This time an own VIB (vSphere Installation Bundle) will be created which. Download the Community Packaging Tools (CPT) from Andreas Peetz (for Windows). If you like to do this with Linux check out the VMware page about the VIB Author (I have not tested this but maybe you find something on William Lams site here)

Also download the newest ghettoVCB. Don’t forget to alter the script (search for preparation) if you want to use Email Log, especially with a Windows Mail server.

As described in my first article about vSphere Hypervisor a filesystem will be created and then packed into a VIB via CPT.

This filesystem looks like the following (I made some changes according to William Lams site)

│   ├───rc.local.d
│   │       999.addCronJobs.sh
│   │
│   └───vmware
│       └───firewall
│               smtp.xml

Starting with the first file


you can see that this file is in the /etc/rc.local.d/ directory. You can’t put your lines in the /etc/lc.local file anymore.

Moreover it is named with the number 999 at the beginning which will make it execute at a very late time and don’t get into conflict with other scripts.

This script kills the cron daemon, injects our lines and starts it again.

# Stop cron
/bin/kill $(cat /var/run/crond.pid)
# Script for cron injection
/bin/echo "#Backup of all VMs" >> /var/spool/cron/crontabs/root
/bin/echo "0    18   *   *   0   /opt/ghettoVCB/ghettoVCB.sh -g /opt/ghettoVCB/ghettoVCB.conf -a" >> /var/spool/cron/crontabs/root
/bin/echo "#Backup of SYSTEM Disk to Datastore2 from existing Backups" >> /var/spool/cron/crontabs/root
/bin/echo "0    23   *   *   0   /opt/ghettoVCB/2nd-backup.sh" >> /var/spool/cron/crontabs/root
# Start cron
/usr/lib/vmware/busybox/bin/busybox crond

The /etc/vmware/firewall/smtp.xml is a custom firewall rule to send to emails. (search for creating a custom firewall rule)

In the /opt/ghettoVCB there are the files which you have downloaded from William Lams Github site and also made the changes regarding Email (see top of this article)

the 2nd-backup.sh looks like this


#delete backups older than 20 days
test -d "${d2}" || mkdir -p "${d2}"
cd "${d2}" && find . -mindepth 1 -mtime +20 -exec rm  -f {} ;
#change to original dir
cd "${d1}" && find . ( ! -name "*_1-flat.vmdk" ) | cpio -padvm "${d2}"

it deletes all backups from datastore2/BACKUP which are older than 20 days.

After this it changes to the datastore 1 and copies only the 1st harddisk of all VMs to datastore2.

Unfortunately the cpio command (Version 2.9) has some bugs where it loses permissions, access and modification time, even when you set the appropriate parameters. These bugs are fixed in version 2.11.

With this knowledge it happens that the initial backup stays longer on your datastore2, but after 20 days it will also be removed. This maybe can be a problem if you do not have that much space on datastore2.

Load the filestructure to the /tmp folder of an existing ESXi or another Linux machine.

Make your shell scripts executable and pack your folder into a tgz file

chmod +x /tmp/opt/ghettoVCB/*.sh
chmod +x /tmp/etc/rc.local.d/*.sh
tar -czvf /tmp/sysstem.tgz /tmp/etc/ /tmp/opt/

Now get the sysstem.tgz back on your machine and start CPT.

Follow the instructions on the page of Andreas Peetz how to configure the parameters. (be aware that this tool can’t handle UNC paths correctly.

These are my preferences



Now Copy this VIB to a Webserver (to make it available for more hosts) or directly to the ESXi.

We need to set the acceptance level to CommunitySupported so the own crafted VIB can be installed.

esxcli software acceptance set --level=CommunitySupported

After this the own package can be installed

esxcli software vib install -v /vmfs/volumes/datastore1/sysstem-fs-5.1p2.x86_64.vib -f

The -f flag forces the VIB to be installed because the acceptance level (and/or other reasons) is officially unsupported by VMware.

Now reboot and your new system should be ready with all the updates and your Backupscript in place.

This is the simplyfied script I use to upgrade a ESXi vSphere Hypervisor, once all the preparation work is done.

wget -O /vmfs/volumes/datastore1/ESXi510-201212001.zip
wget -O /vmfs/volumes/datastore1/sysstem-fs-5.1p2.x86_64.vib
esxcli software vib update -d /vmfs/volumes/datastore1/ESXi510-201212001.zip
esxcli software acceptance set --level=CommunitySupported
esxcli software vib remove -n sysstem-fs
esxcli software vib install -v /vmfs/volumes/datastore1/sysstem-fs-5.1p2.x86_64.vib -f


Upgrade VMware vSphere Hypervisor (ESXi) Version 5.0.0 to 5.1.0 with ghettoVCB

Since October there is the new VMware Hypervisor (ESXi) version available: 5.1

This update eliminates the problem with the automatic startup and shutdown, comes with more tools (e.g. cpio), upgraded tools, security updates, new Virtual Hardware version 9 and so on. You can find detailed information from the VMware site.

The system I am going to upgrade is a ESXi-5.0.0-20120302001 (build 623860) which install process is described here.

Download the update from this site.

Choose ESXi and Version 5.1.0 as seen in the screenshot

On the next site download the file: ESXi510-201210001.zip

  • Open your VMware vSphere Client
  • Click on your host
  • Click on configuration
  • Click on storage
  • Rightclick on your datastore
  • Select Browser Datastore…
  • Select the upload symbol
  • Select upload file

Select your update-file

 File is uploading…

When it is uploaded activate your SSH Server to trigger the update.

For this go to the firewall properties…

 … and activate the SSH server service.

Now start putty and connect to your server. Login with root.

Depending on where you uploaded your ESXi 5.1.0 update file you need to execute this command to updated your server:

esxcli software vib install -d /vmfs/volumes/datastore1/ESXi510-201210001.zip

After a while the result of the update appears:

~ # esxcli software vib install -d /vmfs/volumes/datastore1/ESXi510-201210001.zip
Installation Result
   Message: The update completed successfully, but the system needs to be rebooted for the changes to be effective.
   Reboot Required: true
   VIBs Installed: VMware_bootbank_ata-pata-amd_0.3.10-3vmw.510.0.0.799733, ...snip...
 VIBs Removed: VMware_bootbank_ata-pata-amd_0.3.10-3vmw.500.0.0.469512, ...snip...
VIBs Skipped:

As you can see the updated completed successfully. A lot of old versions of programs and drivers have been removed and the newer versions have been added.

Reboot your server with the command


or over your vSphere Client. The ESXi Server should then boot up with the new version.

Adjusting ghettoVCB

for the folks of you who are using ghettoVCB from William Lam, here are some alterations to make your script work for version 5.1.0. These information comes from this VMware-comunity-site. There might be more incompatibilities, which I have not found yet.

You need to do this changes in both scripts: ghettoVCB.sh AND ghettoVCB-restore.sh

Add versionstring

Search for

ESX_VERSION=$(vmware -v | awk '{print $3}')
        if [[ "${ESX_VERSION}" == "5.0.0" ]]; then

replace by

ESX_VERSION=$(vmware -v | awk '{print $3}')
        if [[ "${ESX_VERSION}" == "5.0.0" ]] || [[ "${ESX_VERSION}" == "5.1.0" ]] ; then

Change userrecognition

Search for

if [ ! $(whoami) == "root" ]; then

replace by

if [ ! $USER == "root" ]; then

Pack your new scripts like described in this article (search for preparation) and upload it via WinSCP or get it via wget. Execute the sed-command like in the linked article if your tgz is NOT already registered. (see /bootbank/boot.cfg) If you had already used this method you MUST NOT execute the sed command, otherwise the system tries to load your tgz twice which causes an error which can’t be remotley solved. (Remote hands needed)

Try this on a non-productive machine first if it really works for you and also does the backups!

Be aware that after you upgraded your ESXi you can no longer use the ThinApped vSphere Client 5.0. You need to download a new version from your ESXi Server: (replace with your serveraddress)


There you will find a link to download a suitable VMware Hypervisor Client for your ESXi Instllation.

If you have made some interessting experiences with VMware ESXi Server 5.1.0 compared to Version 5.0.0 let me know. I consider making an article about it or add it to an existing one.

Raspberry Pi – VNC Mirror (Repeater) – Make any computer public anywhere

***Please visit the new simplified installation of the Raspberry Pi VNC Mirror***

Here is an extenstion for this blog-entry you also might to read!

Raspberry Pi LogoRaspberry Pi Logo

The idea is to show any machine (virtual or real) to public. So you can setup a computer with VNC anywhere and can put a big TV screen at another place.

We need a Raspberry Pi Model B, a network connection and a micro USB power plug (either over USB <-> micro USB plugged into your RPi or TV or seperate power device)

I have downloaded the 2012-09-18 Image of the Raspbian Image wheezy.

Follow the basic instructions of the RPi config.

Important: if you don’t have 1920×1080 resolution (Full HD) it might not work for you. I have experienced that if your remote computer has a resolution of 1280×768 the ssvncviewer exits immediately. But if you changed it to a common resoltion of 1280×720 it will work with one little dissadvantage: The screen stays black with a circle shaped cursor. You have to login from another computer on the remote machine first, so it will work. These 1280xYYY resolutions make somehow troubles.

paste these lines in your commandline (or over putty)

Ommit the lines with proxy if you have none.

Programms and settings

# start a root session
sudo bash
echo "exec openbox-session">/home/pi/.config/openbox/autostart.sh
# proxies
export http_proxy=http://proxy1.sysstem.at:8080
export https_proxy=https://proxy1.sysstem.at:8080
echo "Acquire::http::Proxy "http://proxy1.sysstem.at:8080";">>/etc/apt/apt.conf
# updates
apt-get update
apt-get upgrade -y
# install programs
apt-get install x11vnc vim ssvnc unp htop -y
# autostart x11vnc
mkdir .config/autostart/
echo [Desktop Entry]>/home/pi/.config/autostart/x11vnc.desktop
echo Encoding=UTF-8>>/home/pi/.config/autostart/x11vnc.desktop
echo Type=Application>>/home/pi/.config/autostart/x11vnc.desktop
echo Name=X11VNC>>/home/pi/.config/autostart/x11vnc.desktop
echo Comment=>>/home/pi/.config/autostart/x11vnc.desktop
echo Exec=x11vnc -forever -shared -usepw -ultrafilexfer -display :0>>/home/pi/.config/autostart/x11vnc.desktop
echo StartupNotify=false>>/home/pi/.config/autostart/x11vnc.desktop
echo Terminal=false>>/home/pi/.config/autostart/x11vnc.desktop
echo Hidden=false>>/home/pi/.config/autostart/x11vnc.desktop
# remove desktop links
rm /home/pi/Desktop/*.desktop


If the X11VNC does not start correctly after boot try to change parameters in the x11vnc.desktop file

sudo vim /home/pi/.config/autostart/x11vnc.desktop

Time settings

# set timezone and select your city
sudo dpkg-reconfigure tzdata

#reconfigure ntp
sudo dpkg-reconfigure ntp

# set timeserver
sudo vim /etc/ntp.conf
server ntp.sysstem.at iburst

#stop ntp daemon
sudo /etc/init.d/ntp stop

#set time
sudo ntpdate ntp.sysstem.at

#start ntp
sudo /etc/init.d/ntp start

Monitor preferences

sudo vim /boot/config.txt

search and edit the following

# remove black borders on screen. set to 0 if problem occour

# pretend hdmi is plugged in and hdmi resolution will work

#Force console size


# set resolution to 1920x1080@60Hz
# hdmi_mode=4 for 1280x720@60Hz
#check website for more modes

# remove 1 of 2 desktops (we only need 1)

vim /home/pi/.config/openbox/lxde-rc.xml
# at desktops:

X11VNC settings

# define a password for your x11vnc
x11vnc -storepasswd /home/pi/.vnc/passwd

Upload a new desktop wallpaper, most likely the logo of your company

Change background by rightclicking on your desktop and choose a new picture

 VNC client – autostart script

sudo vim /home/pi/.config/autostart/vncview.sh

paste the following:

# Process check script: The script simply checks if a process is running and if it is not found to be running it will execute it.
# The script loops in preset intervals, hence it is possible to monitor a process continuously.

# Variables
ProcessInstances=`sudo ps aux | grep [s]svncviewer | wc -l`

#VNC Variables
para="-display :$display -viewonly -fullscreen -shared -passwd $passfile -scale $resolution -encodings zywrle"

# Logic
while [ $Running -gt 0 ]

if [ `sudo ps aux | grep [s]svncviewer | wc -l` -gt 0 ]; then
echo Process already running! Nothing to do.
echo Process not running! Starting process
# This is the command that should start the process in question
$vnc $host $para &

# How often shall we repeat the check?
echo Sleeping for $SleepInterval seconds
sleep $SleepInterval


exit 0

Service for VNC Client script

sudo vim /etc/init.d/vncviewd

paste the following

# Provides: vncviewd
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start VNC Viewer Daemon.
# Description: Start VNC Viewer at boot time.

#! /bin/sh
# /etc/init.d/vncviewd

# If you want a command to always run, put it here

# Carry out specific functions when asked to by the system
case "$1" in
    echo "Starting vncviewd"
    # run application you want to start
    su pi /home/pi/.config/autostart/vncview.sh
    exit 0
    echo "Stopping vncviewd"
    # kill application you want to stop
    pkill -f vncview.sh
    exit 0
    echo "Usage: /etc/init.d/vncviewd {start|stop}"
    exit 1

exit 0

register vncviewd for autostart

sudo update-rc.d vncviewd

Monitor script

sudo vim /etc/init.d/monitor

paste the following


# Provides: monitor
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start or stop Monitor
# Description: Start or stop Monitor
#! /bin/sh
# /etc/init.d/monitor
# Carry out specific functions when asked to by the system
case "$1" in
echo "Starting monitor"
# Enable HDMI with preferred mode
/opt/vc/bin/tvservice -p
# Change console to enable monitor output
# not very nice
sudo chvt 6
sudo chvt 7
echo "Stopping monitor"
/opt/vc/bin/tvservice -o
echo "Usage: /etc/init.d/monitor {start|stop}"
exit 1
exit 0

register for autostart

sudo update-rc.d monitor

Disable sleep mode for monitor

sudo vim /etc/kbd/config
# DO NOT changes this line. VNC needs to blank the console for fullscreen mode
BLANK_TIME=30 (Was 30)

# Powerdown time. The console will go to DPMS Off mode POWERDOWN_TIME
# minutes _after_ blanking. (POWERDOWN_TIME + BLANK_TIME after the last input)
# change this line (original was 30)

restart KBD

sudo /etc/init.d/kbd restart

Set a time schedule for your monitor. This reduces energy consumption.

Monitor only runs form 6 am to 6 pm (06:00-18:00)

sudo vim /etc/crontab

paste the following

# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.


# m h dom mon dow user  command
17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly
25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
0  6 * * 1-5    root    /etc/init.d/monitor start
0 18 * * 1-5    root    /etc/init.d/monitor stop

Delete your history

history -c

Test your configuration and make a backup of your SD card. It is always good to have one 😉

The only thing left what i wanted to do was to add a custom loading screen while booting.

Maybe you can get it working by using plymouth or other programs. If so please don’t hesitate to leave me a comment.

Here is an extenstion for this blog-entry you also might to read!

*Raspberry Pi is a trademark of the Raspberry Pi Foundation