# LC_ALL=C ll /usr/src/linux-headers-5.10.0-3-amd64/.config -rw-r--r-- 1 root root 231K Feb 8 15:40 /usr/src/linux-headers-5.10.0-3-amd64/.config
Passing --config=... and correct -k ...: # LC_ALL=C dkms build -m virtualbox -v 6.1.18 -k 5.10.0-3-amd64 --kernelsourcedir=/usr/src/linux-headers-5.10.0-3-amd64 --config=/usr/src/linux-h eaders-5.10.0-3-amd64 Preparing kernel 5.10.0-3-amd64 for module build: (This is not compiling a kernel, just preparing kernel symbols) Storing current .config to be restored when complete Running Generic preparation routine make mrproper...(bad exit status: 2) using /usr/src/linux-headers-5.10.0-3-amd64 cp: -r not specified; omitting directory '/usr/src/linux-headers-5.10.0-3-amd64' make oldconfig...(bad exit status: 2) make prepare-all...(bad exit status: 2) Building module: cleaning build area... make -j4 KERNELRELEASE=5.10.0-3-amd64 -C /usr/src/linux-headers-5.10.0-3-amd64 M=/var/lib/dkms/virtualbox/6.1.18/build...(bad exit status: 2) Error! Bad return status for module build on kernel: 5.10.0-3-amd64 (x86_64) Consult /var/lib/dkms/virtualbox/6.1.18/build/make.log for more information. # cat /var/lib/dkms/virtualbox/6.1.18/build/make.log DKMS make.log for virtualbox-6.1.18 for kernel 5.10.0-3-amd64 (x86_64) Mon Feb 8 15:40:26 CET 2021 make: Entering directory '/usr/src/linux-headers-5.10.0-3-amd64' ERROR: Kernel configuration is invalid. include/generated/autoconf.h or include/config/auto.conf are missing. Run 'make oldconfig && make prepare' on kernel src to fix it. make[1]: *** [/usr/src/linux-headers-5.10.0-3-common/Makefile:717: include/config/auto.conf] Fehler 1 make: *** [/usr/src/linux-headers-5.10.0-3-common/Makefile:185: __sub-make] Error 2 make: Leaving directory '/usr/src/linux-headers-5.10.0-3-amd64' [ EDIT: /usr/src/linux-headers-5.10.0-3-common/Makefile ] 711 # External modules and some install targets need include/generated/autoconf.h 712 # and include/config/auto.conf but do not care if they are up-to-date. 713 # Use auto.conf to trigger the test 714 PHONY += include/config/auto.conf 715 716 include/config/auto.conf: 717 $(Q)test -e include/generated/autoconf.h -a -e $@ || ( \ 718 echo >&2; \ 719 echo >&2 " ERROR: Kernel configuration is invalid."; \ 720 echo >&2 " include/generated/autoconf.h or $@ are missing.";\ 721 echo >&2 " Run 'make oldconfig && make prepare' on kernel src to fix it."; \ 722 echo >&2 ; \ 723 /bin/false) Searching for include/generated/autoconf.h file: # LC_ALL=C ll /usr/src/linux-headers-5.10.0-3-amd64/Makefile /usr/src/linux-headers-5.10.0-3-amd64/include/generated/ -rw-r--r-- 1 root root 56 Feb 6 09:23 /usr/src/linux-headers-5.10.0-3-amd64/Makefile /usr/src/linux-headers-5.10.0-3-amd64/include/generated/: total 40K drwxr-xr-x 3 root root 4.0K Feb 8 15:15 . drwxr-xr-x 4 root root 4.0K Jan 31 17:36 .. -rw-r--r-- 1 root root 4.7K Feb 6 09:23 asm-offsets.h -rw-r--r-- 1 root root 318 Feb 6 09:23 bounds.h -rw-r--r-- 1 root root 337 Feb 6 09:23 compile.h -rw-r--r-- 1 root root 45 Feb 6 09:23 package.h -rw-r--r-- 1 root root 1.1K Feb 6 09:23 timeconst.h drwxr-xr-x 3 root root 4.0K Jan 31 17:36 uapi -rw-r--r-- 1 root root 37 Feb 6 09:23 utsrelease.h Such an include/generated/autoconf.h is missing in linux-headers-5.10.0-3-amd64 package. NOPE: # find /usr/src/linux-headers-5.10.0-3-common -name autoconf.h # find /usr/src/linux-headers-5.10.0-3-amd64 -name autoconf.h - Sedat -