0

Trying to build vmware tools for 32 bit Centos 7. Got error during ./configure:

Can't find include dir under /lib/modules/3.10.0-693.2.2.el7.centos.plus.i686

I suppose I should install some rpm's in order to get this directory? I even found I need kernel-plus-3.10.0-693.2.2.el7.centos.plus.src.rpm. But I also suppose that it is only part of other more general package and I will need to install many more RPM's.

What logic I should follow in order to know what to install when I get such error? What is that package in my case?

UPDATE #1

$ gcc --version
...4.8.5 20150323

$ cat /proc/version
Linux version 3,10,0 ...
gcc version 4.8.5 20150323

command

$ sudo yum install kernel-devel
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Package kernel-devel-3.10.0-693.21.1.el7.centos.plus.i686 already installed and latest version
Nothing to do

command

$ ls /lib/modules/3.10.0-693.2.2.el7.centos.plus.i686/
build              modules.builtin      modules.modesetting  source
extra              modules.builtin.bin  modules.networking   updates
kernel             modules.dep          modules.order        weak-updates
modules.alias      modules.dep.bin      modules.softdep
modules.alias.bin  modules.devname      modules.symbols
modules.block      modules.drm          modules.symbols.bin
  • You seem to have clipped off the important information from /proc/version, namely the release number for the kernel you are using (output from uname-r would also show the kernel release). An issue I see is that you are referencing different release versions in your post: 3.10.0-693.2.2.el7.centos.plus.i686 != 3.10.0-693.21.1.el7.centos.plus.i686. These packages related to the kernel are strictly dependent on the release version of the running kernel, they must match exactly. – GracefulRestart Apr 7 '18 at 1:30
0

You shouldn't install packages with .src.rpm suffix. Packages with this suffix needed for building RPM packages on own system.

VMware tools (also VBox tools) builds modules for your kernel. So it needs tools: compiler, kernel headers and build environment (Makefiles with specific predefined macros and couple of scripts).

Compiler provides by gcc-<version> package. You should ensure that you compiler version of running kernel (cat /proc/version => gcc version) and installed compiler package gcc-<version> are equal.

In Centos 7 kernel-devel-$(uname -r) package provides kernel headers with build environment.

Thats all you need to build VMware tools (or VBox tools).


UPD:

About open-vm-tools in Centos 7 and building it Centos 7. Centos 7 already have open-vm-tools in repository. It contains 2 systemd services (vgauthd and vmtoolsd), vmware-<something> programs and documentation.

I downloaded open-vm-tools (yumdownloader --source open-vm-tools) to see in spec file how it builds. In %build macro contains this instructions:

%configure \
    --without-kernel-modules \
    --enable-xmlsec1 \
    --disable-static

So package exactly doesn't provide modules. Where is modules? In github open-vm-tools README.md wrote:

The open-vm-tools packages available with Linux distributions do not include Linux drivers because Linux drivers are available as part of Linux kernel itself.

It's true. I checked it in my Centos 7 (x86_64):

find /lib/modules/$(uname -r) -name 'vm*'
/lib/modules/3.10.0-693.21.1.el7.x86_64/kernel/crypto/vmac.ko.xz
/lib/modules/3.10.0-693.21.1.el7.x86_64/kernel/drivers/gpu/drm/vmwgfx
/lib/modules/3.10.0-693.21.1.el7.x86_64/kernel/drivers/gpu/drm/vmwgfx/vmwgfx.ko.xz
/lib/modules/3.10.0-693.21.1.el7.x86_64/kernel/drivers/misc/vmw_balloon.ko.xz
/lib/modules/3.10.0-693.21.1.el7.x86_64/kernel/drivers/misc/vmw_vmci
/lib/modules/3.10.0-693.21.1.el7.x86_64/kernel/drivers/misc/vmw_vmci/vmw_vmci.ko.xz
/lib/modules/3.10.0-693.21.1.el7.x86_64/kernel/drivers/net/vmxnet3
/lib/modules/3.10.0-693.21.1.el7.x86_64/kernel/drivers/net/vmxnet3/vmxnet3.ko.xz
/lib/modules/3.10.0-693.21.1.el7.x86_64/kernel/drivers/scsi/vmw_pvscsi.ko.xz
/lib/modules/3.10.0-693.21.1.el7.x86_64/kernel/net/vmw_vsock
/lib/modules/3.10.0-693.21.1.el7.x86_64/kernel/net/vmw_vsock/vmw_vsock_virtio_transport.ko.xz
/lib/modules/3.10.0-693.21.1.el7.x86_64/kernel/net/vmw_vsock/vmw_vsock_virtio_transport_common.ko.xz
/lib/modules/3.10.0-693.21.1.el7.x86_64/kernel/net/vmw_vsock/vmw_vsock_vmci_transport.ko.xz

I downloaded your kernel version (3.10.0-693.2.2.el7.centos.plus.i686) and examine it content:

$ ls kernel-3.10.0-693.2.2.el7.centos.plus.i686.rpm
kernel-3.10.0-693.2.2.el7.centos.plus.i686.rpm
$ rpm2cpio kernel-3.10.0-693.2.2.el7.centos.plus.i686.rpm | cpio -idm # content will be extracted to boot and lib directories in this directory
$ find ./lib/ -name 'vm*'
./lib/modules/3.10.0-693.2.2.el7.centos.plus.i686/kernel/crypto/vmac.ko
./lib/modules/3.10.0-693.2.2.el7.centos.plus.i686/kernel/drivers/gpu/drm/vmwgfx
./lib/modules/3.10.0-693.2.2.el7.centos.plus.i686/kernel/drivers/gpu/drm/vmwgfx/vmwgfx.ko
./lib/modules/3.10.0-693.2.2.el7.centos.plus.i686/kernel/drivers/misc/vmw_balloon.ko
./lib/modules/3.10.0-693.2.2.el7.centos.plus.i686/kernel/drivers/misc/vmw_vmci
./lib/modules/3.10.0-693.2.2.el7.centos.plus.i686/kernel/drivers/misc/vmw_vmci/vmw_vmci.ko
./lib/modules/3.10.0-693.2.2.el7.centos.plus.i686/kernel/drivers/net/vmxnet3
./lib/modules/3.10.0-693.2.2.el7.centos.plus.i686/kernel/drivers/net/vmxnet3/vmxnet3.ko
./lib/modules/3.10.0-693.2.2.el7.centos.plus.i686/kernel/drivers/scsi/vmw_pvscsi.ko
./lib/modules/3.10.0-693.2.2.el7.centos.plus.i686/kernel/net/vmw_vsock
./lib/modules/3.10.0-693.2.2.el7.centos.plus.i686/kernel/net/vmw_vsock/vmw_vsock_virtio_transport.ko
./lib/modules/3.10.0-693.2.2.el7.centos.plus.i686/kernel/net/vmw_vsock/vmw_vsock_virtio_transport_common.ko
./lib/modules/3.10.0-693.2.2.el7.centos.plus.i686/kernel/net/vmw_vsock/vmw_vsock_vmci_transport.ko

So. Modules and tools provides by repository. You can rebuid tools but with --without-kernel-modules. If you want to rebuild modules (I doubt that is need) you should rebuild kernel package. Detail instruction present in Centos Wiki.


UPD2:

Services setup. After successfully compiled tools were installed it's necessary to create 2 service files in /usr/lib/systemd/system with following content:

vmtoolsd.service:

[Unit]
Description=Service for virtual machines hosted on VMware
Documentation=http://github.com/vmware/open-vm-tools
ConditionVirtualization=vmware
Requires=vgauthd.service
After=vgauthd.service

[Service]
ExecStart=/usr/local/bin/vmtoolsd
TimeoutStopSec=5
PrivateTmp=true

[Install]
WantedBy=multi-user.target
Also=vgauthd.service

vgauthd.service:

[Unit]
Description=VGAuth Service for open-vm-tools
Documentation=http://github.com/vmware/open-vm-tools
ConditionVirtualization=vmware
PartOf=vmtoolsd.service

[Service]
ExecStart=/usr/local/bin/VGAuthService -s
TimeoutStopSec=5
PrivateTmp=true

[Install]
RequiredBy=vmtoolsd.service

When they are will be created, you need reload modules dependencies with systemctd daemon-reload. After, you will can start services by calling systemctl start vmtoolsd or systemctl start vgauthd.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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