CentOS 7, Kernel 5.12, Not start Virtual Machine

Discussions related to using VirtualBox on Linux hosts.
Post Reply
a_subscriber
Posts: 18
Joined: 26. Jul 2021, 15:33

CentOS 7, Kernel 5.12, Not start Virtual Machine

Post by a_subscriber »

CentOS 7, Kernel 5.12, Virtual Box 6.1 + extension pack

I create virtual machine - Windows 10 Enterprise. But when I click Start on Virtual box I get error:

Failed to open a session for the virtual machine Windows 10 Enterprise.

The virtual machine 'Windows 10 Enterprise' has terminated unexpectedly during startup with exit code 1 (0x1).

Result Code: NS_ERROR_FAILURE (0x80004005)
Component: MachineWrap
Interface: IMachine {85632c68-b5bb-4316-a900-5eb28d3413df}



and another error:
Kernel driver not installed (rc=-1908)

The VirtualBox Linux kernel driver is either not loaded or not set up correctly. Please try setting it up again by executing

'/sbin/vboxconfig'

as root.

If your system has EFI Secure Boot enabled you may also 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.

where: suplibOsInit what: 3 VERR_VM_DRIVER_NOT_INSTALLED (-1908) - The support driver is not installed. On linux, open returned ENOENT.
Last edited by a_subscriber on 26. Jul 2021, 15:37, edited 2 times in total.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: CentOS 7, Kernel 5.12, Not start Virtual Machine 6.1

Post by scottgus1 »

Virtualbox on Linux has prerequisites, see https://www.virtualbox.org/manual/ch02. ... nux-prereq

Do the prereqs, then reinstall Virtualbox.
a_subscriber
Posts: 18
Joined: 26. Jul 2021, 15:33

Re: CentOS 7, Kernel 5.12, Not start Virtual Machine

Post by a_subscriber »

uname -r

5.12.8-1.el7.elrepo.x86_64

I try to update kernel headers but get error:

sudo yum -y install kernel*devel kernel*headers

Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile

Resolving Dependencies
--> Running transaction check
---> Package kernel-debug-devel.x86_64 0:3.10.0-1160.36.2.el7 will be installed
---> Package kernel-devel.x86_64 0:3.10.0-1160.36.2.el7 will be installed
---> Package kernel-headers.x86_64 0:3.10.0-1160.36.2.el7 will be installed
---> Package kernel-tools-libs-devel.x86_64 0:3.10.0-1160.36.2.el7 will be installed
--> Processing Conflict: kernel-ml-headers-5.12.8-1.el7.elrepo.x86_64 conflicts kernel-headers < 5.12.8-1.el7.elrepo
--> Finished Dependency Resolution
Error: kernel-ml-headers conflicts with kernel-headers-3.10.0-1160.36.2.el7.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
Martin
Volunteer
Posts: 2560
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: PUEL
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: CentOS 7, Kernel 5.12, Not start Virtual Machine

Post by Martin »

The wildcards in your yum command grab too many packages. You only need the devel and header packages for your specific kernel, not for other kernel variants.
a_subscriber
Posts: 18
Joined: 26. Jul 2021, 15:33

Re: CentOS 7, Kernel 5.12, Not start Virtual Machine

Post by a_subscriber »

I success run this

Code: Select all

1. sudo yum -y groupinstall "Development Tools"
2. sudo yum -y install kernel*devel kernel*headers
3. sudo yum -y install dkms
4. sudo wget url_to_vbox -P /etc/yum.repos.d
5. sudo yum -y install VirtualBox-6.1

But it not help. The virtual machine can't run. Same error

I try this:

Code: Select all

sudo /sbin/vboxconfig
But get error:

vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
vboxdrv.sh: failed: Look at /var/log/vbox-setup.log to find out what went wrong.

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.


And in the vbox-setup.log :

Building the main VirtualBox module.
Error building the module:
make V=1 CONFIG_MODULE_SIG= CONFIG_MODULE_SIG_ALL= -C /lib/modules/5.12.8-1.el7.elrepo.x86_64/build M=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 -j12 modules
make[1]: warning: -jN forced in submake: disabling jobserver mode.
make -C /usr/src/kernels/5.12.8-1.el7.elrepo.x86_64 -f /usr/src/kernels/5.12.8-1.el7.elrepo.x86_64/Makefile modules
make -f ./scripts/Makefile.build obj=/tmp/vbox.0 \
single-build= \
need-builtin=1 need-modorder=1
gcc -Wp,-MMD,/tmp/vbox.0/linux/.SUPDrv-linux.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.8.5/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/compiler-version.h -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Wno-format-security -std=gnu89 -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 -mtune=generic -mno-red-zone -mcmodel=kernel -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -fno-jump-tables -fno-delete-null-pointer-checks -O2 --param=allow-store-data-races=0 -Wframe-larger-than=2048 -fstack-protector-strong -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -pg -mrecord-mcount -mfentry -DCC_USING_FENTRY -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -fno-strict-overflow -fno-stack-check -Werror=date-time -include /tmp/vbox.0/include/VBox/SUPDrvMangling.h -fno-omit-frame-pointer -fno-pie -Wno-declaration-after-statement -I./include -I/tmp/vbox.0/ -I/tmp/vbox.0/include -I/tmp/vbox.0/r0drv/linux -D__KERNEL__ -DMODULE -DRT_WITHOUT_PRAGMA_ONCE -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -DVBOX_WITH_HARDENING -DSUPDRV_WITH_RELEASE_LOGGER -DVBOX_WITHOUT_EFLAGS_AC_SET_IN_VBOXDRV -DIPRT_WITHOUT_EFLAGS_AC_PRESERVING -DVBOX_WITH_64_BITS_GUESTS -DCONFIG_VBOXDRV_AS_MISC -DRT_ARCH_AMD64 -DMODULE -DKBUILD_BASENAME='"SUPDrv_linux"' -DKBUILD_MODNAME='"vboxdrv"' -D__KBUILD_MODNAME=kmod_vboxdrv -c -o /tmp/vbox.0/linux/SUPDrv-linux.o /tmp/vbox.0/linux/SUPDrv-linux.c
gcc: error: unrecognized command line option ‘-mrecord-mcount’
gcc -Wp,-MMD,/tmp/vbox.0/.SUPDrv.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.8.5/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/compiler-version.h -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Wno-format-security -std=gnu89 -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 -mtune=generic -mno-red-zone -mcmodel=kernel -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -fno-jump-tables -fno-delete-null-pointer-checks -O2 --param=allow-store-data-races=0 -Wframe-larger-than=2048 -fstack-protector-strong -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -pg -mrecord-mcount -mfentry -DCC_USING_FENTRY -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -fno-strict-overflow -fno-stack-check -Werror=date-time -include /tmp/vbox.0/include/VBox/SUPDrvMangling.h -fno-omit-frame-pointer -fno-pie -Wno-declaration-after-statement -I./include -I/tmp/vbox.0/ -I/tmp/vbox.0/include -I/tmp/vbox.0/r0drv/linux -D__KERNEL__ -DMODULE -DRT_WITHOUT_PRAGMA_ONCE -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -DVBOX_WITH_HARDENING -DSUPDRV_WITH_RELEASE_LOGGER -DVBOX_WITHOUT_EFLAGS_AC_SET_IN_VBOXDRV -DIPRT_WITHOUT_EFLAGS_AC_PRESERVING -DVBOX_WITH_64_BITS_GUESTS -DCONFIG_VBOXDRV_AS_MISC -DRT_ARCH_AMD64 -DMODULE -DKBUILD_BASENAME='"SUPDrv"' -DKBUILD_MODNAME='"vboxdrv"' -D__KBUILD_MODNAME=kmod_vboxdrv -c -o /tmp/vbox.0/SUPDrv.o /tmp/vbox.0/SUPDrv.c
make[3]: *** [/tmp/vbox.0/linux/SUPDrv-linux.o] Error 1
make[3]: *** Waiting for unfinished jobs....
gcc: error: unrecognized command line option ‘-mrecord-mcount’
make[3]: *** [/tmp/vbox.0/SUPDrv.o] Error 1
make[2]: *** [/tmp/vbox.0] Error 2
make[1]: *** [__sub-make] Error 2
make: *** [vboxdrv] Error 2


Also I did all steps from official documentation "Installing and using VirtualBox on CentOS" in official site.

But it not help.
a_subscriber
Posts: 18
Joined: 26. Jul 2021, 15:33

vbox-setup compiler error with kernel 5.12

Post by a_subscriber »

CentOS 7, kernel 5.12.8-1.el7.elrepo.x86_64, Virtual Box 6.1
I also has this error:

Code: Select all

sudo /sbin/vboxconfig
...
gcc: error: unrecognized command line option ‘-mrecord-mcount’
How I can fix this problem?
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: vbox-setup compiler error with kernel 5.12

Post by fth0 »

(Mod edit: 'a_subscriber's post above was on a topic where it did not appear to belong. 'a_subscriber' has posted this question on this and another topic where it did not appear to belong. The quote below is fth0's response to the OP in one of the other topics.)
fth0 wrote:The error indicates that you have profiling enabled in your GCC setup. I'd suggest to verify your compiler installation.
See my post above yours.
Post Reply