Unable to find the sources of current Linux kernel Fedora 26

Discussions related to using VirtualBox on Linux hosts.
Post Reply
Stanislavcik
Posts: 4
Joined: 27. Mar 2018, 13:19

Unable to find the sources of current Linux kernel Fedora 26

Post by Stanislavcik »

Hello!

I'm trying to start a virtual machine and get errors: the kernel driver is not installed (rc = -1908)

Code: Select all

[root@netbook virtualbox]# head /var/log/vbox-install.log
Makefile:187: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again.  Stop.
Makefile:187: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again.  Останов.
Makefile:187: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again.  Останов.
Makefile:187: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again.  Останов.
Makefile:187: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again.  Останов.
Makefile:187: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again.  Останов.
Makefile:187: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again.  Останов.
make KBUILD_VERBOSE=1 SUBDIRS=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 CONFIG_MODULE_SIG= -C /usr/src/kernels/4.13.4-200.fc26.x86_64 -j4 modules
make[1]: предупреждение: в суб-Makefile принудительно задан -jN; режим сервера заданий запрещён
Makefile:940: "Cannot use CONFIG_STACK_VALIDATION, please install libelf-dev, libelf-devel or elfutils-libelf-devel"
[root@netbook virtualbox]# 

[root@netbook virtualbox]# rpm -qa gcc kernel\* dkms make bzip2 perl |sort -V
bzip2-1.0.6-22.fc26.x86_64
dkms-2.5.0-2.20180306gitb1b9033.fc26.noarch
gcc-7.3.1-2.fc26.x86_64
kernel-4.13.9-200.fc26.x86_64
kernel-4.13.11-200.fc26.x86_64
kernel-4.15.10-200.fc26.x86_64
kernel-core-4.13.9-200.fc26.x86_64
kernel-core-4.13.11-200.fc26.x86_64
kernel-core-4.15.10-200.fc26.x86_64
kernel-cross-headers-4.15.10-200.fc26.x86_64
kernel-debug-devel-4.13.11-200.fc26.x86_64
kernel-debug-devel-4.15.10-200.fc26.x86_64
kernel-devel-4.13.11-200.fc26.x86_64
kernel-devel-4.15.10-200.fc26.x86_64
kernel-headers-4.15.10-200.fc26.x86_64
kernel-modules-4.13.9-200.fc26.x86_64
kernel-modules-4.13.11-200.fc26.x86_64
kernel-modules-4.15.10-200.fc26.x86_64
kernel-modules-extra-4.13.9-200.fc26.x86_64
kernel-modules-extra-4.13.11-200.fc26.x86_64
kernel-modules-extra-4.15.10-200.fc26.x86_64
kernel-tools-4.15.0-200.fc26.x86_64
kernel-tools-libs-4.15.0-200.fc26.x86_64
kernel-tools-libs-devel-4.15.0-200.fc26.x86_64
make-4.2.1-2.fc26.x86_64
perl-5.24.3-396.fc26.x86_64


[root@netbook virtualbox]# uname -a
Linux netbook.local 4.15.10-200.fc26.x86_64 #1 SMP Thu Mar 15 17:14:41 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
[root@netbook virtualbox]# 
How to solve?
Last edited by socratis on 10. Apr 2018, 16:53, edited 1 time in total.
Reason: Enclosed the information in [code] tag for better readability
Martin
Volunteer
Posts: 2561
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: PUEL
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: Unable to find the sources of current Linux kernel Fedora 26

Post by Martin »

The last line in the log tells you what to do: "please install ..."
Stanislavcik
Posts: 4
Joined: 27. Mar 2018, 13:19

Re: Unable to find the sources of current Linux kernel Fedora 26

Post by Stanislavcik »

Martin wrote:The last line in the log tells you what to do: "please install ..."

Code: Select all

   ./tools/objtool/objtool orc generate  --module --no-fp  --retpoline "/tmp/vbox.0/r0drv/generic/semspinmutex-r0drv-generic.o";
/tmp/vbox.0/r0drv/linux/timer-r0drv-linux.c: В функции «VBoxHost_RTTimerCreateEx»:
/tmp/vbox.0/r0drv/linux/timer-r0drv-linux.c:1588:13: ошибка: implicit declaration of function «init_timer_pinned»; did you mean «init_timer_key»? [-Werror=implicit-function-declaration]
             init_timer_pinned(&pTimer->aSubTimers[iCpu].u.Std.LnxTimer);
             ^~~~~~~~~~~~~~~~~
             init_timer_key
/tmp/vbox.0/r0drv/linux/timer-r0drv-linux.c:1592:52: ошибка: «struct timer_list» не содержит элемента с именем «data»
             pTimer->aSubTimers[iCpu].u.Std.LnxTimer.data        = (unsigned long)&pTimer->aSubTimers[iCpu];
                                                    ^
/tmp/vbox.0/r0drv/linux/timer-r0drv-linux.c:1593:65: ошибка: несовместимый тип указателя в присваивании [-Werror=incompatible-pointer-types]
             pTimer->aSubTimers[iCpu].u.Std.LnxTimer.function    = rtTimerLinuxStdCallback;
                                                                 ^
  if [ "-pg" = "-pg" ]; then if [ /tmp/vbox.0/r0drv/generic/semspinmutex-r0drv-generic.o != "scripts/mod/empty.o" ]; then ./scripts/recordmcount  "/tmp/vbox.0/r0drv/generic/semspinmutex-r0drv-generic.o"; fi; fi;
cc1: некоторые предупреждения считаются ошибками
  gcc -Wp,-MD,/tmp/vbox.0/common/checksum/.ipv4.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/7/include -I./arch/x86/include -I./arch/x86/include/generated  -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-PIE -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_SSSE3=1 -DCONFIG_AS_CRC32=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -DCONFIG_AS_AVX512=1 -DCONFIG_AS_SHA1_NI=1 -DCONFIG_AS_SHA256_NI=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -DRETPOLINE -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-int-in-bool-context -O2 --param=allow-store-data-races=0 -DCC_HAVE_ASM_GOTO -Wframe-larger-than=2048 -fstack-protector-strong -Wno-unused-but-set-variable -Wno-unused-const-variable -fvar-tracking-assignments -g -pg -mfentry -DCC_USING_FENTRY -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fno-stack-check -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -include /tmp/vbox.0/include/VBox/SUPDrvMangling.h -I/lib/modules/4.15.10-200.fc26.x86_64/build/include -I/tmp/vbox.0/ -I/tmp/vbox.0/include -I/tmp/vbox.0/r0drv/linux -I/tmp/vbox.0/vboxdrv/ -I/tmp/vbox.0/vboxdrv/include -I/tmp/vbox.0/vboxdrv/r0drv/linux -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -DVBOX_WITH_HARDENING -DSUPDRV_WITH_RELEASE_LOGGER -Wno-declaration-after-statement -DCONFIG_VBOXDRV_AS_MISC -DRT_ARCH_AMD64 -DVBOX_WITH_64_BITS_GUESTS -fno-omit-frame-pointer -fno-pie  -DMODULE  -DKBUILD_BASENAME='"ipv4"'  -DKBUILD_MODNAME='"vboxdrv"' -c -o /tmp/vbox.0/common/checksum/ipv4.o /tmp/vbox.0/common/checksum/ipv4.c
make[2]: *** [scripts/Makefile.build:325: /tmp/vbox.0/r0drv/linux/timer-r0drv-linux.o] Ошибка 1
make[2]: *** Ожидание завершения заданий…
   ./tools/objtool/objtool orc generate  --module --no-fp  --retpoline "/tmp/vbox.0/common/alloc/alloc.o";
  if [ "-pg" = "-pg" ]; then if [ /tmp/vbox.0/common/alloc/alloc.o != "scripts/mod/empty.o" ]; then ./scripts/recordmcount  "/tmp/vbox.0/common/alloc/alloc.o"; fi; fi;
   ./tools/objtool/objtool orc generate  --module --no-fp  --retpoline "/tmp/vbox.0/common/checksum/crc32.o";
  if [ "-pg" = "-pg" ]; then if [ /tmp/vbox.0/common/checksum/crc32.o != "scripts/mod/empty.o" ]; then ./scripts/recordmcount  "/tmp/vbox.0/common/checksum/crc32.o"; fi; fi;
   ./tools/objtool/objtool orc generate  --module --no-fp  --retpoline "/tmp/vbox.0/common/checksum/ipv4.o";
  if [ "-pg" = "-pg" ]; then if [ /tmp/vbox.0/common/checksum/ipv4.o != "scripts/mod/empty.o" ]; then ./scripts/recordmcount  "/tmp/vbox.0/common/checksum/ipv4.o"; fi; fi;
make[1]: *** [Makefile:1518: _module_/tmp/vbox.0] Ошибка 2
make: *** [Makefile:305: vboxdrv] Ошибка 2
What should I install?
erdeslawe
Volunteer
Posts: 241
Joined: 8. Jul 2015, 10:23

Re: Unable to find the sources of current Linux kernel Fedora 26

Post by erdeslawe »

From your original post:

Makefile:940: "Cannot use CONFIG_STACK_VALIDATION, please install libelf-dev, libelf-devel or elfutils-libelf-devel"
Stanislavcik
Posts: 4
Joined: 27. Mar 2018, 13:19

Re: Unable to find the sources of current Linux kernel Fedora 26

Post by Stanislavcik »

erdeslawe wrote:From your original post:

Makefile:940: "Cannot use CONFIG_STACK_VALIDATION, please install libelf-dev, libelf-devel or elfutils-libelf-devel"

Code: Select all

[root@netbook ~]# rpm -qa | grep libelf
elfutils-libelf-devel-static-0.170-4.fc26.x86_64
elfutils-libelf-devel-0.170-4.fc26.x86_64
elfutils-libelf-0.170-4.fc26.x86_64
[root@netbook ~]# 
The packages are already installed
Stanislavcik
Posts: 4
Joined: 27. Mar 2018, 13:19

Re: Unable to find the sources of current Linux kernel Fedora 26

Post by Stanislavcik »

Installed a new package VirtualBox-5.2-5.2.8_121009_fedora25-1.x86_64.rpm and it all worked. Thank you.
Post Reply