How to install ZoneMinder Master, v1.35.4 on UBUNTU 20.04 LTS ( Focal Fossa) Using a Docker image

In this tutorial ,we are going to use “Docker: Enterprise Container Platform”  (docker.io) on Ubuntu 20.04 LTS ( Focal Fossa)

First

Installation of Docker on Ubuntu 20.04 LTS ( Focal Fossa )

On the Ubuntu terminal

Zoneminder-master , latest docker images with Mysql 8 & MSMTP

sudo apt install docker.io

This image has been created on ubuntu:focal with zoneminder-1.34/ubuntu focal main

To pull the Repository from the dockerhub please refer the following link

https://hub.docker.com/r/bkjaya1952/docker-zoneminder-master-mysql8

To create a Zonminder-master docker container (name zm)with mysql 8 & msmtp

On the Ubuntu terminal enter the following commands

(You will have to configure the running zm container for mysql 8 ,zm data base and edit the timezone during the first run .)

sudo docker create -t -p 8080:80 --shm-size=4096m --name zm --privileged=true bkjaya1952/docker-zoneminder-master-mysql8:latest
sudo docker start zm
sudo docker exec -t -i zm /bin/bash

(Now you will be with in the zm container.

Make changes as follows)

(Configuring Mysql and Changing root password)

mysql
ALTER USER 'root'@'localhost' IDENTIFIED BY 'yourpassword';
FLUSH PRIVILEGES ;
quit

(Creating zm sql data base)

mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql
mysql
CREATE USER 'zmuser'@localhost IDENTIFIED BY 'zmpass';

(If CREATE does not work try with ALTER )

GRANT ALL PRIVILEGES ON zm.* TO 'zmuser'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES ;
quit
mysqladmin -uroot -p reload

(Note:- Here use the ‘yourpassword’ created for ‘root’@’localhost’ earlier )

mysql -u zmuser -p zm < /usr/share/zoneminder/db/zm_update-1.35.4.sql

( Note:- Use zmpass as the password here )

(zm_update-1.35.4.sql file name may vary depending on the latest zm data base. To find the latest version please refer https://launchpad.net/~iconnor/+archive/ubuntu/zoneminder-master )

dpkg-reconfigure tzdata

Then edit your timezone

exit
sudo docker restart zm

http://localhost:8080/zm/

(To use msmtp for emailing please refer https://hub.docker.com/repository/docker/bkjaya1952/docker-zoneminder-master)

( The procedure of composing an image can be obtained from the following links

https://bkjaya.wordpress.com/2020/01/15/how-to-build-a-zoneminder-master-docker-image-with-mysql-8-msmtp/ )

Note:- If you want your docker container zm to detect ip camera automatically, you will have to use following command when creating the container .

sudo docker create -t -p 80:80 --shm-size=4096m --name zm --network=host --privileged=true bkjaya1952/docker-zoneminder-master-mysql8:latest

In this case you will have to restrain in using the port 80 in your host for any other purpose when running the zm container.

Then the zoneminder web panel will be at http://localhost/zm/

Figure:- ZM-Console with USB Camera

How to Install ZoneMinder-Master ,v 1.35.4 on UBUNTU 20.04 LTS ( Focal Fossa)

Installation of Zoneminder To install Zoneminder-Master ,v 1.35.4 Please refer Connor’s web site Open the terminal and run following commands.

sudo su

sudo add-apt-repository ppa:iconnor/zoneminder-master

sudo apt update

apt install zoneminder

Configuring Mysql and Changing  root password

rm /etc/mysql/my.cnf 

cp /etc/mysql/mysql.conf.d/mysqld.cnf  /etc/mysql/my.cnf 

/etc/init.d/mysql start 

mysql

ALTER USER 'root'@'localhost' IDENTIFIED BY 'yourpassword'; 

FLUSH PRIVILEGES ; 

quit

Creating zm sql data base

mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql 

mysql 

CREATE USER 'zmuser'@localhost IDENTIFIED BY 'zmpass'; 

(If CREATE does not work try with ALTER )

GRANT ALL PRIVILEGES ON zm.* TO 'zmuser'@'localhost' WITH GRANT OPTION; 

FLUSH PRIVILEGES ; 

quit 

mysqladmin -uroot -p reload

(Note:- Here use the 'yourpassword' created for 'root'@'localhost' earlier )

mysql -u zmuser -p zm < /usr/share/zoneminder/db/zm_update-1.35.4.sql

( Note:- Use zmpass as the password here )

Configuring Zoneminder

chmod 740 /etc/zm/zm.conf

chown root:www-data /etc/zm/zm.conf 

adduser www-data video

a2enmod cgi 

a2enconf zoneminder

a2enmod rewrite 

a2enmod headers 

a2enmod expires 

Starting Zoneminder and apache
systemctl enable zoneminder

service zoneminder start 

service apache2 reload
 
Open zoneminder web console (http://localhost/zm/)
Figure:- ZM Console after adding USB Cameara
Note:-
1. )  If there is a user in the same name , you will  get an error ( ERROR 1396 (HY000)) ,when creating mysql user with “CREATE USER” .  In that case please replace “CREATE USER” with  “ALTER USER” .

2.)  If you get “MySQL: “Access denied for user ‘debian-sys-maint’@’localhost’”” when updating zoneminder , you can correct it by making following changes.

On the Ubuntu terminal

sudo gedit /etc/mysql/debian.cnf

Then you can see the automatically generated debian password for mysql

as follows in the opened “debian.cnf” file

( In your case , you may  get a different password)



# Automatically generated for Debian scripts. DO NOT TOUCH!
[client]
host = localhost
user = debian-sys-maint
password = s4bSHUP05s1J32G5
socket = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host = localhost
user = debian-sys-maint
password = s4bSHUP05s1J32G5
socket = /var/run/mysqld/mysqld.sock



Now you will have to grant permissions to ‘debian-sys-maint’@’localhost’” as follows

sudo su mysql ALTER USER 'debian-sys-maint'@localhost IDENTIFIED BY 's4abSHUP05s1J32G5';



GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' WITH GRANT OPTION; 

quit

How to install Zoneminder v1.34.14. on UBUNTU 20.04 LTS ( Focal Fossa) Using a Docker image

 

In this tutorial ,we are going to use “Docker: Enterprise Container Platform”  (docker.io) on Ubuntu 20.04 LTS ( Focal Fossa)

First

Installation of Docker on Ubuntu 20.04 LTS ( Focal Fossa )

On the Ubuntu terminal

sudo apt install docker.io

 

zoneminder-1.34 ,docker images with php 7.4 ,Mysql 8 & MSMTP

This image has been created on ubuntu:focal with zoneminder-1.34/ubuntu focal main

To pull the Repository from the dockerhub please refer the following link

https://hub.docker.com/repository/docker/bkjaya1952/docker-zoneminder-php7.4-mysql8

Usage :

To create a zoneminder-1.34 docker container (name zm)with php 7.4 ,mysql 8 & msmtp

On the Ubuntu terminal enter the following commands

sudo docker create -t -p 8080:80 --shm-size=4096m --name zm --privileged=true bkjaya1952/docker-zoneminder-php7.4-mysql8:1.34 sudo docker start zm

(You will have to configure the running zm container for mysql 8 ,zm data base and make some changes to start apache and zoneminder during the first run .)

sudo docker exec -t -i zm /bin/bash

(Now you will be with in the zm container.

Make changes as follows)

Configuring Mysql and Changing root password)

mysql ALTER USER 'root'@'localhost' IDENTIFIED BY 'yourpassword'; FLUSH PRIVILEGES ;
quit

(Creating zm sql data base)

mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql mysql CREATE USER 'zmuser'@localhost IDENTIFIED BY 'zmpass'; (If CREATE does not work try with ALTER ) GRANT ALL PRIVILEGES ON zm.* TO 'zmuser'@'localhost' WITH GRANT OPTION; FLUSH PRIVILEGES ; quit
mysqladmin -uroot -p reload

Then edit your timezone in the system

dpkg-reconfigure tzdata

Then edit your timezone

Then edit your time zone at /etc/php/7.4/apache2/php.ini

sed -i "961i date.timezone = Asia/Colombo" /etc/php/7.4/apache2/php.ini ( ie. Asia/Colombo )
exit sudo docker restart zm

http://localhost:8080/zm/

(To use msmtp for emailing please refer https://hub.docker.com/repository/docker/bkjaya1952/docker-zoneminder-master)

( The procedure of composing an image can be obtained from the following links

https://bkjaya.wordpress.com/2020/01/15/how-to-build-a-zoneminder-master-docker-image-with-mysql-8-msmtp/ )

Note:- If you want your docker container zm to detect ip camera automatically, you will have to use the following command when creating the container .

sudo docker create -t -p 80:80 --shm-size=4096m --name zm 
--network=host --privileged=true 
bkjaya1952/docker-zoneminder-php7.4-mysql8:1.34

In this case you will have to restrain in using the port 80 in your host for any other purpose when running the zm container.

Then the zoneminder web panel will be at http://localhost/zm/

Screenshot from 2020-05-19 11-01-01

Figure:- ZM-Console with USB Camera

How to Install ZoneMinder, v1.34.12. on UBUNTU 20.04 LTS ( Focal Fossa)

Installation of Zoneminder To install Zoneminder v1.34.12. (stable)Please refer Connor’s web site Open the terminal and run following commands.

sudo su

sudo add-apt-repository ppa:iconnor/zoneminder-1.34

sudo apt-get update

apt install zoneminder

Configuring Mysql and Changing  root password

rm /etc/mysql/my.cnf 

cp /etc/mysql/mysql.conf.d/mysqld.cnf /etc/mysql/my.cnf

/etc/init.d/mysql start

mysql


ALTER USER 'root'@'localhost' IDENTIFIED BY 'yourpassword';

FLUSH PRIVILEGES ;

quit

Creating zm sql data base

mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql

mysql 

CREATE USER 'zmuser'@localhost IDENTIFIED BY 'zmpass'; 

(If CREATE does not work try with ALTER )

GRANT ALL PRIVILEGES ON zm.* TO 'zmuser'@'localhost' WITH GRANT OPTION; 

FLUSH PRIVILEGES ; 

quit 

mysqladmin -uroot -p reload

Configuring Zoneminder

chmod 740 /etc/zm/zm.conf

chown root:www-data /etc/zm/zm.conf 

adduser www-data video

a2enmod cgi 

a2enconf zoneminder

a2enmod rewrite 

a2enmod headers 

a2enmod expires 

Starting Zoneminder and apache

systemctl enable zoneminder

service zoneminder start

service apache2 reload

Open zoneminder web console (http://localhost/zm/)

Screenshot from 2020-05-11 13-31-32

Figure:- ZM Console after adding USB Cameara

Note:-
1. )  If there is a user in the same name , you will  get an error ( ERROR 1396 (HY000)) ,when creating mysql user with “CREATE USER” .  In that case please replace “CREATE USER” with  “ALTER USER” .
2.)  If you get “MySQL: “Access denied for user ‘debian-sys-maint’@’localhost’”” when updating zoneminder , you can correct it by making following changes.
On the Ubuntu terminal
sudo gedit /etc/mysql/debian.cnf
Then you can see the automatically generated debian password for mysql
as follows in the opened “debian.cnf” file
( In your case , you may  get a different password)

# Automatically generated for Debian scripts. DO NOT TOUCH!
[client]
host = localhost
user = debian-sys-maint
password = s4bSHUP05s1J32G5
socket = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host = localhost
user = debian-sys-maint
password = s4bSHUP05s1J32G5
socket = /var/run/mysqld/mysqld.sock

Now you will have to grant permissions to ‘debian-sys-maint’@’localhost’” as follows
sudo su

mysql

ALTER USER 'debian-sys-maint'@localhost IDENTIFIED BY 's4abSHUP05s1J32G5';
 
GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' WITH GRANT OPTION;

quit

How to install QEMU on UBUNTU 20.04 LTS ( Focal Fossa)

Please refer the following link to know about QEMU Emulator .

https://www.qemu.org/

Installation of QEMU with other relevant software for graphical emulation

Open the Ubuntu terminal and run

sudo apt install qemu qemu-utils qemu-kvm virt-manager
libvirt-daemon-system libvirt-clients bridge-utils

 

In this example we are installing Windows XP

We need to insert Windows XP installation disk in to DVD drive

After installation you will get a launcher of Virtual Machine Manager  on the Ubuntu

Dash       Screenshot from 2020-04-27 08-38-42

Before creating the new virtual machine , all USB dongles have to be inserted to enable to install drivers while installing  Windows XP

When you launch the Virtual Machine Manager, you will get the panel on the screen.

On the panel go to Edit>Preferences>New VM and Console to make appropriate chanages

Screenshot from 2020-04-27 08-45-24

Figure :-1 Selecting Preferences

Note:- Please notice the Auto redirect on USB attach to be able to recognize the USB drivers automatically

 

 

Start to create a new virtual machine by pressing File tab ,you will get a panel as shown in the following figure

Screenshot from 2020-04-25 21-22-09

Figure:- 2  Creating a new virtual machine to install Windows XP

Then choose the CD ROM where you placed the Windows XP CD by pressing the Browse tab.

Screenshot from 2020-04-25 21-23-02

Figure 3:- Installation of Windows XP on the new virtual machine

Figure 4:- Installation of Windows XP on the new virtual machine contd:

Figure 5:- Installation of Windows XP on the new virtual machine contd:

In this case , virtual machine is connected to internet using an   USB dongle .

If you want to connect to internet with a high speed fixed LAN cable , you will have to add hardware and make changes in Virtual Network Interface as shown in the following figure

Screenshot from 2020-04-25 23-18-50

Figure:- 6 Adding hardware of  high speed fixed LAN cable for connecting internet

Screenshot from 2020-04-27 08-43-00

Figure:- 7 Can add  USB drives even after booting Windows XP ( by pressing Virtual Machine tab on the panel > Redirect USB drive )

 

 

Screenshot from 2020-04-27 21-56-59

Figure:- 8 Running Windows XP using  QEMU on UBUNTU 20.04

 

 

Zoneminder-master , latest. docker image with Mysql 8 & MSMTP

Zoneminder-master , latest. docker image with Mysql 8 & MSMTP

This image has been created on ubuntu:eoan with zoneminder-master/ubuntu eoan main

To pull the Repository from the dockerhub please refer the following link

https://hub.docker.com/r/bkjaya1952/docker-zoneminder-master-mysql8

Usage :

To create a Zonminder-master docker container (name zm)with mysql 8 & msmtp

On the Ubuntu terminal enter the following commands

sudo docker create -t -p 8080:80 --shm-size=4096m --name zm --privileged=true bkjaya1952/docker-zoneminder-master-mysql8:latest

sudo docker start zm

(You will have to configure the running zm container for mysql 8 ,zm data base and edit the timezone during the first run .)

sudo docker exec -t -i zm /bin/bash

(Now you will be with in the zm container.

Make changes as follows)

mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sqlmysql

CREATE USER 'zmuser'@localhost IDENTIFIED WITH mysql_native_password BY 'zmpass';

GRANT ALL PRIVILEGES ON zm.* TO 'zmuser'@'localhost' WITH GRANT OPTION;

FLUSH PRIVILEGES ;

quit

mysqladmin -uroot -p reload

dpkg-reconfigure tzdata

Then edit your timezone

exit

sudo docker restart zm

http://localhost:8080/zm/

(To use msmtp for emailing please refer https://hub.docker.com/repository/docker/bkjaya1952/docker-zoneminder-master)

( The procedure of composing an image can be obtained from the following links

https://bkjaya.wordpress.com/2020/01/15/how-to-build-a-zoneminder-master-docker-image-with-mysql-8-msmtp/ )

Note:- If you want your docker container zm to detect ip camera automatically, you will have to use following command when creating the container .

sudo docker create -t -p 80:80 --shm-size=4096m --name zm --network=host --privileged=true bkjaya1952/docker-zoneminder-master-mysql8:latest

In this case you will have to restrain in using the port 80 in your host for any other purpose when running the zm container.

Then the zoneminder web panel will be at http://localhost/zm/

Zoneminder-master-latest ,docker images with php 7.4 ,Mysql 8 & MSMTP

This image has been created on ubuntu:eoan with zoneminder-master/ubuntu eoan main .

To pull the Repository from the dockerhub please refer the following link

https://hub.docker.com/r/bkjaya1952/docker-zoneminder-master-php7.4-mysql8

Usage :

To create a Zonminder-master docker container (name zm)with php 7.4 ,mysql 8 & msmtp

On the Ubuntu terminal enter the following commands

sudo docker create -t -p 8080:80 --shm-size=4096m --name zm --privileged=true bkjaya1952/docker-zoneminder-master-php7.4-mysql8:latest 

sudo docker start zm

(You will have to configure the running zm container for mysql 8 ,zm data base and make some changes to start apache and zoneminder during the first run .)

sudo docker exec -t -i zm /bin/bash

(Now you will be with in the zm container.

Make changes as follows)

mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql

mysql 

CREATE USER 'zmuser'@localhost IDENTIFIED WITH mysql_native_password BY 'zmpass';

GRANT ALL PRIVILEGES ON zm.* TO 'zmuser'@'localhost' WITH GRANT OPTION;

FLUSH PRIVILEGES ; 

quit 

mysqladmin -uroot -p reload 

dpkg-reconfigure tzdata 

Then edit your timezone in the system

Then edit your time zone at /etc/php/7.4/apache2/php.ini

sed -i "961i date.timezone = Asia/Colombo" /etc/php/7.4/apache2/php.ini ( ie. Asia/Colombo )

exit 

sudo docker restart zm 

http://localhost:8080/zm/

(To use msmtp for emailing please refer https://hub.docker.com/repository/docker/bkjaya1952/docker-zoneminder-master)

( The procedure of composing an image can be obtained from the following links

https://bkjaya.wordpress.com/2020/01/15/how-to-build-a-zoneminder-master-docker-image-with-mysql-8-msmtp/ )

Note:- If you want your docker container zm to detect ip camera automatically, you will have to use the following command when creating the container .

sudo docker create -t -p 80:80 --shm-size=4096m --name zm --network=host --privileged=true bkjaya1952/docker-zoneminder-master-php7.4-mysql8:latest

In this case you will have to restrain in using the port 80 in your host for any other purpose when running the zm container.

Then the zoneminder web panel will be at http://localhost/zm/