Installing VMware Server 2.0.2 on CentOS 5.4

June 27, 2010

EDIT: We no longer recommend that you use VMware server since the software is no longer supported. Instead we recommend using VirtualBox. Please read through our tutorial showing how to install Virtualbox 4.1 on CentOS 6.2. Although the tutorial was written for CentOS 6.2, it can be applied to CentOS 5.x as well.


This article will show you how to install VMware server 2.0.2 on a CentOS 5.4 Linux system with SELinux and iptables enabled. The following steps will need to be done with the root account.

Go to vmware.com and download the RPM package for VMware Server 2.0.2. Once downloaded, install it:

rpm -Uvh VMware-server-2.0.2-203138.i386.rpm

After the installation has completed, run the VMware configuration script. In many cases you can accept the default options:

/usr/bin/vmware-config.pl

As per the VMware server release notes, on a Red Hat Enterprise Linux 5 system with SELinux enabled, the host agent will not start because SELinux will prevent it. You will need to use chcon to change the security context for certain VMware libraries. At the very least, you will need to do this for libvmacore.so.1.0 otherwise VMware will not start properly:

chcon -t textrel_shlib_t '/usr/lib/vmware/vmacore/libvmacore.so.1.0'

Additionally, if you wish to create guest operating systems in VMware directly from .ISO files, you will also need to enter the following so that SELinux doesn't deny it access:

chcon -t textrel_shlib_t '/usr/lib/vmware/hostd/diskLibWrapper.so'

If you wish to install and use the VMware Remote Console Firefox Plug-in locally on CentOS, you will need to enter the following so that SELinux doesn't deny it access. However if you plan on using the VMware Remote Console plugin remotely from a different machine that doesn't have SELinux enabled, this step can be skipped:

chcon -t textrel_shlib_t '/home/username/path/to/plugin/np-vmware-vmrc-2.5.0-122581.so' (where "/username/path/to/plugin/" is the path to where the plugin extension was installed)

If you have iptables running on your CentOS installation and you wish to allow external users remote access to the VMware web console, you will need to modify your firewall to allow them access. Begin by editing your firewall rules:

nano /etc/sysconfig/iptables

Below is an example rule to allow 192.168.1.2 access to the web console over a SSL connection (i.e. HTTPS):

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8333 -s 192.168.1.2 -j ACCEPT

Rule to allow 192.168.1.2 access to the web console over a regular unencrypted connection (i.e. HTTP). Note that this is bad as you'll be submitting your credentials (by default your CentOS root account) over the network in the clear when logging into the VMware web management console:

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8222 -s 192.168.1.2 -j ACCEPT

Rule to allow 192.168.1.2 access to a guest OS through the VMware Remote Console Plug-in:

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 902 -s 192.168.1.2 -j ACCEPT

If you've made any changes to your firewall rules, make sure to restart iptables so that it accepts the new rules:

/etc/init.d/iptables restart

Optionally, enter the following to verify your active firewall rules:

/etc/init.d/iptables status

If you will be accessing the guest operating systems remotely through the VMware Remote Console Plug-in, ensure that X11 is loaded automatically on bootup otherwise you will get the error "VMware Remote Console Plug-in unrecoverable error: (mks) Unexpected signal: 11". To do so, edit /etc/inittab in CentOS and confirm that for the line entry "id:#:initdefault:", that the system is configured to boot in runlevel 5 as follows:

id:5:initdefault:

Be aware of the following issues which may affect you: (1) No login prompt when accessing the VMware web console on port 8333/TCP, and (2) VMware service crashing due to conflicts with glibc. Details about the first issue (unfortunately with no clear solution) are located in this thread. Workarounds include restarting the vmware-mgmt service (/etc/init.d/vmware-mgmt restart), closing, re-opening your web browser and retrying the transaction, or using the regular unencrypted HTTP interface (default 8222/TCP) for managing the guest operating systems. The VMware service crash issue can be fixed by downgrading glibc. See this thread for instructions if this affects you.

Given that VMware can be sensitive to system updates, it is recommended to configure yum so that you can rollback any changes should they create conflicts. To configure your system for this, edit /etc/yum.conf adding the line tsflags=repackage to it, and edit /etc/rpm/macros (create this file if it does not exist) and add %_repackage_all_erasures 1 in it. Prior to being upgraded your programs along with any customized configurations for those programs (if any) will be kept in /var/spool/repackage/ and you will notice your yum update procedure taking longer because it now has to repackage and store the files that are being updated before updating them.

If you wish to change the default SSL certificates, use OpenSSL to create a new certificate and replace the ones located in /etc/vmware/ssl/. Instructions on how to do so can be found here.

Do not forget to install VMware Tools in the guest operating system for improved performance. This usually involves powering on the guest OS, clicking on Install VMware Tools in the VMware web console for that guest operating system, mounting the virtual cdrom drive with mount /dev/cdrom /mnt/cdrom (assuming this is a valid mount point), and proceeding with either the RPM package or source code installation.

In order to stop and start VMware, use the following commands:
/etc/init.d/vmware stop

/etc/init.d/vmware start

The VMware logs are located within /var/log/vmware/. Pay close attention to hostd.log when you are troubleshooting problems.

If your Linux kernel gets updated you may notice your VMware services not running upon bootup. When you try to manually start them with /etc/init.d/vmware start you may see the following message: VMware Server is installed, but it has not been (correctly) configured for the running kernel. To (re-)configure it, invoke the following command: /usr/bin/vmware-config.pl. If this occurs, simply do what is recommended and run /usr/bin/vmware-config.pl which will run the VMware configuration script again (i.e. the same procedure that we've already gone through above). It should be able to remember your previous settings. After the configuration script has completed check /etc/vmware/hostd/ for the existence of new versions of configuration files (named as NEW_filename.xml) and run diff to compare the differences (ex: diff config.xml NEW_config.xml).

Finally, if you ever wish to uninstall VMware, enter the following command: rpm -e VMware-server

For solutions to other common problems that can be encountered with VMware, including an error that occurs when accessing the VMware management console through Firefox 3.6, please see this posting.


Originally posted December 21, 2009