Home > virtualization > How To Install VMware Tools on Ubuntu Guests

How To Install VMware Tools on Ubuntu Guests

I’ve been playing more and more with virtualization lately. Partly in testing Ubuntu alpha and beta releases but also testing the folding project installer and compatibility with multiple distributions. You may have seen my previous tutorials on installing VMware Server on Ubuntu 7.04 or installing VMware Server on Ubuntu 7.10. This tutorial should maintain compatibility with either host (servers running 7.04 or 7.10) in installing vmware tools within the Ubuntu guests.

Install The Compiler Tools

You’ll need to install a few packages in order to compile the latest VMware Tools. These steps are done within the Ubuntu virtual guest:

sudo aptitude install build-essential linux-headers-$(uname -r)

Install VMware Tools

Next you need to tell VMware Server that you’d like to install the VMware Tools. This is done by clicking on VM > Install VMware Tools… in the VMware Server menu running on the host. This must be done while the virtual Ubuntu guest is already running.

This will load a virtual CDROM within your virtualized Ubuntu guest. You may see a window pop-up within the guest. You can close this as we’ll be compiling the VMware Tools on the command line.

Open a terminal (Applications > Accessories > Terminal) and use the following commands. It should be safe to copy-paste:

sudo aptitude update

sudo aptitude install build-essential linux-headers-$(uname -r)

cp -a /media/cdrom/VMwareTools* /tmp/

cd /tmp/

tar -vxzf VMwareTools*.gz

cd vmware-tools-distrib/

sudo ./vmware-install.pl

Simply select all the defaults (press ENTER) at the prompts and before you know it you’ll have VMware Tools installed on the virtual Ubuntu guests. The only prompt I had to make a different selection on in my machines was the video resolution.

note: considering we are compiling the tools for the current running version of the kernel these steps may need to be retaken if the virtualized Ubuntu guest upgrades its kernel.

Categories: virtualization Tags:

Related Posts

  1. Mo
    October 2nd, 2007 at 14:48 | #1

    Your VMWare tutorials are helpful, but have you ever tried VirtualBox? It’s much easier to set up (they provide DEBs and even a repository for Ubuntu) and use, and it’s open source! Try it out if you haven’t before.

  2. October 2nd, 2007 at 18:18 | #2

    Mo – I have used virtualbox and I’ve got a VirtualBox tutorial in the works. The problem is that VirtualBox does not do proper network bridging without a lot of extra work, whereas VMware Server does. This is really the primary reason I’m using VMware Server currently.

    I’ll get it figured out, and you’re sure to see a tutorial once I do.

  3. kalahari875
    October 4th, 2007 at 05:45 | #3

    I am trying this on Ubuntu 7.10 Server and every module in VMware Tools fails to compile. I have all the prerequisites (build-essential, linux headers for the server edition, etc.).

    vmmemctl-only/os.c:26:26: error: linux/config.h: No such file or directory

    vmhgfs-only/driver.c: In function ‘HgfsGetSb’:
    vmhgfs-only/driver.c:4454: error: too few arguments to function ‘get_sb_nodev’

  4. Ron Cary
    October 11th, 2007 at 17:53 | #4

    I ran into a problem installing VMtools. When I enter the 2nd step in the 2nd section of your instructions (sudo aptitude install build-essential linux-headers-$(uname -r)) I receive the following error:
    bash: rlc: command not found

    When I enter: tar -vxzf VMwareTools*
    I get this error: gzip: stdin: not in gzip format
    tar: Child returned status 1
    tar: VMwareTools-6.0.1-55017.tar.gz: Not found in archive
    tar: Error exit delayed from previous errors

    I’ve tried running the steps in root as well, with the same errors.

    I’m running VMware Workstation 6.01, with WinXP as host and Ubuntu 7.04 as guest.

    Could you give me any advice on what to do next?

    Thanks,
    Ron Cary
    rlcary@gmail.com

  5. Joe
    October 18th, 2007 at 06:54 | #5

    When I enter: tar -vxzf VMwareTools*
    I get this error: gzip: stdin: not in gzip format
    tar: Child returned status 1
    tar: VMwareTools-6.0.1-55017.tar.gz: Not found in archive
    tar: Error exit delayed from previous errors

    For the above error you need to change the step :

    cp -a /media/cdrom/VMwareTools* /tmp/

    to:

    cp -a /media/cdrom/VMwareTools*.gz /tmp/

    The problem is it tries to gunzip the .rpm file, which obviously fails..

  6. Guy
    October 18th, 2007 at 13:50 | #6

    I used this on Workstation 6, Vista32 as host and Ubuntu 7.10 server as guest.

    I had a similar problem with the tar command. I received this error:

    tar: Child returned status 1
    tar: VMwareTools-6.0.1-55017.tar.gz: Not found in archive
    tar: Error exit delayed from previous errors

    I solved it by dropping the * and entering the complete file name of the .gz file as follows:

    tar -vxzf VMwareTools-6.0.1-55017.tar.gz

  7. bob23450
    October 19th, 2007 at 05:32 | #7

    AFAIK VmWare products don’t currently support Gutsy as guest. In fact, the vmware tools as shipped with player 2.0.1 (build 55017) ends up with compile errors on the hgfs (shared folders) module with kernel 2.6.22 and says it has no drivers for Xorg 1.3 (i.e. no enhanced mouse). Did anyone get the vmware-tools fully installed somehow in Gutsy?

  8. flurdy
    October 22nd, 2007 at 04:31 | #8

    Here is a tip on fixing the hgfs problem in vmware and ubunty 7.10:
    http://communities.vmware.com/thread/107691

  9. Alan
    October 24th, 2007 at 22:01 | #9

    Hi,

    Given that many people installing VMWare Tools will be windows users who are trying out Ubuntu, I suggest you make it explicit that the file names are case sensitive – something windows users will not be used to having to contend with.

    It threw me for a while!

    Alan.

  10. October 25th, 2007 at 18:24 | #10

    Noob alert!

    I got to the second of the commands on your list and it asked for a different disk name ‘Ubuntu 7.10 _Gutsy Gibbon_ – Release amd64 (20071016)’ than the disk (CD) I have which is “Ubuntu 7.10 amd6″ !???

    VMware Fusion v1.1b1 on MacPro OSX 10.4.10

  11. farmer
    October 26th, 2007 at 14:38 | #11

    Hi,

    tnx! for the tutorial, however i got this message:

    The installation of VMware Tools 6.0.1 build-55017 for Linux completed
    successfully. You can decide to remove this software from your system at any
    time by invoking the following command: “/bin/vmware-uninstall-tools.pl”.

    Before running VMware Tools for the first time, you need to configure it by
    invoking the following command: “/bin/vmware-config-tools.pl”. Do you want this
    program to invoke the command for you now? [yes]

    sh: /etc/vmware-tools: Permission denied
    Making sure services for VMware Tools are stopped.

    Unable to stop services for VMware Tools

    Execution aborted.

  12. George
    October 27th, 2007 at 07:45 | #12

    Hi farmer,

    Make sure you either sudo or log in as root to run the command

  13. Fred Morrison
    November 2nd, 2007 at 13:54 | #13

    For VMWare Tools 6.0.2 install on Gutsy Gibbon, the cp command needs to be:
    cp -a /media/VMware\ Tools* /tmp/

    Please note the space between VMware and Tools* that needs to be ‘escaped’. Also notice that there is no ‘cdrom’ in the path.

  14. Fred Morrison
    November 2nd, 2007 at 14:23 | #14

    None of these instructions work for VMWare Tools 6.0.2. Please correct and repost once you figure out the correct sequence (and most important, syntax) of the commands.

  15. Carlos Rodriguez
    November 3rd, 2007 at 07:08 | #15

    I also run into a wall. Ubuntu as guest Virtual Machine of Vista on a Xeon 5160 cpu.
    All the VMwaretools compile ok EXCEPT the vmhgfs module used for sharing directories with the host. I get

    error: too few arguments to function ‘kmem_cache_create’

    Any ideas?

  16. chironex
    November 11th, 2007 at 06:57 | #16

    Help…Clicking thing “install vm” thing doesn’t cause anything to happen in Ubuntu at all. I even tried to open the Media folder and go into cdrom, but there’s no VM folder at all.

    Someone help!!

  17. teds_favourite_albatross
    November 11th, 2007 at 14:54 | #17

    apt-get install build-essential linux-headers-$(uname -r) -y

    cd /usr/src
    ln -s linux-headers-$(uname -r) linux

    cat </usr/src/linux/include/linux/config.h
    #ifndef _LINUX_CONFIG_H
    #define _LINUX_CONFIG_H

    #include

    #endif
    EOF

    rm /etc/vmware-tools/not_configured

    then install tools as per generic linux guest guide…

  18. Phalanx
    November 26th, 2007 at 01:15 | #18

    Hey George,

    I was having the same problem farmer was having:
    sh: /etc/vmware: Permission denied
    Unable to stop services for VMware Server

    I tried using:
    sudo /bin/vmware-config.pl
    but it was to no avail. Trying to install vmware on ubuntu 7.10

    Any help is greatly appreciated.

  19. December 7th, 2007 at 08:42 | #19

    Clicking VM/Install VMware Tools. Enter the “cp -a /media/cdrom/VMwareTools* /tmp/” command and get the following error “cp: cannot stat `/media/cdrom/VMwareTools*’: No such file or directory” What do I do?

  20. January 20th, 2008 at 12:48 | #20

    Re: error: too few arguments to function ‘kmem_cache_create’

    See http://ubuntuforums.org/showthread.php?t=595348

    for a one-line patch to make vmhgfs in the VMware Tools compile.
    All you need to do is change ‘<’ to ‘<=’ in compat_slab.h

  21. February 1st, 2008 at 02:43 | #21

    Thanks for the small guide, so a small for it note too :)

    For some reason it didn’t mount the downloaded .iso alone so I had to mount it myself (as root). The iso was found on my ~/.VirtualBox it took me 2 minutes looking for it :)

  22. Quyen Nguyen
    February 2nd, 2008 at 00:06 | #22

    Ok, I visited this page and learned quite a bit about installing programs in Ubuntu (which is insanely complicated, but fun to play with). Anyway, VMware has a very good instruction in their webpage.

    http://www.vmware.com/support/ws55/doc/ws_newguest_tools_linux.html

    I didn’t follow these instruction though, I was kind of typing things in randomly. And it works. Oh, for those of you who really like to know more, here is a website explain how to “install ANYTHING in Ubuntu.”

    http://www.monkeyblog.org/ubuntu/installing/

    By the way, is there any of you guys know how to check if VMwareTools is installed or not?

    What is it for and How do I use it anyway? (:P)

  23. sirbrent
    February 2nd, 2008 at 05:05 | #23

    Thank you so much for your tutorial. I did experience some problems; but without your tutorial i wouldnt have known where to start, i would have been lost. I am a power user, but in windows and os x… (L)Unix Terminal is very new to me. Thanks again!

  24. March 11th, 2008 at 07:13 | #24

    For the anyone with a more recent kernel that is getting compiling issues with some of the drivers, this web site has some patches to fix the code:

    http://tuxx-home.at/archives/2007/06/29/T12_33_53/

    The problem is that the most recent kernels had some changes which break the vmware tools source, but the toolsl source can be fixed.

  25. Jason
    March 15th, 2008 at 11:30 | #25

    This tutorial is now a bit out of date, anyone getting kernel issues at the compile step should upgrade their VMWare player/workstation to 5.5.6

  26. luka
    March 26th, 2008 at 18:55 | #26

    You Know! I tried to install VMwareTools for around 5 days, searching in the web and couldn’t find the rigth way to do it, even the “VMware Manual” is USLESS. So your instrucctions are so easy to follow even for a Mexican guy like me.Thank You so much. “Eres un Cabron”

  27. Lukas
    April 3rd, 2008 at 02:17 | #27

    I tried to install vmware tools on ubuntu and currently I’m facing following issue when I’m trying to run ./vmware-install.pl

    A previous installation of VMware software has been detected.
    Unable to find the answer LIBDIR in the installer database (/etc/vmware-tools/locations). You may want to re-install VMware Tools.
    Execution aborted

    I’m also not able to uninstall tools.

    Thanks in advance for a help

  28. binaryspiral
    April 9th, 2008 at 15:04 | #28

    If you’re having problems getting the VMwareTools file, I had to unmount and remount the CDRom for it to show up.

    ls /media/cdrom0/

    You should see VMwaretools files. If not:

    sudo umount /media/cdrom0/
    sudo mount /media/cdrom0/

    Then perform the ls /media/cdrom0/ again.

  29. Leonardo Ruppel
    April 24th, 2008 at 22:25 | #29

    Perfect tutorial Works Perfect.
    Thanks a lot !!!

  30. June 7th, 2008 at 06:16 | #30

    ok well i got a question i got everything done fine no problems at all. But the last question it asked me i didnt understand completely i thought it was asking for a password so i typed that in and what i now think it wanted was my username. Will this create problems? Says installed when i rebooted into my system.. I hope i didnt spend all that time setting this up only to screw it up lol
    Take care
    G

  31. Robin
    June 10th, 2008 at 04:32 | #31

    Thank you for this article. Very appreciated.

  32. mark
    June 22nd, 2008 at 16:39 | #32

    I am new to Linux, and needed to install VMWare tools on my Macbook with VMWare fusion. I followed your instructions, and everything went perfectly.

    Thanks for your tutorial as I would have been completely stuck without them.

  33. C Winton
    July 19th, 2008 at 21:39 | #33

    Excellent info. After installing current VMware Workstation on a new Vista system and putting in Ubuntu 8.04.1 I found VMware Tools install didn’t work for this release of Ubuntu. I just followed the procedure given here … everything went in as advertised, although the kernel differences required a good bit of recompile in finishing up, all of which went in without a hitch. Thanks! I figure this saved me a good bit of grief trying to get the tools in by cruder means.

  34. August 4th, 2008 at 11:48 | #34

    great work,

  35. B. Good
    August 7th, 2008 at 16:26 | #35

    Well, congrats to all you Linux peeps, but once again, this thing has too many warts. Call me a troll, but how the h@!! can anyone say Linux is ready for the desktop when installing the VMWare tools takes a manual? Please, wake me when Ubuntu can compare with the XP procedure: Double-click the .exe and follow the prompts.

  36. Jelloir
    August 8th, 2008 at 02:01 | #36

    Your a troll! Hey you asked me too. I guess we won’t be waking you up anytime soon if you want easy GUI tools to install software that isn’t packaged for Debian/Ubuntu however the power of apt/aptitude makes a mockery of any Double click exe follow the prompts.

  37. Natalie
    August 8th, 2008 at 12:17 | #37

    I followed the steps but after “sudo ./vmware-install.pl” I had a problem.

    There was a question “What is the location of the directory of C header files that match your running kernel? [/usr/src/linus/include]“.

    When I pressed transmit I received the message “The paht “/usr/src/linux/include” is not an existing directory.”.

    I checked and I had two directories under /usr/src. They are /usr/src/linux-headers-2.6.24-19 and /usr/src/linux-headers-2.6.24-19generic.

    I tried both files and received the same message “The path “/usr/src/linux-headers-2.6.24-19[or 2.6.24-19generic]/include” is a kernel header file directory, but it does not contain the file “linux/version.h” as expected. This can happen if the kernel has never been built, or if you have invoked the “make mrproper” command in your kernel directory. In any case, you may want to rebuild your kernel.”.

    It just keeps repeating the question until I close the window.

    Do you know what is wrong?

  38. Natalie
    August 8th, 2008 at 12:20 | #38

    Sorry, I should have said I have just built the virtual machine using Ubuntu version 8.04

  39. Natalie
    August 9th, 2008 at 00:17 | #39

    I think I have found the proper header files at /usr/src/linux-headers-2.6.24-19-generic/include/linux/version.h. (Another possibility is /usr/src/linux-headers-2.6.24-19-386/include, I have tried both.)

    The question is:
    What is the location of C header files that match your running kernel? [/usr/src/linux/include]

    I have tried responding with:
    /usr/src/linux-headers-2.6.24-19-generic/include
    /usr/src/linux-headers-2.6.24-19-generic/include/
    /usr/src/linux-headers-2.6.24-19-386/include
    /usr/src/linux-headers-2.6.24-19-386/include/

    All give the following response:

    The directory of kernel headers (version @@VMWARE@@ UTS_RELEASE) does not match your running kernel (version 2.6.24-19-generic). Even if the module were to compile successfully, it would not load into the running kernel.

    Then it asks for the location again.

    Can anyone help me?

  40. Raymond
    September 24th, 2008 at 02:34 | #40

    Just a note… My ubuntu server didn’t mount the vmware tools image automatically. I had to mount /dev/cdrom containing the vmware tools manually.

  41. cheeseMerchant
    November 21st, 2008 at 16:39 | #41

    VMware Tools as released as part of the products supports certain kernel versions of the various linuces, but very often not the one you have (thanks, Murphy). If you are not faint of heart you can check out the Open VM Tools project on SourceForge for source that may support your system. You’ll need to build it separately from VMware Tools and then insert the modules into the VMware Tools distribution, and then install it (essentially patch the VMwareTools distribution).
    If you check the manifest in the .tar.gz for your flavour and kernel version in the precompiled binaries you can find out if your system will work without rebuilding. That case would be a one-click install.
    Good luck…

  42. Anu
    December 10th, 2008 at 15:23 | #42

    This information is usable for installing vmware tool in ubuntu guest
    I have Ubuntu 8.10 as guest using vmware server 1.0.7 on host os windows xp.
    I had installed vmware tool but i found problem as :
    Stopping VMware Tools services in the virtual machine:
    Guest operating system daemon:-ne done

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

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

    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? [/usr/src/linux/include]

    The path “/usr/src/linux/include” is not an existing directory

    I used “/usr/scr/2.6.27-7-generic/include”, but still it rises the same error.

    How this problem is solved?

    I will be very thankful if this problem is solved.

  43. glade
    February 10th, 2009 at 00:40 | #43

    I used “sudo aptitude install linux-headers-2.6.27-7-generic” which installed the headers.

    Then I supplied “/usr/src/linux-headers-2.6.27.7-generic/include” to the vmware tools install script.

    Seems to be working.

  44. klitos
    March 1st, 2009 at 14:47 | #44

    friend me sale esto
    A previous installation of VMware software has been detected.

    The previous installation was made by the tar installer (version 3).

    Keeping the tar3 installer database format.

    Error: Unable to execute “/usr/bin/vmware-tools-distrib/vmware-uninstall-tools.pl.

    Failure

    Execution aborted.
    helpme

  45. March 22nd, 2009 at 09:02 | #45

    Thank you for taking the time to present this, I found it very helpful and now have ubuntu and vm tools working prefectly

  46. Battousay
    September 9th, 2009 at 05:08 | #46

    ohhhh man thank you! I´m new in the Linux world and don´t you know the dificult for me.
    this is the one place that I found something important about. thank you!

  47. Greg
    November 25th, 2009 at 19:17 | #47

    Thanks!!!!!!!

  48. conan
    February 17th, 2010 at 17:46 | #48

    Thank you very much! It works perfectly!! ^__^

  1. October 12th, 2007 at 08:20 | #1
  2. October 27th, 2007 at 04:00 | #2
  3. November 3rd, 2007 at 15:01 | #3
  4. November 3rd, 2007 at 15:02 | #4