Archive for category CentOSc

How to update Linux time zones

time zone map
On May 1st, Venezuela will change its time zone to UTC-4, therefore in Linux you must update your tzdata package to be ready to this change. To do so just just follow these steps:

Debian/Ubuntu

aptitude update
aptitude safe-upgrade tzdata

Red Hat

yum check-update
yum update tzdata

In order to check whether the update has the time zone changes you can run this command:

zdump -v /usr/share/zoneinfo/right/America/Caracas  | grep 2016

/usr/share/zoneinfo/right/America/Caracas  Sun May  1 06:59:59 2016 UT = Sun May  1 02:29:59 2016 VET isdst=0 gmtoff=-16200
/usr/share/zoneinfo/right/America/Caracas  Sun May  1 07:00:00 2016 UT = Sun May  1 03:00:00 2016 VET isdst=0 gmtoff=-14400

Reference: How to check if the Time Zone database


2 Comments

How to install VMWare Tools on Red Hat and CentOS

 

VMWare how to install VMWare tools on CentOS and Red Hat - running If you need to install VMWare Tools on virtual machines running Red Hat or CentOS as operating system, you can follow the procedure described next:

Procedure

First of in VMWare vSphere locate the virtual machine you want to install the VMWare Tools and click on “Install VMWare Tools” as shown in the next image: VMWare how to install VMWare tools on CentOS and Red Hat You will see a dialog window indicating that the VMWare Tools will be mounted by clicking on the “mount” button. Then in the virtual machine where you want to install the VMWare Tools you must do the following in the terminal:

# mount /dev/cdrom /mnt/
mount: block device /dev/sr0 is write-protected, mounting read-only

# cp /mnt/VMwareTools-9.0.0-782409.tar.gz /opt/

# cd /opt/
# tar xvzf VMwareTools-9.0.0-782409.tar.gz

# cd vmware-tools-distrib/

#./vmware-install.pl

The latter is a script which will ask you questions related to the VMWare Tools intallation. In genersl terms the default option are okay, but if you want to modify any parameter you can change any value according to your needs:

Creating a new VMware Tools installer database using the tar4 format.

Installing VMware Tools.

In which directory do you want to install the binary files?
[/usr/bin]

What is the directory that contains the init directories (rc0.d/ to rc6.d/)?
[/etc/rc.d]

What is the directory that contains the init scripts?
[/etc/rc.d/init.d]

In which directory do you want to install the daemon files?
[/usr/sbin]

In which directory do you want to install the library files?
[/usr/lib/vmware-tools]

The path "/usr/lib/vmware-tools" does not exist currently. This program is
going to create it, including needed parent directories. Is this what you want?
[yes]

In which directory do you want to install the documentation files?
[/usr/share/doc/vmware-tools]

The path "/usr/share/doc/vmware-tools" does not exist currently. This program
is going to create it, including needed parent directories. Is this what you
want? [yes]

The installation of VMware Tools 9.0.0 build-782409 for Linux completed
successfully. You can decide to remove this software from your system at any
time by invoking the following command: "/usr/bin/vmware-uninstall-tools.pl".

Before running VMware Tools for the first time, you need to configure it by
invoking the following command: "/usr/bin/vmware-config-tools.pl". Do you want
this program to invoke the command for you now? [yes]
Initializing...

Making sure services for VMware Tools are stopped.

The VMware FileSystem Sync Driver (vmsync) allows external third-party backup
software that is integrated with vSphere to create backups of the virtual
machine. Do you wish to enable this feature? [no]

Found a compatible pre-built module for vmci. Installing it...

Found a compatible pre-built module for vsock. Installing it...

The module vmxnet3 has already been installed on this system by another
installer or package and will not be modified by this installer. Use the flag
--clobber-kernel-modules=vmxnet3 to override.

The module pvscsi has already been installed on this system by another
installer or package and will not be modified by this installer. Use the flag
--clobber-kernel-modules=pvscsi to override.

The module vmmemctl has already been installed on this system by another
installer or package and will not be modified by this installer. Use the flag
--clobber-kernel-modules=vmmemctl to override.

The VMware Host-Guest Filesystem allows for shared folders between the host OS
and the guest OS in a Fusion or Workstation virtual environment. Do you wish
to enable this feature? [no]

Found a compatible pre-built module for vmxnet. Installing it...

The vmblock enables dragging or copying files between host and guest in a
Fusion or Workstation virtual environment. Do you wish to enable this feature?
[no]

!!! [EXPERIMENTAL] !!!
VMware automatic kernel modules enables automatic building and installation of
VMware kernel modules at boot that are not already present. By selecting yes,
you will be enabling this experimental feature. You can always disable this
feature by re-running vmware-config-tools.pl.

Would you like to enable VMware automatic kernel modules?
[no]

No X install found.

Creating a new initrd boot image for the kernel.
vmware-tools start/running
The configuration of VMware Tools 9.0.0 build-782409 for Linux for this running
kernel completed successfully.

You must restart your X session before any mouse or graphics changes take
effect.

You can now run VMware Tools by invoking "/usr/bin/vmware-toolbox-cmd" from the
command line.

To enable advanced X features (e.g., guest resolution fit, drag and drop, and
file and text copy/paste), you will need to do one (or more) of the following:
1. Manually start /usr/bin/vmware-user
2. Log out and log back into your desktop session; and,
3. Restart your X session.

Enjoy,

--the VMware team

Found VMware Tools CDROM mounted at /mnt. Ejecting device /dev/sr0 ...
No eject (or equivilant) command could be located.
Eject Failed: If possible manually eject the Tools installer from the guest
cdrom mounted at /mnt before canceling tools install on the host.

When the script had finished the VMWare Tools will be installed on the virtual machine. Now you can umount the ISO by doing:

# umount /mnt

Theb in VSphere you can check that VMWare Tools are running as shown in the first picture of this articl.

,

No Comments

Setting Linphone on Linux

Linphone

In the company I work there is a PBX with Asterisk and due to the limited amount of hardware phones available I decided to use a softphone, in this case Linphone. Next I explain the steps to install and set up Linphone with a SIP server:

Installing on Debian

On Debian you must install the following package:

aptitude install linphone

On spin-off distros like Ubuntu or Mint you must check the package’s name.

Installing on Red Hat

In the case you are using Red Hat then you must install Linphone this way:

yum install linphone

Again, on spin-off distros like Fedora or CentOS you must check the package’s name. You also must the repository where to find Linphone (keep in mind Red Hat is server oriented)

Setting

In order to set up Linphone you must launch the application and go to Options > Preferences > Manage SIP Accounts. A windows like the following should appear:

Settings

You must add an account in the Proxy accounts section, by clicking on the Add button , then the following window will show up:

SIP Account

Here you just specified the user account or SIP identity and the proxy SIP. For the identity follow the format user@domain. In the example 5256 is the user (extension) and y 10.0.3.10 is the SIP server. On the other hand, the proxy IP address is 10.0.3.10.

Once the changes have been made just click Ok on this window and Done on the previous one.

Usage

Now the application should authenticate to the server, asking the user and password as shown next:

SIP Authentication

After the account is provided, in My Current Identity on  the main window that information should be shown:

My current Identity

Making a call

To make a call just put the extension number in the shown box and push the green button:

Calling

4 Comments

Installing VirtualBox Guest Additions on CentOS

VirtualBox CentOS

If for any reason you need to install CentOS on a virtual machine using VirtualBox and you want to take advantage of the extras features provided by the Guest Additions (network and graphic drivers, for enabling full screen and mouse integration options) you can follow these steps::

  • In the virtual machine with CentOS install the needed files for compiling the Guest Additions:
yum install kernel-headers kernel-devel
yum groupinstall "Development Tools"

This will take long because it downloads a lot of packages.

  • Select Guest Additions on VirtualBox menu.

VirtualBox Guest Additions CentOS

On the virtual machine a link will be created to mount the CDROM. Right click on it and choose Mount. Once mounted go to:

cd /media/VBOXADDITIONS_4.1.20_80170/

There run the binary file for Linux installation:

./VBoxLinuxAdditions.run

Once it had finished the Guest Additions will be installed on Fedora!

Installing on Red Hat

The above steps are valid for Red Hat, you only need to set a repository from where packages and group of packages will be downloaded.

,

2 Comments

update-alternatives on CentOS

centOS 6

These days I had to update the java version on a server at work. They had jre-1.6.0-openjdk version wanted to use Oracle’s jdk1.6.0_33 version. What it seems odd to me was to find out update-alternatives on CenOS, because I knew it from Debian based distributions.  Reading the documentation on CentOS, it is a reimplementation of Debian’s update-alternatives, but aimed to Red Hat based distributions, thus for CentOS as well. So, let’s see how to update Java with update-alternatives on CentOS as example.

Using update-alternatives for Java

The first thing to do is to check the current java version:

# java -version
java version "1.6.0_17"
OpenJDK Runtime Environment (IcedTea6 1.7.4) (rhel-1.21.b17.el6-x86_64)
OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode)

Here you can see it points to OpenJDK’s 1.6.0_17  version. Now let’s add a path to the version to use:

# update-alternatives --install /usr/bin/java java /opt/jdk1.6.0_33/bin/java 1

Last line adds the /opt/jdk1.6.0_33/bin/java path to /usr/bin/java java  binary, in other words, it creates a symbolic link to use in case that options is chosen. Let’s set an alternative that points to the new path:

# update-alternatives --config java
There are 2 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
*+ 1           /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
   2           /opt/jdk1.6.0_33/bin/java

Enter to keep the current selection[+], or type selection number: 2

Let’s check the java version one more time:

# java -version
java version "1.6.0_33"
Java(TM) SE Runtime Environment (build 1.6.0_33-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03, mixed mode)

Now the binary points to the Oracle’s version. You can check it with the symbolic links:

# ls -l /usr/bin/java
lrwxrwxrwx. 1 root root 22 Jul 31 15:25 /usr/bin/java -> /etc/alternatives/java
# ls -l /etc/alternatives/java
lrwxrwxrwx. 1 root root 25 Jul 31 15:25 /etc/alternatives/java -> /opt/jdk1.6.0_33/bin/java

, ,

5 Comments