News Flash! -:- Newer Version of This Guide based on CentOS 5.3 (32/64bit) and VMware Server 1.0.9 Available Here

So you just installed CentOS 5, as your host operating system for the latest version of VMware Server, 1.0.3. However, tells you it is missing something.

What is Well, to keep a long story short, is a set of shared libraries that are used by the X Windows system. Although the term X Windows has now been deprecated in place of Xorg, the libraries are still required and still retain the same name.

To install the libraries that you require, just enter the following as root (or you could use sudo if you have it set up nicely):

yum -y install libX11-devel libXtst

Once you have those two and their dependencies installed, vmware will no longer complain about missing components, but you may come across another problem.

VMware requires GCC to be installed, so that it can compile a kernel module and run happily each day forever until the sun goes down. As root, type the following:

yum -y install gcc

OK, so now you have GCC installed. If VMware complains about how it can’t find your “C Header Files”, you may need to do the following, as root:

yum -y install kernel-headers kernel-devel

Now, some people will argue that you just need one, and not the other. In my opinion, just get both. That way when you install something else that needs the other later on, you will already have it! Besides, it’s not like you are giving up gigabytes of space, it’s just a few megabytes.

Lastly, VMware will probably look for your C Header files in the following location:


Unfortunately, it won’t be there. As root, type the following:

mkdir /usr/src/linux

cd /usr/src/linux

ln -s /lib/modules/<your current running kernel>/build/include include

Run the setup one last time, and hopefully everything will be fine! Don’t forget to add your selected remote access port to your firewall!

If anyone requires any further assistance, feel free to post a comment here and let me know!

If you found this helpful or interesting, why not Digg It?

23 Thoughts on “VMWare Server on CentOS 5

  1. Hi Darkness,

    Thanks for you comment! What you have said is completely valid and true, and other readers should note Darkness’s comment.

    I did state my reasons for installing the kernel headers. I’m sure you have had your moments where you wished you had the kernel headers. More on that below.

    Perhaps the installation of libX11-devel could be left out, but it’s not hurting the installation either way.

    Being the avid user of linux that you certainly seem to be, I am sure you would know that sometimes the default install of a system, is not always the same as the next.

    It is assumed that someone who finds their way to this article, is experiencing the problems that I have pointed out.

    While this may sound a little strange, you may find it interesting. Before writing this article, I performed a default “server” install of CentOS 5 three times (on the same machine), and three times I was unable to get the vmware kernel module to compile, until I installed the kernel headers. Even after downloading all the updates and rebooting. Installing the kernel development files, and rebooting again.

    I’m sure you will agree that linux can be strange sometimes. So for people who may not have as much experience as you and I, why not cover all the bases for their sake, just in case?

  2. On my bare CentOS 5 install on i386, I only needed to install: gcc kernel-devel libXtst, xinetd.

    Note xinetd was not installed by default, but is needed by VMware server.

    Also note that neither libX11-devel nor kernel-headers are necessary in this case. The -devel package for your kernel (i.e., kernel-devel) is definitely necessary.

    My knew that kernel headers are in /lib/modules/`uname -r`/build/include, I did not need that symbolic link.

  3. I installed CentOS5, kernel-devel 2.6.18-8.1.8.el5
    When installing VMware server I get stuck at:
    The path "/usr/src/linux/include" is an existing directory, but it does not contain a "linux" subdirectory as expected. I checked the directory and it is empty. I tried installing devel and headers and I keep getting stuck at the same spot. I have rebooted and tried again.
    What is the location of the directory of C header files that match your running kernel? [/usr/src/linux/include]
    Any ideas?

  4. Sorry for the delayed reply.

    After installing the devel and header packages, you should have a directory located at:

    /lib/modules/your current running kernel/build/include
    “linux” is just a wild card directory name that is replaced by the directory name of your running kernel.

    Sometimes the vmware scripts detect it automatically, other times they don’t, thus we create a symbolic link to the correct location, so that it can find it in it’s “default” location (/usr/src/linux/include)

    I updated the guide today, so it might be worth giving it another shot, if you are still having troubles.

  5. I have been fighting this exact problem all day today, and I thought your post was going to be just the thing I needed!

    Only problem is that it is not working for me. you say that there will be a /build/include directory path under the /lib/modules/ but there is not. I installed the headers and devel packages, but the only place I see an include directory (created after the devel and headers were installed) is in /usr/source/kernals//include

    If I use that directory, I’m told that the kernel headers are version 2.6.18-53.1.14.el5 and that the running version is 2.6.18-53.1.14.el5xen. The include directory is in fact under a directory with the “xen” extention, so what’s up?

    Centos 5, Vmware server 1

  6. Hi bluser,

    The fact that you are using a Xen kernel, means things will be different. I was writing in regards to a standard kernel (not x64, Xen or SMP).

    Basically, you are using a Xen kernel (hence the 2.6.18-53.1.14.el5xen), try rebooting with a standard kernel (or install one), or ammend my steps for your kernel version.

    Regardless of hardware type, you should be able to install a stock kernel.

    Having said that, if you want to use Xen, unless you want to run Windows Operating Systems, simply use the Xen Virtual Software instead of Vmware. If you want to use Vmware, using it with a Xen kernel won’t offer you any increase in performance. In fact it will decrease, because the Xen kernel will reserve memory for itself for virtual machines, taking away from the memory that could be used for Vmware Virtual Machines.

  7. Hmm, xen kernel eh? All I know is that I was given a set of disks and told it was centos 5. I don’t really know anything about centos, except that the powers that be wanted me to remove the perfectly working ubuntu install I had done, and use centos, because someone here knows it better. Think I’ll go back.

    Thanks for the help!

  8. I am having a problem at the location of C header files as well. I have done everything you have said, but the error I am getting is in regards to the symbolic link. I guess the kernel builder is looking for a directory called include, but the include in /usr/src/linux is a file? (Sorry if that doesn’t make sense, I’ve only had linux for a week.) At any rate, I cannot get past this point, any ideas? Thanks!

  9. Hi cchristm,

    Welcome to the world of linux! Your question makes perfect sense! My article instructs you to create that symbolic link, to quickly get everything up and running, without a reboot.

    If you started up your machine, installed VMware, installed all it’s other required RPMS, installed kernel headers, installed kernel devel files, and then rebooted, before finally running, vmware-config should find the location of your header files and build the kernel module automatically.

    You probably have but, have you tried rebooting? It would also be a good idea to install the latest kernel, kernel headers and kernel devel. At a console simply type (as root):

    yum -y update

    If the include directory, in /usr/src/linux is a file, then there is a problem with your symbolic link. If you copied the line of code from my article, remember you need to replace with the directory name of your current running kernel. If you use the Tab key on your keyboard to complete directory names for you, you shouldn’t need to know the name. For example:

    ln -s /lib/modules//build/include include

    You press it twice just in case there are multiple directories, as each will become listed. To choose the directory with the highest version number, type in enough characters to help the tab key auto complete the directory name for you, once it does, continue with the rest of the command above.

    The directory name “linux” in /usr/src/linux is a phantom name, in that it actually represents the current version of your running kernel (running yum -y update will change this). If it continues to show linux, instead of the current running version of your kernel, when you run, then it is possible you don’t have everything installed.

    Some people will argue against this, but I always install the kernel headers, and the kernel devel files, make sure you have too.

  10. I am trying to install vmware on centos 5 and I followed your steps and I am getting stuck on the “What is the location of the directory of C header files that match your running kernel”

    I used to have the xen kernel, I have removed and gone to a standard kernel and then recreated the symbolic link to match.

    I still get the “What is the location of the directory of C header files that match your running kernel” error. I have run update and rebooted several times. Any thoughts?

  11. I made it work after several more updates and several more reboots. Thanks for the post.

  12. Hi grandtxred,

    Glad to hear you had success after all. Perhaps you would like to share the additional packages you had to install, if there were any?

  13. I'm having a similar error to one of the folks above. I'm still have an error, but I think I'm closer.

    First off, when I installed the 64 bit CentOS 5 CDs, I wound up with the xen kernel as well. I verified with uname and looking at the kernel config that I'm running xen. I didn't knowingly ask for it, and I'll be using VMWare instead, but that's what I got.

    Anyway, the step that was:
    yum -y install kernel-headers kernel-devel

    Probably should have been something like something like:
    yum -y install kernel-xen-headers kernel-xen-devel

    Those packages are valid, and get me closer to what I want.
    I redid the symlinks, etc.
    But this did NOT WORK. It installs a LATER version of the xen kernel files.

    So now I'm getting a VMWare mismatch between 2 xen versions:
    Kernel headers directory = 2.6.18-92.1.10.el5xen
    Running kernel version = 2.6.18-8.el5xen

    So the is clearly newer than my running kernel. Loving that Linux… oh yeah…

    Yum does say you can specify version info in the packages, so I tried this:
    (Force correct version, and broken into two commands)
    yum -y install kernel-xen-headers-2.6.18-8.el5xen
    yum -y install kernel-xen-devel-2.6.18-8.el5xen
    But I get back:
    "Nothing to do"

    I also tried this:
    (Force correct version, and yes we know it's not the latest)
    yum –obsoletes -y update kernel-xen-headers-2.6.18-8.el5xen
    yum –obsoletes -y update kernel-xen-devel-2.6.18-8.el5xen

    "could not find updates"
    "no packages marked…."

    So, I think I need the kernel xen headers and devel package.
    And I need it for my specific kernel 2.6.18-8 (xen, etc)

    I'm clearly misunderstanding something, but at this point I'm out of ideas.

    I suppose I could try to bring the kernel forward, but that seems really drastic and not something I've done before.

    Also, there only seems to be the xen kernel built. I can't just "switch over" to the non xen.

    Any thoughts? would really appreciate it….

  14. hello,

    I am getting the "What is the location of the directory of C header files that match your running kernel? [/usr/src/linux/include]" when i try installing VMware tools.

    I did all the steps outlined above
    in my "/usr/src/linux" i have include softlinked to

    and it still doesnt work, any idea?

  15. Hi,

    Having issues with the location of the C header files required by running on Centos5

    Kernel and kernel-devel packages appear to match:

    #uname -r

    # yum list kernel-devel
    Loading fastestmirror plugin
    Loading mirror speeds from cached hostfile
    * base:
    * updates:
    * addons:
    * extras:
    Installed Packages
    kernel-devel.i686 2.6.18-92.1.22.el5 installed

    However, I can't find the location of the include directory for 2.6.18-92.1.22.e15:

    # pwd
    # ls
    build modules.dep modules.pcimap updates
    extra modules.ieee1394map modules.seriomap weak-updates
    kernel modules.inputmap modules.symbols
    modules.alias modules.isapnpmap modules.usbmap
    modules.ccwmap modules.ofmap source
    # file build
    build: broken symbolic link to `../../../usr/src/kernels/2.6.18-92.1.22.el5-i686'

    # ls /usr/src/kernels/

    Any help would be greatly appreciated.



  16. Pingback: VMWare Server on CentOS 5 « Useful Stuff…hopefully…!

  17. The following worked for me with a Xen kernel on RHEL5.4 running on VMware fusion. I did this to run a RedHat VM on Xen, inside of a RedHat VM on VMware. It is possible to have two layers of VMs. It might perform slowly but it’s a nice way to get familiar with Xen.

    From Fusion click “Virtual Machine” > “Install VMware Tools”. Then:

    mnt /dev/cdrom /mnt/cdrom
    cp /mnt/cdrom/VMwareTools-7.6.3-94249.i386.rpm /tmp
    rpm -ivh /tmp/VMwareTools-7.6.3-94249.i386.rpm

    Yes, we’re installing a i386 RPM on an x86_64 system. We will actually be configuring the results of this RPM with the included Perl script, which does depend on kernel headers and looks for them in a certain location, so we’ll set up sym links (The exact version of the kernel may vary):

    yum install gcc kernel-xen-devel
    cd /usr/src
    mkdir linux
    cd linux

    ln -s /usr/src/kernels/2.6.18-164.9.1.el5-xen-x86_64/include include

    The RPM should have put the Perl script for the final command in your path. You’ll see it mention an X resolution but you can ignore it if you’re not running X. The purprose of running the above for me was to speed up the core system. You’ll see new kernel modules after the install.

    [root@vserver1 linux]# lsmod | grep vm
    vmblock 49608 3
    vmmemctl 43112 0
    vmhgfs 74560 0
    [root@vserver1 linux]#

  18. If you are using the xen kernel for CentOS 5, you can install the corresponding kernel-header version and it should work. i ran the command "yum -y install gcc kernel-xen-devel" and i was able to run the successfully after a reboot.

  19. Thank you so much guys, you are one of the main reasons why some people don't give up on Linux, and others love it.

  20. I can confirm that VMWare Tools will install if you stay diligent. I was just able to install it on two different CentOS 5.6 servers (using only the install DVD for YUM by the way).

    1) Check to see if you are running Xen uname -r
    2) If you are running Xen, then yum -y install gcc kernel-xen-devel
    3) REBOOT
    4) Run the script again.

  21. created a link /usr/src/linux still not working

Post Navigation