6

I have Ubuntu 12.04.2 LTS installed on a VMware machine on Windows 7 host. I seem to have a problem with Kernel headers when trying to install them

I did:

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

and got this:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
gcc is already the newest version.
build-essential is already the newest version.
linux-headers-3.5.0-28-generic is already the newest version.
make is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 100 not upgraded.

However, when installing VMware tools I get the following error:

make[1]: Entering directory `/usr/src/linux-headers-3.5.0-28-generic'
  CC [M]  /tmp/vmware-root/modules/vmhgfs-only/backdoor.o
  CC [M]  /tmp/vmware-root/modules/vmhgfs-only/backdoorGcc32.o
  CC [M]  /tmp/vmware-root/modules/vmhgfs-only/bdhandler.o
  CC [M]  /tmp/vmware-root/modules/vmhgfs-only/cpName.o
  CC [M]  /tmp/vmware-root/modules/vmhgfs-only/cpNameLinux.o
  CC [M]  /tmp/vmware-root/modules/vmhgfs-only/cpNameLite.o
  CC [M]  /tmp/vmware-root/modules/vmhgfs-only/dentry.o
  CC [M]  /tmp/vmware-root/modules/vmhgfs-only/dir.o
  CC [M]  /tmp/vmware-root/modules/vmhgfs-only/file.o
/tmp/vmware-root/modules/vmhgfs-only/file.c:122:4: warning: initialization from incompatible pointer type [enabled by default]
/tmp/vmware-root/modules/vmhgfs-only/file.c:122:4: warning: (near initialization for ‘HgfsFileFileOperations.fsync’) [enabled by default]
  CC [M]  /tmp/vmware-root/modules/vmhgfs-only/filesystem.o
/tmp/vmware-root/modules/vmhgfs-only/filesystem.c:48:28: fatal error: linux/smp_lock.h: No such file or directory
compilation terminated.
make[2]: *** [/tmp/vmware-root/modules/vmhgfs-only/filesystem.o] Error 1
make[1]: *** [_module_/tmp/vmware-root/modules/vmhgfs-only] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.5.0-28-generic'
make: *** [vmhgfs.ko] Error 2
make: Leaving directory `/tmp/vmware-root/modules/vmhgfs-only'

Any help appreciated!

4 Answers 4

4

A voice from the future: I am compiling 5.9.0rc5. The source tree is exactly what came off linux.org. My platform: Ubuntu 20.04.1 (upgraded from 18.04.5 a week ago. No VmWare, just a pristinekernel tarball, and yet:

DKMS make.log for virtualbox-guest-6.1.10 for kernel 5.9.0-rc5 (x86_64)
Wed 16 Sep 2020 01:35:06 AM EDT
  CC [M]  /var/lib/dkms/virtualbox-guest/6.1.10/build/vboxguest/VBoxGuest-linux.o
  CC [M]  /var/lib/dkms/virtualbox-guest/6.1.10/build/vboxguest/VBoxGuest.o
  CC [M]  /var/lib/dkms/virtualbox-guest/6.1.10/build/vboxguest/common/string/strformatrt.o
  CC [M]  /var/lib/dkms/virtualbox-guest/6.1.10/build/vboxguest/combined-agnostic.o
In file included from /var/lib/dkms/virtualbox-guest/6.1.10/build/vboxguest/VBoxGuest-linux.c:36:
/var/lib/dkms/virtualbox-guest/6.1.10/build/vboxguest/r0drv/linux/the-linux-kernel.h:141:11: fatal error: linux/smp_lock.h: No such file or directory
  141 | # include <linux/smp_lock.h>
      |           ^~~~~~~~~~~~~~~~~~
compilation terminated.

The error is in TWO places;

/usr/src/virtualbox-guest-6.1.10/vboxsf/r0drv/linux
/usr/src/virtualbox-guest-6.1.10/vboxguest/r0drv/linux

Find the old, forgotten lineS, surround with #if 0 and #endif, run make install in the kernel source directory and be done. I put the changes into revision control, etc. but these steps are not vital.

Oh, the Copyright is Oracle now, updated to 2020, but the code is pure 2003.

1
  • Can you tell which exactly are these places and files to edit? I am not a kernel hacke, but as far as I digged into it now, it should not be just thefile "the-linux-kernel.h" that needs editing. Because compliling the virtualbox modules works with a standard ubuntu kernel, but not with a modified self-built kernel and it's headers, it must either be another file to be editet,or better a specific kernel feature be added, or?
    – Henning
    Nov 28, 2020 at 22:09
0

VMWare does not change their tools as fast as the kernel generators release them. Thus, in this case, you'll have to run without VMware tools installed until VMWare gets their act together and updates VMTools for the 3.5.0-28 kernel level.

I'd contact Vmware and complain and ask them for an ETA on the change.

It might be they already have a current VMtools update that is available but Vmcenter software might not have been updated yet. Thus you could also ask your sys administrator for VM infrastructure if the latest VMcenter has been installed.

0

I do not think is the kernel headers, since smp_lock.h is not present on my Ubuntu guest and I have linux-headers-3.2.0-45-generic on Ubuntu 12.04 and I was able to install the VMWare tools without problems.

I read here that smp_lock.h is not there since 2.6.39, so I think you have an old version of the VMware tools or an old version of VMWare Player or VMWare Workstation.

You can check here for more options: https://help.ubuntu.com/community/VMware/Tools

0

Fixed (for me). I had the same problem when installing Guest Additions on a new machine (Ubuntu 21.04). This was resolved by downloading the latest Virtual Box 6.1.26 (I was on 6.1.8). Running GAs_6.1.8 failed with missing smp_lock.h. Re-running GAs_6.1.26 cleaned out the old version and ran to completion without issue. It works fine now.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .