[SOLVED] Setting up VirtualBox-5.1 and vboxconfig failing on Fedora24

Discussions related to using VirtualBox on Linux hosts.
Post Reply
jmayday
Posts: 5
Joined: 23. Jul 2016, 10:33

[SOLVED] Setting up VirtualBox-5.1 and vboxconfig failing on Fedora24

Post by jmayday »

Hi,

I switched to Fedora recently and I have some issue with setting up VirtualBox. Please help working this out as I have no clue why it's failing.
I've already disabled SELinux fot the time of the installation (I know it's not recommended, but I'm not yet familiar with this tool so I just turned if off for the time of installation).

So, exact package I've installed is VirtualBox-5.1-5.1.2_108956_fedora24-1.x86_64

Actually installation fails because it tries to run /sbin/vboxconfig I guess:

Code: Select all

Creating group 'vboxusers'. VM users must be member of that group!

vboxdrv.sh: failed: modprobe vboxdrv failed. Please use 'dmesg' to find out why.

There were problems setting up VirtualBox.  To re-start the set-up process, run
  /sbin/vboxconfig
And when I try to run the script it fails again:

Code: Select all

[10:41:52] kuba:~ $ sudo /sbin/vboxconfig 
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
vboxdrv.sh: failed: modprobe vboxdrv failed. Please use 'dmesg' to find out why.

There were problems setting up VirtualBox.  To re-start the set-up process, run
  /sbin/vboxconfig
as root.
Here is my vbox-install.log. Sorry I have to paste the contents here. As a new member I can't post urls. This is only part of file containing crucial info (I guess).

Code: Select all

make KBUILD_VERBOSE=1 SUBDIRS=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 CONFIG_MODULE_SIG= -C /lib/modules/4.6.4-301.fc24.x86_64/build -j8 modules
make[1]: uwaga: -jN wymuszone w podzadaniu: wyłączanie trybu serwera zadań.
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)
mkdir -p /tmp/vbox.0/.tmp_versions ; rm -f /tmp/vbox.0/.tmp_versions/*
make -f ./scripts/Makefile.build obj=/tmp/vbox.0
  gcc -Wp,-MD,/tmp/vbox.0/linux/.SUPDrv-linux.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/6.1.1/include -I./arch/x86/include -Iarch/x86/include/generated/uapi -Iarch/x86/include/generated  -Iinclude -I./arch/x86/include/uapi -Iarch/x86/include/generated/uapi -I./include/uapi -Iinclude/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -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 -mskip-rax-setup -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -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_SHA1_NI=1 -DCONFIG_AS_SHA256_NI=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-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 -Wno-unused-const-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -fvar-tracking-assignments -g -pg -mfentry -DCC_USING_FENTRY -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -Werror=incompatible-pointer-types -DCC_HAVE_ASM_GOTO -include /tmp/vbox.0/include/VBox/SUPDrvMangling.h -I/lib/modules/4.6.4-301.fc24.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  -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(SUPDrv_linux)"  -D"KBUILD_MODNAME=KBUILD_STR(vboxdrv)" -c -o /tmp/vbox.0/linux/SUPDrv-linux.o /tmp/vbox.0/linux/SUPDrv-linux.c
<<.....cut most of the file.....>>
  ld -r -m elf_x86_64 -T ./scripts/module-common.lds --build-id  -o /tmp/vbox.0/vboxnetadp.ko /tmp/vbox.0/vboxnetadp.o /tmp/vbox.0/vboxnetadp.mod.o
make KBUILD_VERBOSE=1 SUBDIRS=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 CONFIG_MODULE_SIG= -C /lib/modules/4.6.4-301.fc24.x86_64/build -j8 modules
make[1]: uwaga: -jN wymuszone w podzadaniu: wyłączanie trybu serwera zadań.
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)
mkdir -p /tmp/vbox.0/.tmp_versions ; rm -f /tmp/vbox.0/.tmp_versions/*
make -f ./scripts/Makefile.build obj=/tmp/vbox.0
Last edited by jmayday on 23. Jul 2016, 19:32, edited 1 time in total.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Setting up VirtualBox-5.1 and vboxconfig failing on Fedora24

Post by socratis »

There is a message that keeps repeating:
modprobe vboxdrv failed. Please use 'dmesg' to find out why.
Did you?
jmayday wrote:Sorry I have to paste the contents here. As a new member I can't post urls.
Actually you are supposed to paste the contents here. If it's too big, you post it as an attachment. If it way too big, you zip it first.

But what you posted are not error messages, they are part of the script. Please post the vbox-install.log whole. Also, take a look at the user manual, Chapter 2.3. Installing on Linux hosts.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
jmayday
Posts: 5
Joined: 23. Jul 2016, 10:33

Re: Setting up VirtualBox-5.1 and vboxconfig failing on Fedora24

Post by jmayday »

vbox-install.log attached.
User manual says about installing kernel-devel for Fedora. In my case this is installed (kernel-devel-4.6.4-301.fc24.x86_64 for kernel 4.6.4-301.fc24.x86_64) so looks like requirements are met.
Attachments
vbox-install.log.zip
(23.83 KiB) Downloaded 233 times
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Setting up VirtualBox-5.1 and vboxconfig failing on Fedora24

Post by socratis »

I'm NOT a Linux expert, so you'll have to wait for one to take a look at the log to see if they can find something. From the little I know, I didn't see anything striking.

In the mean time, although not the same exact topic, take a look at this thread: viewtopic.php?f=3&t=78365. You might get some ideas.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Setting up VirtualBox-5.1 and vboxconfig failing on Fedora24

Post by Perryg »

The install log does not show an issue up front which suggests that VBox is not the unhappy party here. The actual message was about dmesg and that is what you need to post ( as an attachment ) right after the the next time you try to install and it fails. ( install not vboxconfig )

Note: you did the right thing when disabling SELinux before the install. It has been an issue before and did crop up in the 5.1 build especially with a single package from VBox.

Note2: Install from the terminal and use dnf not a package manager. This will show install errors if any and eliminate the package manager from causing the issue.
jmayday
Posts: 5
Joined: 23. Jul 2016, 10:33

Re: Setting up VirtualBox-5.1 and vboxconfig failing on Fedora24

Post by jmayday »

Note: you did the right thing when disabling SELinux before the install. It has been an issue before and did crop up in the 5.1 build especially with a single package from VBox.
One sec, I'm not sure if SELinux has been disabled.

Code: Select all

[17:41:57] root:~ # setenforce 0
[17:42:06] root:~ # getenforce  
Permissive
But when installing I've received the SELinux notification

Code: Select all

SELinux is preventing vboxdrv.sh from write access on the file /etc/udev/rules.d/60-vboxdrv.rules.

*****  Plugin catchall (100. confidence) suggests   **************************

If aby vboxdrv.sh powinno mieć domyślnie write dostęp do 60-vboxdrv.rules file.
Then proszę to zgłosić jako błąd.
Można utworzyć lokalny moduł polityki, aby umożliwić ten dostęp.
Do
allow this access for now by executing:
# ausearch -c 'vboxdrv.sh' --raw | audit2allow -M my-vboxdrvsh
# semodule -X 300 -i my-vboxdrvsh.pp

Additional Information:
Source Context                system_u:system_r:init_t:s0
Target Context                unconfined_u:object_r:udev_rules_t:s0
Target Objects                /etc/udev/rules.d/60-vboxdrv.rules [ file ]
Source                        vboxdrv.sh
Source Path                   vboxdrv.sh
Port                          <Unknown>
Host                          localhost.localdomain
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-191.5.fc24.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     localhost.localdomain
Platform                      Linux localhost.localdomain 4.6.4-301.fc24.x86_64
                              #1 SMP Tue Jul 12 11:50:00 UTC 2016 x86_64 x86_64
Alert Count                   35
First Seen                    2016-07-22 22:37:00 CEST
Last Seen                     2016-07-23 17:40:17 CEST
Local ID                      2f76fb5b-9bff-42c5-b42f-6dd0a5b5d692

Raw Audit Messages
type=AVC msg=audit(1469288417.55:306): avc:  denied  { write } for  pid=18692 comm="vboxdrv.sh" name="60-vboxdrv.rules" dev="dm-0" ino=2230999 scontext=system_u:system_r:init_t:s0 tcontext=unconfined_u:object_r:udev_rules_t:s0 tclass=file permissive=1


Hash: vboxdrv.sh,init_t,udev_rules_t,file,write
Hey, this is only log and if I get it right such event is logged but it has been allowed because of Permissive mode, right? Unfortunately I can't see anywhere "success" flag which should eventually indicate if event was blocked or not.
Note2: Install from the terminal and use dnf not a package manager. This will show install errors if any and eliminate the package manager from causing the issue.
I'm using DNF already.

And another question about dmesg. I'm using command below to record log but I don't see anything going on when installation fails (having it running on another terminal window) .

Code: Select all

journalctl -kf 
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Setting up VirtualBox-5.1 and vboxconfig failing on Fedora24

Post by Perryg »

edit the /etc/selinux/conf file and set SELINUX=disabled and reboot.

Code: Select all

 This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted 
Then see if this allows the install to finish. If it does then set it back to permissive or enforcing. ( note this is just for a test. It is up to you to fix SELinux issues I'm afraid as I don't support it myself )

You can get the dmesg by running dmesg in the terminal. I have no idea where it is actually stored in Fedora as it is not my favorite distro. They seem to go to extremes to make it difficult these days.
jmayday
Posts: 5
Joined: 23. Jul 2016, 10:33

Re: Setting up VirtualBox-5.1 and vboxconfig failing on Fedora24

Post by jmayday »

Perryg wrote:edit the /etc/selinux/conf file and set SELINUX=disabled and reboot.
No success. Same installation errors as before.
Perryg wrote: You can get the dmesg by running dmesg in the terminal. I have no idea where it is actually stored in Fedora as it is not my favorite distro. They seem to go to extremes to make it difficult these days.
dmesg is not showing anything valueable. Only some info about hardware related stuff. Should I run it with some specific arguments?
jmayday
Posts: 5
Joined: 23. Jul 2016, 10:33

Re: Setting up VirtualBox-5.1 and vboxconfig failing on Fedora24

Post by jmayday »

Code: Select all

[19:21:33] kuba:~ $ sudo /sbin/vboxconfig 
vboxdrv.sh: Starting VirtualBox services.
[19:21:33] kuba:~ $
Problem solved by changing "Windows UEFI" to "Other OS" in motherboard Secure Boot options.

VirtualBox re-installation was not necessary, but I did it just because I was curios about those SELinux notifications. Having SELinux set to Permissive, AVC notification was shown during installation, but no errors were reported from dnf in terminal window and VirtualBox was ready to use. So event was only logged, not blocked.

Anyway, thank you guys for participating this thread and fast responses.
andhdo
Posts: 1
Joined: 6. Dec 2016, 04:26

Re: [SOLVED] Setting up VirtualBox-5.1 and vboxconfig failing on Fedora24

Post by andhdo »

Making the bios change and edit the selinux solved my problem of installing virtualbox 5.11 over fedora 25.
Thanks.

There are the instructions that I've followed:

# install virtualbox on fedora 25

# start session as root; then open a terminal and
# install this prerrequisites

dnf update
dnf install binutils qt gcc make patch libgomp glibc-headers glibc-devel
dnf install kernel-devel-$(uname -r)
dnf install kernel-headers-$(uname -r)
dnf install dkms

# then start the config utillity
sudo /sbin/vboxconfig

# if there are errors, with the 'modprobe vboxdrv' command there
# are 2 solutions

SOL-1: edit the /etc/selinux/config file and set SELINUX=disabled and reboot.
SOL.2: Problem solved by changing "Windows UEFI" to "Other OS/Legacy" in motherboard Secure Boot options.
Post Reply