Monday, January 23, 2012

Installing VM Tools in OEL

I recently setup an Oracle Enterprise Linux 5 virtual machine in a VMware.  Unfortunately, the VMware tools wouldn't install cleanly.  While researching this issue, I found that some people encountered the issue with  both OEL5 and OEL6.  However, I haven't tested it with OEL6 yet.

Below is what I had to do to resolve the issue.

1. Install the latest update of Oracle Enterprise Linux 5.
2. Download and enable Oracle's public yum service.
      wget -qO - http://public-yum.oracle.com/public-yum-el5.repo|sed \
       -e "s/enabled=0/enabled=1/g" > /etc/yum.repos.d/public-yum-el5.repo

3. Install the requisite packages to compile the VMware tools
      yum install -y kernel-uek-headers-`uname -r` gcc kernel-uek-devel
4. Extract the VMWare tools
      tar --gunzip -xf /media/VMware\ Tools/VMwareTools-*.tar.gz
5. Attempt to compile the VMware tools
      cd vmware-tools-distrib/bin
      ./vmware-install.pl
           Agree to all of the default settings except the display settings.  
           For that, I selected the number that corresponds to 1024x768.  
           This was just my preference.

If you happen to get an error similar to "No module ehci-hcd found for kernel", then you will need to append the $content variable to build the had modules by editing the bin/vmware-config-tools.pl and add the red line in the following excerpt.
    foreach my $key (@gRamdiskModules) {
      if ($style eq 'redhat') {
        $content .= " --with=" . get_module_name($key) . "  ";
        $content .= " --builtin=ehci-hcd --builtin=ohci-hcd \
           --builtin=uhci-hcd ";
      } else {
        $content .=  get_module_name($key) . ' ';
      }
    }

Once that fix is applied, re-run ./vmware-install.pl and then restart the VM to enable copy/paste.

Saturday, January 7, 2012

Family & Friends Backup Plan

Hello,

This is a reminder to all of my friends and family to stop what you are doing and backup your computer NOW!  Seriously!  Go! NOW!!!!

O.K., I'm done with that soap box.

I have done several full Microsoft Windows PC/Laptop recoveries over the past few weeks.  So far I have been able to backup everyone's data, reinstall Windows, Scan and Smash the Viri/Malware and safely restore the data to the repaired system.  However, there was one close call that I wasn't sure recovery would be possible because of a failing disk drive.  Fortunately it worked out for the data that mattered most... family pictures, iTunes data, and misc docs.  In each of these cases, NONE had a current full backup of their data.

Nearly all of these recoveries were necessitated as the result of one wrong click of an infected e-mail, text message, or browser link that unleashed some terrible virus or malware.  Normally at this point I would gently bash Microsoft Windows for its ease with which it is infected with all sorts of malware but I will not digress this time.  Instead I will return to the topic of this post, ... backups.

If you don't have a current backup of all your important data or don't know how to backup your data, this blog is for you.  I am going to share with you a simple 10 step program to backup your data and ensure that it stays backed up.

Step 1. Determine the sum of all data from all computers that need to be backed up.  Lets say you have a MacBook Pro with 200GB of data and a Windows Desktop PC with 400GB of data.  The total data for these two computers is 600GB.  The following steps can help you determine how much storage a given computer is using.

  • For a Microsoft Windows computer, right click on the start button, click on Explorer, then left click on each hard drive (C:, E:, ...) and click on properties.  This should show the size of the disk drive and how much is use by data.
  • For a Mac, click on Finder, then left click (or Ctrl-Click) and select Get Info on each of the disk drives starting with Macintosh HD.  Sum the Capacities of all the disk drives to back up.

Step 2.  Buy an external hard disk drive or storage array that is large enough to hold two or three times the capacity determined from Step 1 above.  There are several 1TB, 2TB, and even 3TB disk drives available for under $200.  I usually get the best deals on storage either through NewEgg.com or some really good deal at Fry's.  The advantage of NewEgg.com is that they usually offer a really good price plus free shipping and no tax.
Step 3. Attach the storage to a desktop computer that you can leave on all the time for network backups.  If you don't have a computer for this purpose, go buy an inexpensive desktop from Dell, Best Buy, Fry's, ... etc.  You should be able to find a sufficient desktop system for under $500.  The primary purpose of this system is to provide a safe destination for your computer backups.
Step 4. Download and Install the appropriate version of CrashPlan from CrashPlan.com for your desktop computer that has the storage attached to it.  CrashPlan is FREE when you are backing up to your own local storage or local computers.
Step 5. Sign up for a CrashPlan account making note of the e-mail address and password used for the CrashPlan account.
Step 6. Select what to backup with the following steps

  1. Click on "Backup" from the left hand menu
  2. Click on "Change..." under Files to select what is to be backed up.
  3. By default, CrashPlan selects the home directory of the user installing CrashPlan.  If there are other users on that computer, you will want to check their home directories as well.  Be sure to browse around and select all drives that may contain important data.  When in doubt, back it all up.
  4. Click on Save to save your backup selections.

Step 7. Make sure that the attached storage is formatted and rename the drive to "CPBackups".
Step 8. Setup CrashPlan to use the attached storage with the following steps.

  1. Start the CrashPlan app
  2. Click on Destinations
  3. Click on Folders
  4. Click on "Select..." 
  5. Select the "CPBackups" drive
  6. Click on "Start Backup" 

Step 9. Now its time to install the rest of the computers and configure them to backup their data over the network to the desktop computer with the external storage attached.  Do the following steps on each computer.

  1. Download CrashPlan, install it, and login with your credentials from Step 5.
  2. Click on Destinations
  3. Click on Computers
  4. Select the desktop computer that is running CrashPlan
  5. Click on "Start Backup"

Step 10. Periodically check the health of your desktop computer to ensure that the external storage has not started giving any errors.

Lastly, consider switching to an Apple computer the next time that you are ready to make a computer purchasing decision.  I don't want to belabor this point but about 6 months after you've made the switch you will wonder why you hadn't made the switch much sooner.  I'm not saying that Apple's aren't any less susceptible to viri or vulnerabilities.  Their track record though has been 10,000 times better than Microsoft Windows.  Of all the computers that I have recoverd from malware infection over the past 10 years, NONE of them have been Apple computers.

Blessings to you and yours!


Brad
If this information has helped you, please consider helping me through investing in your health and in the health of those you love through purchasing Mannatech wellness products. Ambrotose is the key ingredient of all Mannatech Wellness products.  Place your order at my Mannatech Web Store today.

Friday, January 6, 2012

Simple VNC control with vncctl

Hello,

This week I had the opportunity to add Virtual Network Computing (VNC) support to some of my lab servers.  The VNC server bits were already installed by default but I wanted to simplify how to enable non-privileged users to setup and tear down their own VNC sessions.

Before going into my solution, I should explain that I try to ensure that my servers are as secure as possible.    VNC doesn't offer native encryption support and therefore is not natively that secure.  Any information transmitted over the network related to the VNC session could be snooped off the network.  The best way to add encryption to a VNC session is to tunnel the VNC session through an encrypted secure shell (ssh) connection.  I lock down my firewall to only allow ssh connections so that VNC is forced through ssh.  Further, just in case the firewall was compromised I don't want VNC to listen on any IP address other than localhost (127.0.0.1).  This is actually pretty standard stuff.  The interesting part comes in what I wrote to simplify setup and tear down of the VNC sessions.

I wrote a script called vncctl to start, stop, or restart VNC sessions.  When you run "vncctl start" to start a new VNC session, it finds the next available VNC port on the server and uses that port.  It also provides sample ssh commands that you can use from your client to connect to the VNC session via tunneling X11 or by tunneling the VNC port to your client.  You can even run it multiple times to start up multiple VNC sessions.  Lastly, if you run "vncctl stop", it will stop all of your existing VNC sessions.  Way Cool!

Lets look at some sample outputs.  Here is the output from running "vncctl start".

$ vncctl start
New 'lab01:3 (brad)' desktop is lab01:3
Starting applications specified in /home/brad/.vnc/xstartup
Log file is /home/brad/.vnc/lab01:3.log
You have two options for connecting to this VNC server: through port tunneling (fast) or over X11 (slow).
If you prefer through port tunneling over ssh, use the following command:
   ssh -L 5903:127.0.0.1:5903 brad@lab01
Then connect to 127.0.0.1:5903 via your local VNC client application
If you prefer over X11, use the following command from your server:
   ssh -X brad@lab01 vncviewer 127.0.0.1:5903
Note that you may need to add -p to specify a non-standard ssh port number

Here is the sample output when running "vncctl stop".

$ vncctl stop
Killing Xvnc process ID 9507

You can download vncctl from dl.thezonemanager.com.

From an operating system support perspective, I wrote this for Oracle Enterprise Linux version 6 and have not tested it on any other operating system.  Therefore, it should also work on RedHat Enterprise Linux version 6 as well. If you have difficulties running it on some other operating system and figure out how to fix it, send the fix to me and I will gladly incorporate it.

Enjoy and have a great day!


Brad
PS: As always, the sample scripts provided in this post are for reference are not supported by me or my employer in any way.

If this information has helped you, please consider helping me through investing in your health and in the health of those you love through purchasing Mannatech wellness products. Ambrotose is the key ingredient of all Mannatech Wellness products.  Place your order at my Mannatech Web Store today.

Tuesday, January 3, 2012

RIP SLAMD - You will be missed

One casualty of 2011 was the death of the SLAMD open source project.  This was a project initiated by and written almost entirely by Neil Wilson.  It was a significant contribution to the directory services community and will be greatly missed.

For those that don't know what I'm talking about, SLAMD was a distributed load generation engine used for stress testing and doing performance analysis on various network-based services such as Directory Services (a.k.a. LDAP).

The open source project began in 2003 while Neil was working at Sun Microsystems, Inc.  Neil wrote SLAMD for the purpose of doing performance analysis of Sun's directory services products.  Neil continued his work on SLAMD through through the years even while at UnboundID until around March, 2010.  However, Neil's interest in this project has waned and the project eventually ceased in 2011.  I'm not exactly sure when slamd.com went off line but the last date captured by archive.org was August 19, 2010.

I asked Neil if I could host the most recent release of the SLAMD bits and he graciously agreed.  Further
as Neil usually does, he went above and beyond and also setup a page on his company's web site as well.
Here is Neil's SLAMD page:
     http://files.unboundid.com/slamd/
And here is my mirror page so that page so that the bits will remain available for some time to come.
    http://dl.thezonemanager.com/slamd/

For those of you that still want or need to benchmark directory services, the OpenDS SDK offers a set of command line tools that can be used to generate load and capture result sets from the command line.  The bits are available at the following web page link.

     https://www.opends.org/wiki/page/LDAPSDK


I will write another blog post that walks you through the basics of how to use the OpenDS LDAP SDK to do basic performance analysis.

SLAMD, you will be missed!  Neil, thanks for SLAMD!  You made a real dent in the world of directory services through that project.

Brad
PS: As always, the sample scripts provided in this post are for reference are not supported by me or my employer in any way.

If this information has helped you, please consider helping me through investing in your health and in the health of those you love through purchasing Mannatech wellness products. Ambrotose is the key ingredient of all Mannatech Wellness products.  Place your order at my Mannatech Web Store today.

Thursday, December 1, 2011

Use cntcores to count CPUs and processor cores

In one of my previous posts on how to determine the number CPUs in a server, I listed several methods by Operating System (OS) type that can be used to determine the number of processors (or CPUs) and cores in a server.

Since then I have continued to get requests for assistance on determining the number of cores that a server has.  In order to simplify my life, I wrote a script called cntcores that will succinctly tell you the number of processors, cores, threads the OS, OS version, and processor type.  Below are a few sample outputs.

Oracle SPARC T4-2 running Solaris
CPUs  Cores Threads Operating System ProcType
2     16    128     SunOS 5.11       ORCL,SPARC-T4-2 2848 MHz


Oracle X4800-M2 running Solaris
CPUs  Cores Threads Operating System ProcType
8     160   160     SunOS 5.10       i86pc 2400 MHz



Sun X4150 running Oralce Enterprise Linux
CPUs  Cores Threads Operating System                ProcType
2     8     8       Oracle Linux Server release 6.1 Xeon(R) CPU E5345  @ 2.33GHz

Dell E250 running Ubuntu
CPUs  Cores Threads Operating System ProcType
1     2     2       Ubuntu 10.10     Athlon(tm) 64 X2 Dual Core Processor 4200+

Apple MacBook Pro running OSX Lion
CPUs  Cores Threads Operating System ProcType
1     4     8       Darwin 11.2.0    Intel Core i7 

The usage of the command is very straight forward.  Just run the script. ;-)  Below is the actual usage.

$ cntcores [-h] [-v] [-l]
   -h  Show Usage
   -v  Show Version
   -l  Show License
   -q  Don't show disclaimer

The script works for several Linux distributions, Solaris, OSX, HP-UX and AIX.

Unfortunately, I don't have any HP-UX or IBM AIX servers to test the script on.  If you run it on an HP-UX or IBM AIX server, be sure to share the results.

Note that although the cntcores script could be very useful for determining core counts for licensing purposes, it should not be relied upon exclusively for that purpose.  It may not always accurately represent the actual number of cores in a given server.  Therefore, ALWAYS verify all server core counts by at least two methods to assure an accurate accounting.

Thanks in advance and Enjoy!

Brad
PS: As always, the sample scripts provided in this post are for reference are not supported by me or my employer in any way.

If this information has helped you, please consider helping me through investing in your health and in the health of those you love through purchasing Mannatech wellness products. Ambrotose is the key ingredient of all Mannatech Wellness products.  Place your order at my Mannatech Web Store today.

Wednesday, August 24, 2011

HowTo: Setup VirtualBox 4.1 Server on OEL6

Back in 2010, I wrote about how to setup an Oracle Enterprise Linux (v5.x) server for hosting VirtualBox virtual machines.  This post looks at the same goal but for Oracle Enterprise Linux 6 update 1 (OEL 6u1) with VirtualBox 4.1.  There are only a few subtle changes that reflect simplifications from the previous methods as well as updating for particulars for OEL 6u1 and VirtualBox 4.1.

1. Download Oracle Enterprise Linux 6u1 (OEL 6u1) ISO image from E-Delivery and burn it to a DVD.
2. Install OEL using the desktop template and configure for your network.
3. Subscribe to public-yum.oracle.com by running the following:
     wget -qO - http://public-yum.oracle.com/public-yum-ol6.repo \
       | sed -e "s/enabled=0/enabled=1/g" > public-yum-ol6.repo
4. Determine the kind of kernel that you have in order to know which kernel code and headers to download by running uname -r.  In my case, the resulting kernel is 2.6.32-100.34.1.el6uek.x86_64.
5. Install the pre-requisite software for compiling the VirtualBox drivers: SDL, gcc and the correct kernel source and headers.  In my case, the following works.
     yum install -y SDL gcc kernel-uek-headers kernel-uek-devel
6. Download VirtualBox install image for OEL 6 and the VirtualBox Extension Pack from VirtualBox.org.
7. Install the downloaded VirtualBox image with the following.
     rpm -i VirtualBox*.rpm
8. Install the VirtualBox Extension Pack with the following.
     VBoxManage extpack install *extpack
9. [Optional] Remove gcc and requisite packages with the following.
     yum remove -y SDL gcc kernel-uek-headers kernel-uek-devel
10. [Optional] Disable SELinux by setting SELINUX=disabled in /etc/selinux/config.
11. [Optional] Disable the un-necessary services.
     chkconfig --level 0123456 abrtd off
     chkconfig --level 0123456 avahi-daemon off
     chkconfig --level 0123456 bluetooth off
     chkconfig --level 0123456 cups off
     chkconfig --level 0123456 nfslock off
     chkconfig --level 0123456 rhnsd off
     chkconfig --level 0123456 rpcgssd off
     chkconfig --level 0123456 rpcidmapd off
     chkconfig --level 0123456 postfix off
     chkconfig --level 0123456 xfs off
12. [Optional] Install VNC server and client for remote desktop management.
      yum -y install tigervnc-server tigervnc
      useradd user1; useradd user2; useradd user3
      Set passwords for user1, user2, and user3 with passwd.
      Setup VNC desktops for user1, user2, and user3 on the OEL server.
      echo >> /etc/sysconfig/vncservers <
VNCSERVERS="1:user1 2:user2 3:user3"
VNCSERVERARGS[1]="-geometry 1024x768"
VNCSERVERARGS[2]="-geometry 1024x768"
VNCSERVERARGS[3]="-geometry 1024x768"
EOF
      chkconfig --level 23456 vncserver on
14. Reboot with "init 6"

At this point the server is ready host VirtualBox virtual machines.  You can use the graphical display (e.g. VirtualBox) or the command line interface to add and manage your VirtualBox virtual machines.

With VNC setup, you can securely connect to the VNC desktops via ssh.  For example, you can connect via ssh and send the vncviewer back to your X11 display.
     ssh -X username@remoteserver /usr/bin/vncviewer 127.0.0.1:5901

Or you can just forward the VNC port back to your desktop with ssh / putty and use a local VNC client to connect to the desktop.
     ssh -L 5901:127.0.0.1:5901 username@remoteserver
     vncviewer 127.0.0.1:5901

Enjoy!

Brad
If this information has helped you, please consider helping me through investing in your health and in the health of those you love through purchasing Mannatech wellness products. Ambrotose is the key ingredient of all Mannatech Wellness products.  Place your order at my Mannatech Web Store today.

PS: As always, the sample scripts provided are for reference and are not supported in any way.

Tuesday, August 23, 2011

Pavlov's passwords

Perhaps you have heard of Pavlov's Dog.  If Pavlov were alive today, what sorts of conditioning might he apply to help humans memorize their passwords?  This video may shed some light on the subject.

Thank goodness there are better ways for managing passwords. ;-)

Have a great day!

Brad