Recently had to roll out a new Zoneminder install for a client using ESXi 5.1. Instead of using Viktor Petersson’s ESXi appliance (which I’ve used in the past but is outdated and no longer developed), I created a fresh, fully updated Zoneminder virtual machine template. You can use this .OVA vm template with any flavor of VMware you wish, not just ESXi. This virtual machine is up to date as of the writing of this blog post (9/23/12). It includes Ubuntu 32-bit 12.04.1 LTS and Zoneminder 1.25.0 (see bottom of post for upgrade instructions to 1.26+). Additionally, it has version 9 of VMware tools preinstalled as well.  You can have a fully configured Zoneminder install in minutes using my virtual appliance.  In ESXi, simply load the vSphere client, go to File and select Deploy OVF Template and point it to the downloaded file. If using the .OVA with any VMware product other than vSphere/ESXi, you’ll need the OVF Tool located here. I’d recommend using at least 512MB of RAM, and at least 20GB of disk space if you plan on recording video.

Download the ZoneMinder VMware Appliance Template from Sourceforge

Template tested with the following versions/flavors of VMware: ESXi 5.1, ESXi 5.0 Update 2, Fusion 4 for Macintosh

Config details:

Admin username is zmadmin, as is the password.
MySQL Root password is zmadmin as well.
The Zoneminder web interface username and password is admin.
There is no root password set for Ubuntu.

Access Zoneminder’s web interface at http://YOURIPADDRESS/zm 

The appliance, once deployed will get an IP and DNS via DHCP.  You can change the IP to static by altering /etc/network/interfaces:

sudo nano /etc/network/interfaces

Change the following lines: 

# The primary network interface
auto eth0
iface eth0 inet dhcp

To (where x.x.x.x is your desired gateway and static IP):

# The primary network interface
auto eth0
iface eth0 inet static
address x.x.x.x
netmask 255.255.255.0
gateway x.x.x.x

Add your fully qualified name to the /etc/hosts file:

sudo nano /etc/hosts

127.0.1.1 zoneminder.yourdomain.com zoneminder
x.x.x.x zoneminder.yourdomain.com zoneminder

Optional: Add your DNS servers for name resolution (the defaults are Verizon’s DNS at 4.2.2.1 and 4.2.2.2):

sudo nano /etc/resolvconf/resolv.conf.d/tail

Changing “nameserver” entries to whatever your internal DNS servers are. The file defaults are:

nameserver 4.2.2.1
nameserver 4.2.2.2

Presto! You have a shiny new Zoneminder install!  Enjoy and let me know what you think in the comments section below.

Note: this VM template doesn’t include the Cambozola Java jar, which enables viewing of live streaming (montage) via Java.  To install it:

cd /tmp
sudo wget http://www.charliemouse.com:8080/code/cambozola/cambozola-latest.tar.gz
tar xvfz cambozola-latest.tar.gz
sudo cp /tmp/cambozola-0.93/dist/* /usr/share/zoneminder
You may need to update the 0.93 portion of the above line if you download a newer version of Cambozola.

In the ZoneMinder web interface, under Options, Image, make sure to check the OPT_CAMBOZOLA box to enable it.

FAQ/Support:

My disk is full and MySQL won’t start, how can I purge recordings to get ZM working again?

cd /usr/share/zoneminder/events
sudo rm -rf *
sudo reboot

How can I make the VM disk bigger?

Option 1 (recommended):
Run VMWare Converter to duplicate a deployed Zoneminder VM and increase the size during the conversion process.

Option 2: gParted
1. Remove any snapshots.
2. Increase the VM disk size in vSphere.
3. Use the gParted Live CD to resize the partition.

To fix “Shared Data Size Conflict in Shared_Data for monitor” in your logs, see this blog:

http://lachlanmiskin.com/blog/2012/06/24/zoneminder-shared-data-size-conflict-in-shared_data-for-monitor/ to properly set the architecture to 32-bit.  This is a Zoneminder bug.

To install the latest version of the VMware tools: Right click host, Guest, Install/Upgrade VMware Tools.  Select “Automated Tools Upgrade” with the “–default” as the “Advanced Options”

Screen Shot 2013-06-22 at 10.03.36 AM

Upgrading to ZoneMinder 1.26+

Upgrading to the latest version of Zoneminder is a simple process of executing the following commands in the specified order:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:iconnor/zoneminder
sudo apt-get update
sudo apt-get dist-upgrade

The last command above will prompt you several times for the ZoneMinder upgrade.  Answer in this order: Y,Y,Y, Enter, Enter, Y,Y
Ignore the warning about stopping Zoneminder as it will already be stopped.

If you’d like to see the Zoneminder upgrade process looks like and how I answered the interactive upgrade questions, click here.

Important: Sometimes Zoneminder upgrades will destroy your symlinks.  Perform the following commands to reestablish these symlinks:

sudo /etc/init.d/zoneminder stop
sudo ln -s /var/cache/zoneminder/events /usr/share/zoneminder/events
sudo ln -s /var/cache/zoneminder/images /usr/share/zoneminder/images
sudo /etc/init.d/zoneminder start

Lastly, after the upgrade your Zoneminder won’t automatically start.  To fix this:

sudo nano /etc/init.d/zoneminder

Add “sleep 15″ before the zmfix -a line as pictured below (see arrow) and reboot.

sleepfix

You can upgrade to future versions by simply typing the last command (sudo apt-get dist-upgrade) as you have already added the repository for ZoneMinder.  Just make sure to add the sleep command above when upgrading.


Tagged with: