You are on page 1of 14

Installing VMWARE server on CentOS 5 or

Red hat enterprise Linux


by Vivek Gite · 26 comments

VMware virtualization software is an excllent choice for x86-compatible computers. They have
both commercial and free version. I received few email regarding Installing VMWARE server on
CentOS 5 or Red hat enterprise Linux 64 bit version is a tricky business. In this small howto I
will explain vmware installation on 64 bit Linux server without facing any dependencies
problem.

Following instructions are tested on both RHEL 5 and CentOS 5 running 64 bit Intel / AMD
hardware and software. My kernel:
$ uname -mrs
Output:

Linux 2.6.18-8.1.6.el5 x86_64

My RHEL 5 release (same kernel for CentOS):


$ cat /etc/redhat-release
Output:

Red Hat Enterprise Linux Server release 5 (Tikanga)

Make sure you have following software installed:

 Full gcc compiler and development environment


 Kernel headers and devel packages for current kernel (i.e. kernel-headers and kernel-
devel)

Step # 1: Download vmware server

You can download VMWARE server here. Use wget command to download:
$ wget http://download3...

Step # 2: Install vmware server


Once downloaded use RPM command to install vmware sever, enter:
# rpm -ivh VMware-server-1.0.3-44356.i386.rpm
Output:

Preparing... ########################################### [100%]


1:VMware-server ########################################### [100%]

Step # 3:Install required files / libraries

You need to install following development package / files on server:

1. libXtst-devel : X.Org X11 libXtst development package


2. libXrender-devel : X.Org X11 libXrender development package

Simply use yum command to install packages:


# yum install libXtst-devel libXrender-devel kernel-devel
Output:

Loading "rhnplugin" plugin


Loading "installonlyn" plugin
Setting up Install Process
Setting up repositories
rhel-x86_64-server-vt-5 100% |=========================| 1.2 kB 00:00
rhel-x86_64-server-5 100% |=========================| 1.2 kB 00:00
Reading repository metadata in from local files
Parsing package install arguments
...........
....
...
Running Transaction
Installing: libXtst ######################### [1/8]
Installing: libXau-devel ######################### [2/8]
Installing: xorg-x11-proto-devel ######################### [3/8]
Installing: libX11-devel ######################### [4/8]
Installing: libXdmcp-devel ######################### [5/8]
Installing: libXtst-devel ######################### [6/8]
Installing: libXtst-devel ######################### [7/8]
Installing: mesa-libGL-devel ######################### [8/8]

Installed: libXtst-devel.x86_64 0:1.0.1-3.1 libXtst-devel.i386 0:1.0.1-3.1


Dependency Installed: libX11-devel.x86_64 0:1.0.3-8.0.1.el5 libXau-
devel.x86_64 0:1.0.1-3.1 libXdmcp-devel.x86_64 0:1.0.1-2.1 libXtst.i386
0:1.0.1-3.1 mesa-libGL-devel.x86_64 0:6.5.1-7.2.el5 xorg-x11-proto-
devel.x86_64 0:7.1-9.fc6
Complete!

Step # 4: Install xinetd

You need xinetd the extended Internet services daemon / service in order to use VMWARE
console from remote computer. Use yum command to install xinetd:
# yum install xinetd
Step # 5: Configure VMWARE server

Use vmware-config.pl script to configure VMWARE networking and other aspects.


# vmware-config.pl
Output (make sure you setup VMWARE as per your requirments, following is just a sample
output):

Making sure services for VMware Server are stopped.

Stopping VMware services:


Virtual machine monitor [ OK ]

You must read and accept the End User License Agreement to continue.
Press enter to display it.
......
......
will provide you with a copy of our
distribution agreement for your signature.

Do you accept? (yes/no) yes

Thank you.

Configuring fallback GTK+ 2.4 libraries.

In which directory do you want to install the mime type icons?


[/usr/share/icons]

What directory contains your desktop menu entry files? These files have a
.desktop file extension. [/usr/share/applications]
In which directory do you want to install the application's icon?
[/usr/share/pixmaps]

Trying to find a suitable vmmon module for your running kernel.

None of the pre-built vmmon modules for VMware Server is suitable for your
running kernel. Do you want this program to try to build the vmmon module for
your system (you need to have a C compiler installed on your system)? [yes]

Using compiler "/usr/bin/gcc". Use environment variable CC to override.

What is the location of the directory of C header files that match your
running
kernel? [/lib/modules/2.6.18-8.1.6.el5/build/include]

Extracting the sources of the vmmon module.

Building the vmmon module.

Using 2.6.x kernel build system.


make: Entering directory `/tmp/vmware-config0/vmmon-only'
make -C /lib/modules/2.6.18-8.1.6.el5/build/include/.. SUBDIRS=$PWD
SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/kernels/2.6.18-8.1.6.el5-x86_64'
CC [M] /tmp/vmware-config0/vmmon-only/linux/driver.o
CC [M] /tmp/vmware-config0/vmmon-only/linux/hostif.o
CC [M] /tmp/vmware-config0/vmmon-only/common/cpuid.o
CC [M] /tmp/vmware-config0/vmmon-only/common/hash.o
CC [M] /tmp/vmware-config0/vmmon-only/common/memtrack.o
CC [M] /tmp/vmware-config0/vmmon-only/common/phystrack.o
CC [M] /tmp/vmware-config0/vmmon-only/common/task.o
CC [M] /tmp/vmware-config0/vmmon-only/common/vmx86.o
CC [M] /tmp/vmware-config0/vmmon-only/vmcore/moduleloop.o
LD [M] /tmp/vmware-config0/vmmon-only/vmmon.o
Building modules, stage 2.
MODPOST
CC /tmp/vmware-config0/vmmon-only/vmmon.mod.o
LD [M] /tmp/vmware-config0/vmmon-only/vmmon.ko
make[1]: Leaving directory `/usr/src/kernels/2.6.18-8.1.6.el5-x86_64'
cp -f vmmon.ko ./../vmmon.o
make: Leaving directory `/tmp/vmware-config0/vmmon-only'
The module loads perfectly in the running kernel.

Do you want networking for your virtual machines? (yes/no/help) [yes]

Configuring a bridged network for vmnet0.

Your computer has multiple ethernet network interfaces available: eth0, eth1.
Which one do you want to bridge to vmnet0? [eth0] eth1

The following bridged networks have been defined:

. vmnet0 is bridged to eth1

Do you wish to configure another bridged network? (yes/no) [no]

Do you want to be able to use NAT networking in your virtual machines?


(yes/no)
[yes] no

Do you want to be able to use host-only networking in your virtual machines?


[no]

Extracting the sources of the vmnet module.

Building the vmnet module.

Using 2.6.x kernel build system.


make: Entering directory `/tmp/vmware-config0/vmnet-only'
make -C /lib/modules/2.6.18-8.1.6.el5/build/include/.. SUBDIRS=$PWD
SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/kernels/2.6.18-8.1.6.el5-x86_64'
CC [M] /tmp/vmware-config0/vmnet-only/driver.o
CC [M] /tmp/vmware-config0/vmnet-only/hub.o
CC [M] /tmp/vmware-config0/vmnet-only/userif.o
CC [M] /tmp/vmware-config0/vmnet-only/netif.o
CC [M] /tmp/vmware-config0/vmnet-only/bridge.o
CC [M] /tmp/vmware-config0/vmnet-only/procfs.o
CC [M] /tmp/vmware-config0/vmnet-only/smac_compat.o
SHIPPED /tmp/vmware-config0/vmnet-only/smac_linux.x86_64.o
LD [M] /tmp/vmware-config0/vmnet-only/vmnet.o
Building modules, stage 2.
MODPOST
WARNING: could not find /tmp/vmware-config0/vmnet-
only/.smac_linux.x86_64.o.cmd for /tmp/vmware-config0/vmnet-
only/smac_linux.x86_64.o
CC /tmp/vmware-config0/vmnet-only/vmnet.mod.o
LD [M] /tmp/vmware-config0/vmnet-only/vmnet.ko
make[1]: Leaving directory `/usr/src/kernels/2.6.18-8.1.6.el5-x86_64'
cp -f vmnet.ko ./../vmnet.o
make: Leaving directory `/tmp/vmware-config0/vmnet-only'
The module loads perfectly in the running kernel.

The default port : 902 is not free. We have selected a suitable alternative
port for VMware Server use. You may override this value now.
Remember to use this port when connecting to this server.
Please specify a port for remote console connections to use [904]

WARNING: VMware Server has been configured to run on a port different from the
default port. Remember to use this port when connecting to this server.
Stopping xinetd: [ OK ]
Starting xinetd: [ OK ]
Configuring the VMware VmPerl Scripting API.

Building the VMware VmPerl Scripting API.

Using compiler "/usr/bin/gcc". Use environment variable CC to override.

Installing the VMware VmPerl Scripting API.

The installation of the VMware VmPerl Scripting API succeeded.

Generating SSL Server Certificate

In which directory do you want to keep your virtual machine files?


[/var/lib/vmware/Virtual Machines]

The path "/var/lib/vmware/Virtual Machines" does not exist currently. This


program is going to create it, including needed parent directories. Is this
what you want? [yes]

Please enter your 20-character serial number.

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

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.

How do I manage my VMWARE server remotely?

You can now connect from local computer using vmware-server-console program to:
 Configure VM Guest oses
 Configure VM hardware
 Install new VPS / VM guest oses such as FreeBSD, Windows or any other operating
systems etc

$ vmware-server-console &
You need to enter host name ip:port, username and password to access vmware server.

Connect VMWARE Server using Webbased


Management Interface at 8333 port
by Vivek Gite · 10 comments
The VMware Server Web-based management interface is installed on your VMware Server
system to enable control from a Web browser.

You can download this package from VMWare site itself and install the same. Activities you can
perform includes:
=> Connecting to a Virtual Machine with the VMware Server Console

=> Using the Virtual Machine Menu

=> Changing the Power State of a Virtual Machine

=> Monitoring the Virtual Machine's Heartbeat

=> Viewing Information about Virtual Machines

=> Downloading VMware Server Console Installers (Login and Status Monitor pages only)

=> Configuring the VMware Server System (Options page only)

=> Using Common Controls

=> Start and shutdown virtual servers etc

Download web interface for vmware server


# wget http://download3.vmware.com/software/vmserver/VMware-mui-1.0.3-
44356.tar.gz

Unpack tar ball

Use tar command to install a tar ball:


# tar -zxvf VMware-mui-1.0.3-44356.tar.gz

Install Management Interface


# cd vmware-mui-distrib
# ./vmware-install.pl
Just follow on screen installation instructions. Installer should start the server and default port is
8333. You need to open the same using iptables, add something as follows to your firewall
script:
iptables -A INPUT -i eth0 -p tcp -m tcp --dport 8333 -j ACCEPT

Save and load the firewall.

Now open a webbrowser and type url:


https://your-server:8333/

(click to enlarge image)

The correct version of one or more libraries


needed to run VMware Server may be
missing error and solution
by Vivek Gite · 3 comments
Yesterday I was configuring Red Hat enterprise Linux 4.0 64-bit version on DUAL AMD with 4
GiG system.

Everything went quite smoothly. The last requirement was to configure and install VMWARE
Server products.

VMWARE error

I had downloaded the VMWARE server from official vmware site, while configuring vmware
server I got an error, which reads as follows:

The correct version of one or more libraries needed to run VMware Server may
be
missing. This is the output of ldd /usr/local/bin/vmware:
linux-gate.so.1 => (0xffffe000)
libm.so.6 => /lib32/libm.so.6 (0xf7f84000)
libdl.so.2 => /lib32/libdl.so.2 (0xf7f80000)
libpthread.so.0 => /lib32/libpthread.so.0 (0xf7f6e000)
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 => /lib32/libc.so.6 (0xf7e3c000)
/lib/ld-linux.so.2 (0xf7faf000)

From above output, I realized that Vmware needs 32-bit version of libc and other X windows
library.

If you are using Debian/Ubuntu 64 bit there is a pcakge available called ia32-libs. You can
install this package to get 32 bit libraries on 64 bit system.
# apt-get install ia32-libs

Luckily, Red Hat enterprise Linux v4.0 provides the backward compatibility too. All you need to
do is type following two commands:
# up2date -i "@Compatibility Arch Development Support"
# up2date -i "@Compatibility Arch Support"

Above two commands will load/install all necessary libraries (total size 1GB). If you want to
save a disk space, install individual packages.

Thanks to this topic @ VMWARE forum for quick solution - VMWare Server: Dependency
problem on 64-Bit Red Hat ES 4, EM64T :D
Start and stop VMWARE VPS / virtual
machine guest operating system from
command line
by Vivek Gite · 11 comments

Vmware server comes with the nifty vmware-cmd utility. It allows an administrator to perform
various operations on a virtual machine from Linux command line / shell prompt such as:

=> Stop / Start VM

=> Get VM status

=> Setup variables

=> Powerdown VM and much more

Task: Lists the virtual machines on the local server

You can list all servers and config file, enter:


# vmware-cmd -l
Output:

/nas/vms/Ubuntu/Ubuntu.vmx
/nas/vms/FreeBSD/FreeBSD.vmx
/nas/vms/OpenBSD/OpenBSD.vmx
/nas/vms/Debian4/Debian4.vmx
/nas/vms/CentOS5/CentOS5.vmx

Turn on VM / Power up VPS

Just pas start option to vmware-cmd,


# vmware-cmd /nas/vms/FreeBSD/FreeBSD.vmx start

To stop VM/VPS, enter:


# vmware-cmd /nas/vms/FreeBSD/FreeBSD.vmx stop

To reset VM/VPS, enter:


# vmware-cmd /nas/vms/FreeBSD/FreeBSD.vmx reset

To suspend VM/VPS, enter:


# vmware-cmd /nas/vms/FreeBSD/FreeBSD.vmx suspend
Find out if OpenBSD VM is on or off:
# vmware-cmd /disk2.vmware/vms/OpenBSD/OpenBSD.vmx getstate
Output:

getstate() = off

vmware-cmd offers other options, please consult VMWARE documentation for more
information.

Linux wget: Your Ultimate Command Line


Downloader

It is a common practice to manage UNIX/Linux/BSD servers remotely over the ssh session. You
may need to download download the software or other files for installation. There are a few
powerful graphical download manager exits for Linux and UNIX like operating systems:

 d4x: Downloader for X is a Linux/Unix userfriendly program with nice X interface to download
files from the Internet. It suppotrs both FTP and HTTP protocols, supports resuming
 kget: KGet is a versatile and user-friendly download manager for KDE desktop system.

 gwget / gwget2: Gwget is a download manager for the Gnome Desktop

However, when it comes to command line (shell prompt) wget the non-interactive downloader
rules. It supports http, ftp, https protocols along with authentication facility, and tons of other
options. Here are some tips to get most out of it:

Download a Single File Using wget

Type the following command:


$ wget http://www.cyberciti.biz/here/lsst.tar.gz
$ wget ftp://ftp.freebsd.org/pub/sys.tar.gz
$ wget -O output.file http://nixcraft.com/some/path/file.name.tar.gz
$ wget http://www.kernel.org/pub/linux/kernel/v2.6/testing/linux-2.6.36-
rc3.tar.bz2
Sample outputs:
Fig.01: wget example

How Do I Download Multiple Files Using wget?

Use the following syntax:


$ wget http://www.cyberciti.biz/download/lsst.tar.gz
ftp://ftp.freebsd.org/pub/sys.tar.gz ftp://ftp.redhat.com/pub/xyz-1rc-i386.rpm
You can create a shell variable that holds all urls and use the 'BASH for loop' to download all
files:

URLS=”http://www.cyberciti.biz/download/lsst.tar.gz \
ftp://ftp.freebsd.org/pub/sys.tar.gz \
ftp://ftp.redhat.com/pub/xyz-1rc-i386.rpm \
http://xyz.com/abc.iso"
for u in $URLS
do
wget $u
done

How Do I Read URLs From a File?

You can put all urls in a text file and use the -i option to wget to download all files. First, create a
text file:
$ vi /tmp/download.txt
Append a list of urls:

http://www.cyberciti.biz/download/lsst.tar.gz
ftp://ftp.freebsd.org/pub/sys.tar.gz
ftp://ftp.redhat.com/pub/xyz-1rc-i386.rpm

http://xyz.com/abc.iso

Type the wget command as follows:


$ wget -i /tmp/download.txt

Resume Downloads

You can also force wget to get a partially-downloaded file. This is useful when you want to
finish up a download started by a previous instance of wget, or by another program:
$ wget -c http://www.cyberciti.biz/download/lsst.tar.gz
$ wget -c -i /tmp/download.txt
Please note that the -c option only works with FTP / HTTP servers that support the "range"
header.

Force wget To Download All Files In Background

The -o option used to force wget to go into background immediately after startup. If no output
file is specified via the -o option, output is redirected to wget-log file:
$ wget -cb -o /tmp/download.log -i /tmp/download.txt
OR
$ nohup wget -c -o /tmp/download.log -i /tmp/download.txt &
nohup runs the given COMMAND (in this example wget) with hangup signals ignored, so that
the command can continue running in the background after you log out.

How Do I Limit the Download Speed?

You can limit the download speed to amount bytes per second. Amount may be expressed in
bytes, kilobytes with the k suffix, or megabytes with the m suffix. For example, --limit-
rate=100k will limit the retrieval rate to 100KB/s. This is useful when, for whatever reason, you
don't want Wget to consume the entire available bandwidth. This is useful when you want to
download a large file file, such as an ISO image:
$ wget -c -o /tmp/susedvd.log --limit-rate=50k
ftp://ftp.novell.com/pub/suse/dvd1.iso
Use m suffix for megabytes (--limit-rate=1m). The above command will limit the retrieval rate to
50KB/s. It is also possible to specify disk quota for automatic retrievals to avoid disk DoS attack.
The following command will be aborted when the quota is (100MB+) exceeded.
$ wget -cb -o /tmp/download.log -i /tmp/download.txt --quota=100m
From the wget man page:

Please note that Wget implements the limiting by sleeping the appropriate amount of time after a
network read that took less time than specified by the rate. Eventually this strategy causes the
TCP transfer to slow down to approximately the specified rate. However, it may take some time
for this balance to be achieved, so don't be surprised if limiting the rate doesn't work well with
very small files.

Use wget With the Password Protected Sites

You can supply the http username/password on server as follows:


$ wget --http-user=vivek --http-password=Secrete
http://cyberciti.biz/vivek/csits.tar.gz
Another way to specify username and password is in the URL itself.
$ wget 'http://username:password@cyberciti.biz/file.tar.gz
Either method reveals your password to anyone who bothers to run ps command:
$ ps aux
Sample outputs:

vivek 27370 2.3 0.4 216156 51100 ? S 05:34 0:06


/usr/bin/php-cgi
vivek 27744 0.1 0.0 97444 1588 pts/2 T 05:38 0:00 wget
http://test:test@www.kernel.org/pub/linux/kernel/v2.6/testing/linux-2.6.36-
rc3.tar.bz2
vivek 27746 0.5 0.0 97420 1240 ? Ss 05:38 0:00 wget -b
http://test:test@www.kernel.org/pub/linux/kernel/v2.6/testing/linux-2.6.36-
rc3.tar.bz2

To prevent the passwords from being seen, store them in .wgetrc or .netrc, and make sure to
protect those files from other users with "chmod".

If the passwords are really important, do not leave them lying in those files either---edit the files
and delete them after Wget has started the download.
G) Download all mp3 or pdf file from remote FTP server:
Generally you can use shell special character aka wildcards such as *, ?, [] to specify selection
criteria for files. Same can be use with FTP servers while downloading files.
$ wget ftp://somedom.com/pub/downloads/*.pdf
$ wget ftp://somedom.com/pub/downloads/*.pdfOR$ wget -g on
ftp://somedom.com/pub/downloads/*.pdfH) Use aget when you need multithreaded http
download:
aget fetches HTTP URLs in a manner similar to wget, but segments the retrieval into multiple
parts to increase download speed. It can be many times as fast as wget in some circumstances( it
is just like Flashget under MS Windows but with CLI):
$ aget -n=5 http://download.soft.com/soft1.tar.gzAbove command will download
soft1.tar.gz in 5 segments.

Please note that wget command is available on Linux and UNIX/BSD like oses.

See man page of wget(1) for more advanced options.

You might also like