Friday, July 13, 2012

Configuration file was created by a VMware product with more features than this version

1.      Take backup copy of virtual machine.

2.      Locate file with extension .vmx and open it in a text editor:

Change from:

virtualHW.version = "8"

to

virtualHW.version = "7"

3.      Locate file with extension .vmdk and open it in a text editor:

Change from:

ddb.virtualHWVersion = "8"

to

ddb.virtualHWVersion = "7"

Now you can successfully boot the Virtual Machine.

Device eth0 has different MAC address than expected

1.                  Check virtual machine MAC address and change accordingly in Linux box

Or,

2.         Edit /etc/sysconfig/network-script/ifcfg-eth0 in Linux box

3.         Remove all except DEVICE, ONBOOT, BOOTPROTO parametes.

4.         Change BOOTPROTO=dhcp:

            # cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes

5.         Restart network service

6.         Check MAC address by “ifconfig” command:

            # ifconfig eth0 | grep HWaddr
eth0      Link encap:Ethernet  HWaddr 00:0C:29:48:DB:9A

7.         Add HWADDR, IPADDR, NETMASK, GATEWAY in “ifcfg-eth0”  file:

# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
HWADDR=00:0C:29:48:DB:9A
IPADDR=192.168.100.231
NETMASK=255.255.254.0
GATEWAY=192.168.100.1

8.         Restart network service

RHEL 6.x VMware Workstation 7.1 installation issue


1.      Check for  dmesg output:


vmmon: disagrees about version of symbol smp_ops

vmmon: Unknown symbol smp_ops


2.      Check vmware status


# /etc/init.d/vmware status

Module vmmon not loaded

Module vmnet loaded


3.      Restart vmware service

# /etc/init.d/vmware stop

Stopping VMware services:

   VMware USB Arbitrator                                   [  OK  ]

   VM communication interface socket family                [  OK  ]

   Virtual machine communication interface                 [  OK  ]

   Virtual machine monitor                                 [  OK  ]

   Blocking file system                                    [  OK  ]


# /etc/init.d/vmware start

Starting VMware services:

   VMware USB Arbitrator                                   [  OK  ]

   Virtual machine monitor                                 [FAILED]

   Virtual machine communication interface                 [  OK  ]

   VM communication interface socket family                [  OK  ]

   Blocking file system                                    [  OK  ]

   Virtual ethernet                                        [  OK  ]


4.      Check for basic prerequisites

gcc

gcc-c++

kernel-headers

kernel-devel


5.      Create temporary folder and move files as below:


# mkdir ~/temp

# mv /usr/lib/vmware/modules/binary/bld-2.6.32-* ~/temp/

6.      Finaly run below command:


# vmware-modconfig --console --install-all

7.      Check vmware status


# service vmware status

Module vmmon loaded

Module vmnet loaded


8.      Check for  lsmod output:

# lsmod | grep vm

vmnet                  39825  13

vmblock                10290  1

vmci                   52074  1 vsock

vmmon                  68307  0


9.      Restart vmware service

# service vmware restart

Stopping VMware services:

   VMware USB Arbitrator                                   [  OK  ]

   VM communication interface socket family                [  OK  ]

   Virtual machine communication interface                 [  OK  ]

   Virtual machine monitor                                 [  OK  ]

   Blocking file system                                    [  OK  ]

Starting VMware services:

   VMware USB Arbitrator                                   [  OK  ]

   Virtual machine monitor                                 [  OK  ]

   Virtual machine communication interface                 [  OK  ]

   VM communication interface socket family                [  OK  ]

   Blocking file system                                    [  OK  ]

   Virtual ethernet                                        [  OK  ]

   Shared Memory Available                                 [  OK  ]

How to install WMware on Linux machine?

1.      Download WMware software.


2.      Change executable permission.

# chmod u+x VMware-Workstation-xxxx-x.x.x-xxxxx.bundle


3.      Run as normal script file.

# ./VMware-Workstation-xxxx-x.x.x-xxxxx.bundle


Graphical VMware installation will start, just follow the steps.

Thursday, July 12, 2012

To clear cache in RedHat /CentOS (Linux)

You can directly clear caches (pagecache, dentries and inodes) by /proc:
To free pagecache:
# sync && echo 1 > /proc/sys/vm/drop_caches
To free dentries and inodes:
# sync && echo 2 > /proc/sys/vm/drop_caches
To free pagecache, dentries and inodes:
# sync && echo 3 > /proc/sys/vm/drop_caches

The “sync” command at the beginning will let us be sure that all cached objects are freed.
It is recommended that sync be run prior to passing the values to /proc/sys/vm/drop_caches.
Enabling drop_caches can cause deadlock if the system is under heavy memory and I/O load.
It is not recommended to use this feature on system experiencing heavy load.



To reduce inode/dentry time in the cache: /proc/sys/vm/vfs_cache_pressure

Controls the tendency of the kernel to reclaim the memory which is used for caching of directory and inode objects.

At the default value of vfs_cache_pressure=100 the kernel will attempt to reclaim dentries and inodes at a "fair" rate with respect to pagecache and swapcache reclaim.  Decreasing vfs_cache_pressure causes the kernel to prefer to retain dentry and inode caches. When vfs_cache_pressure=0, the kernel will never reclaim dentries and inodes due to memory pressure and this can easily lead to out-of-memory conditions.

Increasing vfs_cache_pressure beyond 100 causes the kernel to prefer to reclaim dentries and inodes.

You can change value of vfs_cache_pressure by making entry into sysctl.conf file.

# sysctl –a | grep vfs_cache_pressure
vfs_cache_pressure beyond = 1000

Configuring sendmail to relay mail through Gmail SMTP

1.                  Create User Account on Gmail.com.

2.                  Check network setting for lookup/telnet of smtp.gmail.com.

3.                  Create local user for sending mail through Gmail account to other mail account.

4.                  Edit /etc/mail/sendmail.mc file and add below parameters.

define(`SMART_HOST', `smtp.gmail.com')dnl
define(`RELAY_MAILER_ARGS', `TCP $h 587')dnl
define(`ESMTP_MAILER_ARGS', `TCP $h 587')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
FEATURE(`authinfo', `hash /etc/mail/auth/client-info')dnl
TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl

5.                  Create “auth” folder.

# mkdir /etc/mail/auth

6.                  Create “client-info” file and add below paramters.

# vi /etc/mail/auth/client-info
AuthInfo:smtp.gmail.com "U:gmail_test_user" "I:gmail_test_user@gmail.com" "P:gmail_test_user_password"

7.                  Change folder location and create database.

# cd  /etc/mail/auth/
# makemap hash client-info < client-info

8.                  Change permission of file and folder.

# chmod 700 /etc/mail/auth
# chmod 600 /etc/mail/auth/*

9.                  Compile configuration & restart service.

# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
# service sendmail restart

10.              Finally, send a test mail.

# echo 'this is a test mail'| mail -s welcome_to_testmail second_test_user@hotmail.com

11.              Check log message.

# tail -f /var/log/maillog
# tail –f /var/log/messages