20

So I am using Lubuntu and running in as VM using vmplayer and I am trying to install vmware tools. After doing

./vmware-install.pl

and doing the default settings, it is now saying

The path "" is not a valid path to the 3.8.0-19-generic kernel headers. 
Would you like to cange it? [yes]

Enter the path to the kernel header files for the 3.8.0-19-generic kernel?

and when I did

whereis 3.8.0-19-generic kernel

it says

3.8:
kernel: /usr/src/linux-headers-3.8.0-30/kernel /usr/src/linux-headers-3.8.0-19/kernel  /usr/src/linux-headers-3.8.0-19-generic/kernel /usr/src/linux-headers-3.8.0-30-generic-kernel

I tried all four of them and none of the paths worked. It still said that the path is not a valid path to the 3.8.0-19-generic/kernel.

Note that before when I did

whereis 3.8.0-generic kernel

it only gave me the '-19' kernels, but then I did

sudo apt-get install linux-headers-$(uname -r)
sudo apt-get install linux-headers-generic

to see if it would fix anything but it didn't. It added the '-30' kernels but that didn't seem to fix the problems. Any ideas on what's wrong?

SilentDev
  • 20,997
  • 28
  • 111
  • 214

1 Answers1

14

Edit: Remember to read the comments of this question as other users provided more up-to-date and accurate solutions.

Okay so what I did was, when it said

The path "" is not a valid path to the 3.8.0-19-generic kernel headers. 
Would you like to cange it?

I typed in 'no', so then it stopped the install. I then wrote the

usr/bin/vmware-config-tools.pl

command again and it automatically, I think skipped the steps, and it said

The configuration of vmware tools 9.2.3 build-1031360 for linux for this running kernel  completed
successfully. you must restart your X session before any mouse or graphics cahnges can   take  effect.
you can now run vmware tools by invoking "/usr/bin/vmware-toolbox-cmd" from the command   line.
to enable X features (e.g., guest resolution fit, drag and drop, and file and text   copy/pase),
you will need to do one (or more) of the following:
1. manually start /usr/bin/vmware-user
2. log out and lokg back into your desktop sessionl and,
3. restart your X session

to use the vmxnet driver, restart networking using the following commands:
/etc/init.d/networking stop
rmmod pcnet32
rmmod vmxnet
modprobe vmxnet
/etc/init.d/networking start

If my VMware tools does not run properly, I will reply back in this post. Also, thanks to the person who voted this down without even replying or telling me why.

Okay I started using VMware, works good! I needed to set up a shared drive between my host OS and VM and I needed to run the

sudo vmware-config-tools.pl

again and in the prompts, it said the path '/usr/bin/gcc' appears valid, the path at 'lib/modules/3.8.0-30-generic/build/include' appears to be valid (if you read my post, if you guys did not do

sudo apt-get install linux-headers-$(uname -r)
sudo apt-get install linux-headers-generic

it probably will say 'lib/modules/3.8.0-19-generic/build/include' instead of 'lib/modules/3.8.0-30-generic/build/include'). If you have '-19' and not '-30' and if it DOESN'T work, try running the two commands above and see if it works.

SilentDev
  • 20,997
  • 28
  • 111
  • 214
  • 18
    A sound solution can be found [here](http://sharpbang.wordpress.com/2013/07/26/fixing-issue-with-missing-kernel-headers-when-installing-vmware-tools-in-linux-virtual-machine/): The reason is that in version 3.7 of the Linux kernel, the version.h file needed by the VMWare Tools installer has been relocated. As solution create a symbolic link to version.h at the location where VMWare Tools installer expects it: `$ ln -s /usr/src/linux-headers-$(uname -r)/include/generated/uapi/linux/version.h /usr/src/linux-headers-$(uname -r)/include/linux/version.h` – rexford Sep 23 '13 at 20:55
  • 1
    Thanks rexford! It worked nicely. Also thanks user2719875 for the question. – Chris Sep 30 '13 at 17:02
  • Thanks! and I also needed to do: http://superuser.com/a/588307/132381 – jpillora Oct 30 '13 at 09:44
  • 11
    the more accurate procedure is first to run: `sudo apt-get install build-essential` then `sudo apt-get install linux-headers-$(uname -r)` and only then: `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 that just re-run `sudo ./vmware-uninstall-tools.pl` and it should work. The reason by the way is version.h is no longer under [kernelsource_path]/include/linux/version.h, but [kernelsource_path]include/generated/uapi/linux/version.h –  Jan 01 '14 at 08:42
  • It may sound stupid but make sure you have the same kernel-devel version as your kernel. I did not have epel-release installed, and my kernel was a bit different from the kernel-devel. After making sure I had the exact same version - it had no problem installing. – Paul Jul 04 '16 at 11:32
  • I get the error message "failed to create symbolic link '/usr/src/linux-headers-3.16.0-4-amd64/include/linux/version.h': No such file or directory". The version of Debian running on my guest is "debian-8.7.1-amd64-netinst.iso". – posfan12 Apr 10 '17 at 03:29