Page 1 of 1

This system is currently not set up to build kernel modules

Posted: 12. Nov 2020, 15:00
by newbsftw
Hello.

I removed VirtualBox 6.0 to install 6.1 but now I'm getting the following error:

Code: Select all

vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
This system is currently not set up to build kernel modules.
Please install the gcc make perl packages from your distribution.
This system is currently not set up to build kernel modules.
Please install the gcc make perl packages from your distribution.

There were problems setting up VirtualBox.  To re-start the set-up process, run
  /sbin/vboxconfig
as root.  If your system is using EFI Secure Boot you may need to sign the
kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load
them. Please see your Linux system's documentation for more information.
I think I have everything needed for installation:
sudo apt-get install build-essential gcc make perl dkms
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version (12.4ubuntu1).
make is already the newest version (4.1-9.1ubuntu1).
dkms is already the newest version (2.3-3ubuntu9.7).
gcc is already the newest version (4:7.4.0-1ubuntu2.3).
perl is already the newest version (5.26.1-6ubuntu0.5).
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.

Code: Select all

apt install linux-headers-$(uname -r)
Reading package lists... Done
Building dependency tree       
Reading state information... Done
linux-headers-5.4.0-53-generic is already the newest version (5.4.0-53.59~18.04.1).
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
I have LinuxMint 19.3 (based on Ubuntu bionic):

Code: Select all

dpkg -l *virtualbox*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                                  Version                         Architecture                    Description
+++-=====================================================-===============================-===============================-================================================================================================================
un  virtualbox                                            <none>                          <none>                          (no description available)
ii  virtualbox-6.1                                        6.1.16-140961~Ubuntu~bionic     amd64                           Oracle VM VirtualBox
un  virtualbox-guest-additions-iso                        <none>                          <none>                          (no description available)
un  virtualbox-guest-dkms                                 <none>                          <none>                          (no description available)
un  virtualbox-guest-modules                              <none>                          <none>                          (no description available)
un  virtualbox-ose                                        <none>                          <none>                          (no description available)
un  virtualbox-qt                                         <none>                          <none>                          (no description available)
But nothing is solving the issue. Can someone help?

Many thanks

Re: This system is currently not set up to build kernel modules

Posted: 13. Nov 2020, 12:43
by newbsftw
I have booted to kernel 4.15.0-123 but the outcome is the same.

I have Secure Boot disabled.

While trying to run vboxconfig with flags, it fails:

Code: Select all

sudo /sbin/vboxconfig -h
Bad argument -h
I'm at a loss here, don't know what else should do to troubleshoot this. Maybe trying to revert to the older vbox 6.0 ?

Re: This system is currently not set up to build kernel modules

Posted: 9. Dec 2020, 14:04
by newbsftw
Finally solved this. I debug vboxconfig with

Code: Select all

sudo sh -x /sbin/vboxconfig
that pointed to vboxdrv.sh:

Code: Select all

sudo sh -x /usr/lib/virtualbox/vboxdrv.sh setup
which pinted to gcc not existing:

Code: Select all

arch/x86/Makefile:147: CONFIG_X86_X32 enabled but no binutils support
make[1]: gcc: Command not found
test -e include/generated/autoconf.h -a -e include/config/auto.conf || (		\
echo >&2;							\
echo >&2 "  ERROR: Kernel configuration is invalid.";		\
echo >&2 "         include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo >&2 "         Run 'make oldconfig && make prepare' on kernel src to fix it.";	\
echo >&2 ;							\
/bin/false)
make -f ./scripts/Makefile.build obj=/tmp/vbox.0 \
although debsums didn't complained about it, I reinstalled gcc and it's now working.

Code: Select all

sudo apt-get install --reinstall gcc

Re: This system is currently not set up to build kernel modules

Posted: 13. Dec 2020, 16:35
by scottgus1
Glad you got things running!

Virtualbox on Linux needs some prerequisites installed. See https://www.virtualbox.org/manual/ch02. ... nux-prereq. The same applies inside Linux VMs, when you install Guest Additions.