40

I installed my Ubuntu in vmware, no I need install vmware tools, I got error:

Searching for a valid kernel header path...
The path "" is not valid.
Would you like to change it?[yes]

In CentOS, I run the following commands to resolve this issue:

yum install gcc-c++
yum install kernel-devel
yum install kernel-headers
yum -y update kernel

But I don't know how to do in Ubuntu.

I have tried the following commands but nothing changed

sudo apt-get update 
sudo-get install build-essential linux-header-$(uname -r)
sudo ./vmware-uninstall-tools.pl
sudo ./vmware-config-tools.pl
sudo ./vmware-install.pl

Issue Changed:

Ran

sudo ./vmware-uninstall-tools.pl

and deleted the folder of /etc/vmware-tools then I ran

 sudo ./vmware-install.pl

Now I can successfully install vmware-tools.

After restart, I can see the folder /mnt/hgfs, but can't see my shared folder.

1
  • Using the open-vm-tools-desktop package from the distribution as suggested by Pavel Kovalev is now the recommended way, see kb.vmware.com/s/article/2073803 .
    – anre
    Dec 22 '20 at 18:29

10 Answers 10

42

I encountered this problem when upgrading from 12.10 to 13.04. No matter what I did, the VMware Tools installer couldn't seem to find the headers. For the record, here's how I installed the headers:

sudo apt-get update && sudo apt-get install build-essential linux-headers-$(uname -r)

Turns out, the installer is looking for the version.h file in under [kernelsource path]/include/linux/version.h, it's not there. The location of version.h is [kernelsource path]include/generated/uapi/linux/version.h

The solution is a symlink:

sudo ln -s /usr/src/linux-headers-$(uname -r)/include/generated/uapi/linux/version.h /usr/src/linux-headers-$(uname -r)/include/linux/version.h

After creating this symlink, I was able to run the VMware Tools installer without a problem.

3
  • 3
    the symlink fixed my issue as well Apr 28 '13 at 9:25
  • symlink also did fix the issue on ubuntu 13.04 for me
    – cobie
    Aug 4 '13 at 21:56
  • +1 for the symlink work around, this also solved it for me.
    – Mahn
    Sep 9 '13 at 14:34
29
sudo apt-get install build-essential linux-headers-$(uname -r)

& then install VM-WARE-TOOLS

Go to vmware "VM" tab to install vmware tools

Plz Keep it in mind when you update Ubuntu ( & the kernel version is changed ) u need to run

vmware-config-tools.pl

every time only when kernel is changed

5
  • run vmware-config-tools.pl, got same error message:**Searching for a valid kernel header path... The path "" is not valid. Would you like to change it?**
    – Tom
    May 7 '12 at 1:05
  • are you running it with sudo vmware-config-tools.pl ? , i have check its working properly
    – One Zero
    May 7 '12 at 1:57
  • I have run vmware-config-tools.pl,nothing changed.
    – Tom
    May 7 '12 at 4:08
  • 4
    +1 for a generic approach (uname -r) Jul 31 '12 at 15:24
  • +1 This worked with VMWare Player v5.0.1 on Quantal as well.
    – IsaacS
    Jan 21 '13 at 0:49
15

1) Use Install VMWare Tools option in VMWare Client to attach media

2) Update the server

sudo apt-get update
sudo apt-get upgrade

3) Create the mount point

sudo mkdir -p /media/cdrom

4) Mount the ISO

sudo mount /dev/cdrom /media/cdrom

5) Change Directory

cd /media/cdrom

6) Copy the tar file to your /tmp directory

sudo cp VM*.tar.gz /tmp

7) Install Build tools if necessary

sudo apt-get install linux-headers-server build-essential
(for desktop is "sudo apt-get install linux-headers-$(uname -r) build-essential")

8) Change Directory

cd /tmp

9) Unmount the ISO

sudo umount /media/cdrom

10) Expand the tar

sudo tar xzvf VM*.tar.gz

11) Change Directory

cd vmware-tools-distrib

12) Create a special directory

sudo mkdir /usr/lib64

13) Run the Install Script

sudo ./vmware-install.pl -d

14) Reboot

sudo reboot

source

1
  • That helped, first one statement didn't worked.
    – Johnny_D
    May 12 '13 at 21:21
8

Specify /lib/modules/3.2.0-24-virtual/build/include as the path after you installed kernel headers via One Zero's answer.

7

I've just done this on a VMware hosted Ubuntu Linux 12.04 (32-bit) machine and found I needed to do

sudo apt-get install linux-headers-3.2.0-24-generic-pae

As well as having the normal build-essential package installed.

Your mileage will vary in terms of the exact linux-headers package to install I guess. But that worked fine for me.

1
  • Not working.'tom@ubuntu:~/vmware-tools-distrib$ sudo apt-get install linux-headers-3.2.0-24-generic-pae Reading package lists... Done Building dependency tree Reading state information... Done linux-headers-3.2.0-24-generic-pae is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 31 not upgraded. '
    – Tom
    May 7 '12 at 1:16
3

The open source tools for VMWare should work just as well, if you want to try going down that route.

For Ubuntu 12.04+

sudo apt-get install open-vm-tools

I believe it handles everything else for you. Just restart the virtual machine and VMWare Player should work without a hitch.

1
  • 1
    VM Tools doesn't work after reboot. Are you sure I don't need to additionally activate something?
    – Danny Lo
    Jun 11 '15 at 14:27
2

Try

sudo apt-cache search *package-name*

and your package name Ex:

sudo apt-cache search kernel

and you will be produced with all the available packages in the repository , find out the one you want and

sudo apt-get install *package-name*

it . Before doing it update your repository with

sudo apt-get update
3
  • Hi, It's not working.tom@ubuntu:~/vmware-tools-distrib$ sudo apt-get install kernel-devel Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package kernel-devel
    – Tom
    May 4 '12 at 10:12
  • Have you tried with the sudo apt-cache search kernel ? You will be definitely shown up with some search results . My laptop is not available at this moment otherwise i would have posted you with screenshots .....
    – mviswa
    May 4 '12 at 11:10
  • What's the meaning of searching? I got lots of results.
    – Tom
    May 7 '12 at 1:36
2

Feels like I found an answer (I used it for 17.10 ) and original answer is here

In the terminal window execute this command to remove any previously installed tools:

sudo apt-get autoremove open-vm-tools

and after that execute this command to add tools:

sudo apt-get install open-vm-tools-desktop

and a final thing: do not forget to reboot.

It worked very well for me!

1
1

Also make sure you select the OS correctly in VMWare settings. When the OS is "other", Install VMWare Tools menu is greyed out.

0

install the .bundle as usual

download this file PATCH

Extract it in the home directory and delete the old patch flag:

sudo rm /usr/lib/vmware/modules/source/.patched

Then run the patch as usual:

sudo ./patch-modules_3.2.0.sh vmware3.2.0.patch

Hope that helps. If it doesnt work try keepin the two patch files and the .bundle setup in home directory.

PS: I found this on the forums of VMWare and it fixed the installation issue for me.

1

Not the answer you're looking for? Browse other questions tagged or ask your own question.