How to set a static MAC address on VMware ESXi virtual machine

Question: I want to assign a static MAC address to a virtual machine (VM) on VMware ESXi. However, when I attempt to start a VM with a static MAC address, the VM fails to start and throws an error “The MAC Address entered is not in the valid range. Valid values are between “xx:xx:xx:xx:xx:xx” and “xx:xx:xx:xx:xx”.

When you create a VM on VMware ESXi, each network interface of the VM is assigned a dynamically generated MAC address. If you want to change this default behavior and assign a static MAC address to your VM, here is how to do it.

14726591627_338dc582dd_o

As you can see above, VMware’s vSphere GUI client already has a menu for setting a static MAC address for a VM. However, this GUI-based method only allows you to choose a static MAC address from 00:50:56:xx:xx:xx, which is VMware-reserved MAC address range. If you attempt to set any arbitrary MAC address outside this MAC range, you will fail to launch the VM, and get the following error.

3463018452_f3526cffda

Fortunately, there is a workaround to this limitation. The solution is, instead of using vSphere GUI client, editing .vmx file of your VM directly, after logging in to the ESXi host.

First, turn off the VM to which you want to assign a static MAC address.

Enable SSH access to your ESXi host if you haven’t done it already. Then log in to the ESXi host via SSH.

Move to the directory where your VM’s .vmx file is located:

# cd vmfs/volumes/datastore1/[name-of-vm]

Open .vmx file with a text editor, and add the following fields. Replace the MAC address field with your own.

#ethernet0.addressType = "static"
#ethernet0.checkMACAddress = "false"
#ethernet0.address = "00:0c:29:1f:4b:ac"

Now you should be able to launch a VM with the static MAC address you defined in .vmx file.

Continue Reading

Install Cpanel/WHM on CentOS 7, RHEL 7

Here in this article we will discuss about latest cPanel & WHM Version 11.50 feature and prerequisites and installation on fresh CentOS 7  / RHEL 7 Version.
Latest Features of cPanel  & WHM 11.50 :

CentOS , CloudLinux , and RHEL 7 support
Use the XFS  or ext4 filesystems.
Less booting time
Greylisting feature : which protect server from unwanted emails and untrusted email servers .

Installation Recommended settings:

Disable OS Firewall before installation .
Recommended Hardware :
Minimum & Recommended Processor should be 226MHZ
Minimum RAM should be 1 GB.
Minimum Disk Space should be 20 GB .

Installation of cPanel in CentOS 7 / RHEL 7 / CloudLinux 7 :

Before doing cpanel & WHM installation first ensure your OS Version , RAM and diskspace.

Deactivate firewall on CentOS 7 , CloudLinux 7 and RHEL 7 :

# iptables-save > ~/iptables.rules
# systemctl stop firewalld.service
# systemctl disable firewalld.service

Disable Security Enhanced Features ( SELinux ) :

If your server running SELinux Features of security, then disable this features .

To disable , run the below command.

Edit the configuration file /etc/selinux/config and set the parameter SELINUX to disabled, below is my configuration file , after set the parameter you need to reboot the server.

# vim /etc/selinux/config

# This file controls the state of SELinux on the system.

# SELINUX= can take one of these three values:

#     enforcing - SELinux security policy is enforced.

#     permissive - SELinux prints warnings instead of enforcing.

#     disabled - No SELinux policy is loaded.

SELINUX=permissive

# SELINUXTYPE= can take one of these two values:

#     targeted - Targeted processes are protected,

#     minimum - Modification of targeted policy. Only selected processes are protected.

#     mls - Multi Level Security protection.

SELINUXTYPE=targeted

Installation set up steps :

cPanel installation need perl package , so we need to install perl before instaalation .

# yum install perl

After installation of perl, set the hostname of server , the hostname should be in FQDN i.e fully qualified domain name. Below is steps to set hostname in Centos / RHEL 7.

Below command to check  hostname of server :

# hostnamectl

To set hostname :

#hostnamectl set-hostname cpanel.techtransit.org

Install cPanel/WHM

Now we will download cpanel script on home directory of server ,  which will install cpanel & WHM  .Follow below steps for installation.

# cd /home
# curl -o latest -L https://securedownloads.cpanel.net/latest
# sh latest

Now script will run some hours and after installation you will get some output  like , time taken in installation as well as server access url and access details, you will use in login root as a user and use password of root user.

You will get WHM access like below url.
ACCESS URL:

https://your –server-public-ip:2087/

OR

https://server-hostname:2087/

cpanel_11.50_centos7

cpanel_11.50_centos7

After access of url in browser and put the username password details in access url and accept license agreement, you can configure server networking, ip address and nameserver as according to you , you should have good nice knowledge of System Admin part.

Hope you enjoy this post , for any concern please comment here and give us feedback. Thanks

Continue Reading

Install Guacamole on CentOS 7

This post is for installing the latest version of Guacamole on CentOS 7, as there are several difference from the previous guide I did. If you want to read more about Guacamole, and how awesome it is, I recommend you take a glance at my previous post here.

**Note, I am installing the MySQL Authentication package which allows me to store connections and authentication information in a database, instead of a plain-text XML file.
Let’s Get Started!

1.) prerequisites:

yum -y install epel-release wget
wget -O /etc/yum.repos.d/home:felfert.repo http://download.opensuse.org/repositories/home:/felfert/Fedora_19/home:felfert.repo
yum -y install cairo-devel freerdp-devel gcc java-1.8.0-openjdk.x86_64 libguac libguac-client-rdp libguac-client-ssh libguac-client-vnc \
libjpeg-turbo-devel libpng-devel libssh2-devel libtelnet-devel libvncserver-devel libvorbis-devel libwebp-devel openssl-devel pango-devel \
pulseaudio-libs-devel terminus-fonts tomcat tomcat-admin-webapps tomcat-webapps uuid-devel

Above we are just installing adding the EPEL and Felfert repositories that contain the files we need, and installing all our prereqs. Easy.

2.) guacd install

mkdir ~/guacamole && cd ~/
wget http://sourceforge.net/projects/guacamole/files/current/source/guacamole-server-0.9.9.tar.gz
tar -xzf guacamole-server-0.9.9.tar.gz && cd guacamole-server-0.9.9
./configure --with-init-dir=/etc/init.d
make
make install
ldconfig

Guacamole is delivered in two different pieces. The back-end is what we just installed above, from source, called guacd (or guacamole daemon). The other piece is the guacamole client, or web frontend. This is delivered via Jetty, and installed next.

3.) guacamole client

mkdir -p /var/lib/guacamole && cd /var/lib/guacamole/
wget http://sourceforge.net/projects/guacamole/files/current/binary/guacamole-0.9.9.war -O guacamole.war
ln -s /var/lib/guacamole/guacamole.war /var/lib/tomcat/webapps/
rm -rf /usr/lib64/freerdp/guacdr.so
ln -s /usr/local/lib/freerdp/guacdr.so /usr/lib64/freerdp/

We now have the guacamole server daemon and the guacamole client installed. Next up is the MySQL Authentication piece, using MariaDB.

4.) mysql authentication

yum -y install mariadb mariadb-server
mkdir -p ~/guacamole/sqlauth && cd ~/guacamole/sqlauth
wget http://sourceforge.net/projects/guacamole/files/current/extensions/guacamole-auth-jdbc-0.9.9.tar.gz
tar -zxf guacamole-auth-jdbc-0.9.9.tar.gz
wget http://dev.mysql.com/get/Downloads/Connector/j/mysql-connector-java-5.1.38.tar.gz
tar -zxf mysql-connector-java-5.1.38.tar.gz
mkdir -p /usr/share/tomcat/.guacamole/{extensions,lib}
mv guacamole-auth-jdbc-0.9.9/mysql/guacamole-auth-jdbc-mysql-0.9.9.jar /usr/share/tomcat/.guacamole/extensions/
mv mysql-connector-java-5.1.38/mysql-connector-java-5.1.38-bin.jar /usr/share/tomcat/.guacamole/lib/
systemctl restart mariadb.service

The above is installing mariadb, downloading the needed .jar’s, and moving them to where they belong. All but one jar file is included in the Guacamole MySQL Auth download, which is the MySQL Java Connector.

5.) configure database

mysqladmin -u root password MySQLRootPass
mysql -u root -p   # Enter above password
create database guacdb;
create user 'guacuser'@'localhost' identified by 'guacDBpass';
grant select,insert,update,delete on guacdb.* to 'guacuser'@'localhost';
flush privileges;
quit

Here we created the database and user for guacd to use.

6.) extend database schema

cd ~/guacamole/sqlauth/guacamole-auth-jdbc-0.9.9/mysql/schema/
cat ./*.sql | mysql -u root -p guacdb   # Enter SQL root password set above

And here we extend the schema of the database we created.

7.) configure guacamole

mkdir -p /etc/guacamole/ && vi /etc/guacamole/guacamole.properties

The above is creating our needed directories, and then creating the guacamole.properties file. This file is what tomcat uses to know what port to talk to guacd on as well as how to access the database. Here is a basic guacamole.properties file that will do what you need.

# MySQL properties
mysql-hostname: localhost
mysql-port: 3306
mysql-database: guacdb
mysql-username: guacuser
mysql-password: guacDBpass

# Additional settings
mysql-default-max-connections-per-user: 0
mysql-default-max-group-connections-per-user: 0

This will configure guacamole to use the database and user that we created on the default port of 4822. Note, this is for internal communication only and is not the port that you will be accessing the web interface on.

And we have to create a symlink so Guacamole can find the config file:

ln -s /etc/guacamole/guacamole.properties /usr/share/tomcat/.guacamole/

8.) Cleanup

All that’s left is a little housecleaning!

cd ~ && rm -rf guacamole*
systemctl enable tomcat.service && systemctl enable mariadb.service && chkconfig guacd on
systemctl reboot

Once your server boots, you’ll have Guacamole running and ready to be used! Head on over to http://guac_server_ip:8080/guacamole to start using your new Guacamole server! default username and password are both ‘guacadmin’.

If you’re having trouble accessing the webpage for Guacamole, make sure you have configured firewalld (or disabled it) to allow access to port 8080.

Leave me some feedback!

Continue Reading

Install Nagios 4.0.4 on Centos 7

For RHEL/CentOS users:

#yum install -y wget httpd php gcc glibc glibc-common gd gd-devel make net-snmp
#yum install   httpd php  gd gd-devel gcc glibc glibc-common openssl perl perl-devel makesasa

Download Nagios Core and Nagios Plugins Tarballs
For all systems, run the following commands in your terminal:

cd /tmp
#wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4.0.4.tar.gz
#wget http://nagios-plugins.org/download/nagios-plugins-2.0.tar.gz

This will download Nagios Core, and it’s required plugins.
Adding the Nagios User and Group
Next add the appropriate user and group for the Nagios process to run:

#useradd nagios
#groupadd nagcmd
#usermod -a -G nagcmd nagios

Nagios Core Installatiom

#tar zxvf nagios-4.0.4.tar.gz
#tar zxvf nagios-plugins-2.0.tar.gz

Change to the new Nagios directory and install the packages:

#cd nagios-4.0.4
#./configure --with-command-group=nagcmd
#make all
#make install
#make install-init
#make install-config
#make install-commandmode
#make install-webconf
#cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/
#chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers
#/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
#/etc/init.d/nagios start

For RHEL/CentOS users:

#/etc/init.d/httpd start
#systemctl start httpd

Create a Default User for Web Access.
Add a default user for Web Interface Access:

#htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

Nagios Plugin Installation

#cd /tmp/nagios-plugins-2.0
#./configure --with-nagios-user=nagios --with-nagios-group=nagios
#make
#make install

Nagios Service Setup
The following commands will register the Nagios daemon to be run upon system startup.

chkconfig --add nagios
chkconfig --level 35 nagios on
chkconfig --add httpd
chkconfig --level 35 httpd on

Nagios Web Interface
After correctly following the procedures you should now
be able to access your Nagios Core installation from a
web browser.
Simply use the following:
http://<your.nagios.server.ip>/nagios
And log in with the credentials you chose when adding
the nagiosadmin user to the htpasswd.users file.
Finishing

Continue Reading

Recuperando a senha do Administrador do Windows Server 2008 / R2

Aplica-se: Windows Vista /  Windows 7 / Windows Server 2008 / Windows Server 2008 R2

Neste tutorial iremos abordar um assunto muito polemico referente a recuperação de senha do Windows, podemos realizar uma busca no Bing ou Google iremos achar vários tutorias e ferramentas para realização da tarefa, queremos demonstrar de forma clara e fácil como podemos resolver este problema.

A forma segura que não altere a estrutura do sistema operacional e suas funcionalidades, estamos falando em realizar esta ação sem precisar daquelas mídias com aqueles sistema com milhares de distribuições e alterações, neste caso iremos utilizar a mídia do próprio sistema operacional em nosso exemplo: Windows Server 2008 R2

Em nosso exemplo estamos utilizando o Hyper-V R2 utilizando uma VM com Windows Server 2008 R2 e conforme a mensagens abaixo não possuímos a senha do administrador : Nome de usuário ou senha incorreta.

1

Então iremos realizar o Boot com a mídia do sistema.

2

Primeiramente temos as opções de Idiomas e formato do teclado.

3

Iniciando modo de recuperação da senha, devemos entrar no modo de Recuperação do Sistema.

4

Iremos selecionar a opção ( Prompt de Comando ).

5

Com o Prompt de Cmando aberto, iremos mudar o diretório para “D:” e navegar até a pastaD:\Windows\Sustem32

Obs.: em nosso exemplo a letra D: é referência onde o Windows foi instalado, contudo na maiorias das vezes fica localizado em C:

6

Agora vamos renomear o utilitário conhecido como Utilman, através do seguinte comando: “renutilman.exe utilman.bak

Agora vamos renomear o utilitário conhecido como Utilman, através do seguinte comando: “renutilman.exe utilman.bak

7

Processo com a mídia de instalação concluída, devemos reiniciar o computador.

9

Neste momento não iremos utilizar a mídia de instalação, devemos iniciar o sistema normalmente.

Com o sistema iniciado, iremos utilizar um combinação de teclas “Windows + U”, neste momento a ferramenta do Windows será inciada, contudo será o Prompt de Comando que iremos possuir total acesso.

10

Neste momento iremos realizar a alteração da senha, iremos alterar a senha do usuário como Administrador.

Iremos utilizar o comando “net user [nome do usuário administrador do domínio] [nova senha], em nosso exemplo: “Net user administrador Pass@word”

11

Basta fechar o utilitario e entrar com a nova senha da conta administrador.

12

Neste tutorial demonstramos como utilizar a propria midia do sistema operacional para recuperar a senha do Windows Server 2008 R2, no entando para garantir a segurança do sistema e recomendado retornar o processo e voltar a habilitar a ferramenta de utilman.exe. Ele é o gerenciador de utilitários do Windows e serve para garantir a acessibilidade a pessoas com deficiências visuais, auditivas, que estejam com problemas no teclado, etc. Ele é um aplicativo do sistema, legítimo e não convém desabilitá-lo.

Obrigado pela leitura e até a próxima publicação.

Continue Reading