What is the path to the kernel headers so I can install vmware?

328

Solution 1

cd /lib/modules/$(uname -r)/build/include/linux
sudo ln -s ../generated/utsrelease.h
sudo ln -s ../generated/autoconf.h
sudo ln -s ../generated/uapi/linux/version.h 

After adding the symlink, the path is /usr/src/linux-headers-$(uname -r)/include (Thanks @Kariem!)

Solution 2

Below commands are very helpful for you:

Step 1 : Ctrl + Alt + T

Step 2 : sudo apt-get install linux-headers-$(uname -r)

Step 3 : The path to the kernel headers is then /usr/src/linux-headers-$(uname -r)/include

Solution 3

Before installing Vmware Workstation you need to install build-essential and linux headers

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

and 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

Done thats it, install Vmware Workstation now

 path to vm# sh Vm***.bundle

Solution 4

There are a few files in locations that the installer doesn't expect, I run this and it works:

ifrantz@ifrantz:~$ cat ~/update_version.sh 
#!/bin/bash

cd /lib/modules/$(uname -r)/build/include/linux
sudo ln -s ../generated/utsrelease.h
sudo ln -s ../generated/autoconf.h
sudo ln -s ../generated/uapi/linux/version.h 

Solution 5

My first guess is that you haven't installed the headers. You need to install the appropriate linux-headers package. Most likely, you need to install linux-headers-generic. However, if if you're running some kernel other than linux-generic, install the linux-headers package for that kernel.

If you've already installed the headers, they should be in /usr/src.

Share:
328

Related videos on Youtube

lionfly
Author by

lionfly

Updated on September 18, 2022

Comments

  • lionfly
    lionfly almost 2 years

    I use Twitter-OAuth-iPhone to POST tweets by [_engine sendUpdate:myText];, which works fine. However, the letter & in the 'myText' will be changed to & in the tweet shown on Twitter.com. The & is for coordinates link: @"http://maps.google.co.uk/maps?f=q&source=s_q&hl=en&geocode=&q=%f,+%f".

    I tried to replace the & with %%26 in the 'myText', which turns out with %26 in the tweet instead of &; and when I replace with %26, the app crash.

    What code should I use to get & (not &) in the tweet?

    • kennytm
      kennytm over 13 years
      Crash? I guess it's a bug of the library.
    • crasic
      crasic about 13 years
      Which Kernel are you using (check with uname -a). Because with the 11.04 upgrade ubuntu silently switched my kernel from linux-generic to linux-generic-pae without installing the relevant headers, which uses a different set of linux headers. As per the three responses below, using apt-get is the proper way to solve the issue, you just have to make sure the kernel headers are the right ones.
    • Admin
      Admin about 13 years
      Zhe seems to be on the right track, but still something missing. Creating those links helps to get past the prompt for the 2.6.38.8_generic kernel headers, but then when I run VMWare Workstation (6.5.5) I get an error saying "Unable to build kernel modules. See logfile /tmp/vmware-root/setup-22414.log", and when I look in the log file it just describes the build attempt, but shows no errors, which is weird. So I tried to go the short route and reinstall from the bundle to see if doing that after creating the links solved the problem. It did not. I'm stuck. Any ideas? I thought that combining t
    • Qasim
      Qasim about 11 years
      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
    • Qasim
      Qasim about 11 years
      sudo apt-get install build-essential
  • lionfly
    lionfly over 13 years
    Hi josh thanks, but the code does not get & in the tweet as well. How should I use URL shortener in the code?
  • joshpaul
    joshpaul over 13 years
    You should be able to call out to any of the url shorteners with the url you need to post to twitter, get back a "clean" url, and then post that. See this SO thread for implementation details: stackoverflow.com/questions/2252470/…
  • Wazery
    Wazery about 13 years
    Can you provide me with the name of these headers packages?
  • Wazery
    Wazery about 13 years
    linux-headers-generic is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
  • Scott Severance
    Scott Severance about 13 years
    I'm not sure exactly what you're asking. You can search in Synaptic to find out what you're running on your machine. Most likely, your kernel is linux-generic. If so, install linux-headers-generic, which will pull in the proper packages as dependencies. The exact headers package (and paths in the filesystem) change with each kernel update. Look on your system to find out which is in use.
  • Jason Mock
    Jason Mock about 11 years
    FYI, I had to do these exact steps to get VMWare Workstation working with Ubuntu 13.04.
  • Mike
    Mike about 11 years
    sudo apt-get install build-essential linux-headers-$(uname -r) worked wonder. Fixed my problem, thx.
  • fixxxer
    fixxxer about 11 years
    Thank you! Just to be clear, as I did not read that from the answer: after adding the symlink, the path is /usr/src/linux-headers-$(uname -r)/include
  • youcefb
    youcefb about 11 years
    Worked on 13.04
  • Mark E. Haase
    Mark E. Haase about 11 years
    +1 I was missing build-essentials. This is the best answer here.
  • Griwes
    Griwes about 11 years
    The fact you need those is retarded - much thanks for this.
  • amateur barista
    amateur barista almost 11 years
    Zhe's answer + Kariem's comment are invaluable. This solved the "Unable to update runtime folder sharing status: There was an error mounting Shared Folders file system inside the guest operating system." error for me in Ubuntu 13.04.
  • Travis Bear
    Travis Bear almost 11 years
    I used this answer to get VMWare tools running in Linux Mint 15 as well.
  • pepoluan
    pepoluan almost 11 years
    This works! Thank you. My question is: How did you find out what exactly to do?
  • Zhe Li
    Zhe Li over 10 years
    @pepoluan some forum posts, read the source code and hundreds of tries :)
  • Mikey T.K.
    Mikey T.K. almost 10 years
    This is STILL a problem as of 14.04. Amazing.
  • JW.
    JW. almost 10 years
    If you try the solution in this answer and are getting 'No such file or directory' errors after attempting to 'cd', then @manikandan's answer below helps. After installing the headers, that directory should exist. See: askubuntu.com/a/65314/28555
  • Kayla
    Kayla over 8 years
    This answer worked on my machine, Debian 8.3 i386
  • dmohr
    dmohr over 6 years
    when facing this issue on centos 7 (I know, this is an ubuntu site, but google brought me here and it was helpful), I had to yum install kernel-devel first, then complete the steps outlined by Zhe, then the include dir was found in /usr/src/kernels/$(uname -r)/include.
  • Owl
    Owl over 5 years
    apt-get install linux-headers-$(uname -r)
  • Scott Severance
    Scott Severance over 5 years
    @owl, The problem with that is you'll have to reinstall the headers every time the version changes. If you install the basic linux-headers package, it's always up to date.
  • Vanni Totaro
    Vanni Totaro over 5 years
    Maybe you need to do a sudo apt-get update before the install
  • DARKGuy
    DARKGuy almost 4 years
    This one plus the build-essentials suggestion from answers above fixed my problem. Thanks!
  • mhucka
    mhucka over 3 years
    Encountered similar problem trying to install VMware tools in an old ESXi vSphere 5.x system and CentOS 7.9. Same solution. Mentioning it here in case others are struggling with a similar combination.