Sunday, April 29, 2007

Install Vmware on 64 bit CENTOS 4.4

Here are detailed instructions on how to successfully install vmware on a 64 bit server running CENT0S 4.4

The server:
OS: CentOS 5 x86_64
Hardware: AMD 64 Athlon 4400 DC/1024MB/160GB SATA

# uname -a
Linux xx.xx.xx.xx 2.6.9-42.0.10.ELsmp #1 SMP Tue Feb 27 09:40:21 EST 2007 x86_64 x86_64 x86_64 GNU/Linux

# arch -a
x86_64

#cat /etc/redhat-release
CentOS release 5 (Final) *

[Thanks to my hosting provider LayeredTech. They Rock!]

First, download and install the latest VMware Server. Since there are no x64 rpm files I used the x86. I hope it will efficiently using this CPU.

sh-3.00# rpm -ivh VMware-server-1.0.3-44356.i386.rpm

sh-3.00# vmware-config.pl
The correct version of one or more libraries needed to run VMware Server may be
missing. This is the output of ldd /usr/bin/vmware:
linux-gate.so.1 => (0xffffe000)
libm.so.6 => /lib/tls/libm.so.6 (0xf7fd0000)
libdl.so.2 => /lib/libdl.so.2 (0xf7fcc000)
libpthread.so.0 => /lib/tls/libpthread.so.0 (0xf7fba000)
libX11.so.6 => not found
libXtst.so.6 => not found
libXext.so.6 => not found
libXt.so.6 => not found
libICE.so.6 => not found
libSM.so.6 => not found
libXrender.so.1 => not found
libz.so.1 => not found
libc.so.6 => /lib/tls/libc.so.6 (0x001e6000)
/lib/ld-linux.so.2 (0x001cd000)

This program cannot tell for sure, but you may need to upgrade libc5 to glibc
before you can run VMware Server.

Hit enter to continue.


This is the first hint of trouble. Next after a few more prompts you will see an error message about a missing X library file.

/usr/lib/vmware/bin/vmware-vmx: error while loading shared libraries: libX11.so. 6: cannot open shared object file: No such file or directory
Please enter your 20-character serial number.

This is because vmware server is compiled against X libraries on the x86 architecture. To me this is an odd dependency because most servers do not run Xwindows. Personally, I never use Xwindows on servers, but to get past the vmware-config.pl installation you must install the xorg-x11-libs for x86 platform (even if you are on a x64).

Here is how it went:
rpm -ivh xorg-x11-libs-6.8.2-1.EL.13.37.7.i386.rpm
error: Failed dependencies:
libGL.so.1 is needed by xorg-x11-libs-6.8.2-1.EL.13.37.7.i386
libexpat.so.0 is needed by xorg-x11-libs-6.8.2-1.EL.13.37.7.i386
libfontconfig.so.1 is needed by xorg-x11-libs-6.8.2-1.EL.13.37.7.i386
libfreetype.so.6 is needed by xorg-x11-libs-6.8.2-1.EL.13.37.7.i386
libz.so.1 is needed by xorg-x11-libs-6.8.2-1.EL.13.37.7.i386

OK, so first I need to download the libraries that are needed.

wget ftp://ftp.nluug.nl/pub/os/Linux/distr/smeserver/releases/testing/7.2/smeos/i386/CentOS/RPMS/xorg-x11-libs-6.8.2-1.EL.13.37.7.i386.rpm
wget ftp://ftp.nluug.nl/pub/os/Linux/distr/smeserver/releases/7.1/smeos/i386/CentOS/RPMS/zlib-1.2.1.2-1.2.i386.rpm
wget ftp://ftp.nluug.nl/pub/metalab/distributions/smeserver/releases/7.1/smeos/i386/CentOS/RPMS/expat-1.95.7-4.i386.rpm
wget ftp://ftp.nluug.nl/pub/ibiblio/distributions/smeserver/releases/7.1/smeos/i386/CentOS/RPMS/fontconfig-2.2.3-7.centos4.i386.rpm
wget ftp://ftp.nluug.nl/pub/os/Linux/distr/CentOS/4.4/updates/i386/RPMS/freetype-devel-2.1.9-5.el4.i386.rpm
wget ftp://ftp.nluug.nl/pub/sunsite/distributions/smeserver/releases/testing/7.2/smeos/i386/CentOS/RPMS/xorg-x11-Mesa-libGL-6.8.2-1.EL.13.37.7.i386.rpm
wget ftp://ftp.nluug.nl/pub/os/Linux/distr/CentOS/4.4/updates/x86_64/RPMS/freetype-2.1.9-5.el4.i386.rpm


rpm -ivh xorg-x11-libs-6.8.2-1.EL.13.37.7.i386.rpm xorg-x11-Mesa-libGL-6.8.2-1.EL.13.37.7.i386.rpm expat-1.95.7-4.i386.rpm fontconfig-2.2.3-7.centos4.i386.rpm freetype-devel-2.1.9-5.el4.i386.rpm zlib-1.2.1.2-1.2.i386.rpm freetype-2.1.9-5.el4.i386.rpm
Preparing... ########################################### [100%]
1:zlib ########################################### [ 14%]
2:freetype ########################################### [ 29%]
3:expat ########################################### [ 43%]
4:fontconfig ########################################### [ 57%]
5:freetype-devel ########################################### [ 71%]
6:xorg-x11-Mesa-libGL ########################################### [ 86%]
7:xorg-x11-libs ########################################### [100%]

OK, so now I got xorg-x11 library installed I can retry the vmware-config.pl script.

Please enter your 20-character serial number.

Type XXXXX-XXXXX-XXXXX-XXXXX or 'Enter' to cancel:

Starting VMware services:
Virtual machine monitor [ OK ]
Virtual ethernet [ OK ]
Bridged networking on /dev/vmnet0 [ OK ]

The configuration of VMware Server 1.0.3 build-44356 for Linux for this running
kernel completed successfully.


Success!!

Thanks to Karanbir Singh for his blog post on installing vmware on CENTOS 4.4.
vmware_server_on_x86_64_centos4_redhat_e

Friday, April 20, 2007

Easiest possible way to port forward


Say you have a mysql server that you do not want to make public. Port 3306 is blocked by your firewall but port 22 is open for ssh.

Just connect tp your mysql server from putty on port 22 and modify one setting.
Connection->SSH->Tunnels add "L3306 127.0.0.1:3306"

After you make this change you can Click on Session and save your changes.

Once you connect through putty, you will be able to access the remote mysql server by localhost:3306.

Warning: Don't forget that this port is local now! If you forget that port 3306 is forwarded, you may wonder why you have a mysql server running on your machine.
If you decide later to install mysql on your local machine you should delete the port forward from the putty config to avoid unintentional changes your remote server.