Fedora 23 and VirtualBox 5 Kernel Modules wont load

Discussions related to using VirtualBox on Linux hosts.
Post Reply
ReclusiveGeek
Posts: 2
Joined: 20. Apr 2016, 12:54

Fedora 23 and VirtualBox 5 Kernel Modules wont load

Post by ReclusiveGeek »

After updating this morning the VirtualBox 5 kernel modules fail to load.

/sbin/rcvboxdrv setup

Stopping VirtualBox kernel modules [ OK ]
Uninstalling old VirtualBox DKMS kernel modules [ OK ]
Trying to register the VirtualBox kernel modules using DKMSError! echo
Your kernel headers for kernel 4.4.6-301.fc23.x86_64 cannot be found at
/lib/modules/4.4.6-301.fc23.x86_64/build or /lib/modules/4.4.6-301.fc23.x86_64/source.
[FAILED]
(Failed, trying without DKMS)
Recompiling VirtualBox kernel modules [FAILED]
(Look at /var/log/vbox-install.log to find out what went wrong)

vbox-install.log
Uninstalling modules from DKMS
removing old DKMS module vboxhost version 5.0.18

------------------------------
Deleting module version: 5.0.18
completely from the DKMS tree.
------------------------------
Done.
Attempting to install using DKMS

Creating symlink /var/lib/dkms/vboxhost/5.0.18/source ->
/usr/src/vboxhost-5.0.18

DKMS: add completed.
Failed to install using DKMS, attempting to install without
Makefile:185: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again. Stop.

I have all the requirements installed
# uname -r
4.4.6-301.fc23.x86_64
Package kernel-headers-4.4.6-301.fc23.x86_64 is already installed,

# dnf install binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel dkms
Last metadata expiration check: 0:46:28 ago on Wed Apr 20 11:18:49 2016.
Package binutils-2.25-17.fc23.x86_64 is already installed, skipping.
Package gcc-5.3.1-6.fc23.x86_64 is already installed, skipping.
Package make-1:4.0-5.1.fc23.x86_64 is already installed, skipping.
Package patch-2.7.5-2.fc23.x86_64 is already installed, skipping.
Package libgomp-5.3.1-6.fc23.x86_64 is already installed, skipping.
Package glibc-headers-2.22-11.fc23.x86_64 is already installed, skipping.
Package glibc-devel-2.22-11.fc23.x86_64 is already installed, skipping.
Package kernel-headers-4.4.6-301.fc23.x86_64 is already installed, skipping.
Package kernel-devel-4.4.5-300.fc23.x86_64 is already installed, skipping.
Package kernel-devel-4.4.6-300.fc23.x86_64 is already installed, skipping.
Package kernel-devel-4.4.6-301.fc23.x86_64 is already installed, skipping.
Package dkms-2.2.0.3-31.git.7c3e7c5.fc23.noarch is already installed, skipping.
Dependencies resolved.
Nothing to do.
Complete!

Please has anyone got an idea on how to fix this ?
Last edited by ReclusiveGeek on 20. Apr 2016, 14:14, edited 1 time in total.
ReclusiveGeek
Posts: 2
Joined: 20. Apr 2016, 12:54

Re: Fedora 23 and VirtualBox 5

Post by ReclusiveGeek »

OK I have fixed it.

The logical link /lib/modules/4.4.6-301.fc23.x86_64/build points to a non existent file ( /usr/src/kernels/4.4.6-301.fc23.x86_64)

so do the following to get Virtual box to work.

sudo mv /lib/modules/4.4.6-301.fc23.x86_64/build /lib/modules/4.4.6-301.fc23.x86_64/build.old
sudo ln -s /usr/local/sublime-text-3/kernels/4.4.6-301.fc23.x86_64 /lib/modules/4.4.6-301.fc23.x86_64/build /lib/modules/4.4.6-301.fc23.x86_64
sudo /sbin/rcvboxdrv setup

and you should have the kernel modules working.
xalpage
Posts: 2
Joined: 23. Apr 2016, 18:01

Re: Fedora 23 and VirtualBox 5 Kernel Modules wont load

Post by xalpage »

Hi,

I am quite new at linux and most I fail to understand.

I have installed virtualbox 5 in my fedora23. (never had a previous version)
Had exactly same error as you had.

Tried to fix it with your instructions and now have this message.

a. When running virtual box

Failed to open a session for the virtual machine AlexPVista.

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

Result Code: NS_ERROR_FAILURE (0x80004005)
Component: MachineWrap
Interface: IMachine {f30138d4-e5ea-4b3a-8858-a059de4c93fd}


b. in terminal when typing: sudo mv /lib/modules/4.4.6-301.fc23.x86_64/build /lib/modules/4.4.6-301.fc23.x86_64/build.old


mv: cannot stat ‘/lib/modules/4.4.6-301.fc23.x86_64/build’: No such file or directory



c. in terminal when typing: sudo ln -s /usr/local/sublime-text-3/kernels/4.4.6-301.fc23.x86_64 /lib/modules/4.4.6-301.fc23.x86_64/build /lib/modules/4.4.6-301.fc23.x86_64

n: target ‘/lib/modules/4.4.6-301.fc23.x86_64’ is not a directory


d. in terminal when typing: sudo /sbin/rcvboxdrv setup

Stopping VirtualBox kernel modules [ OK ]
Uninstalling old VirtualBox DKMS kernel modules [ OK ]
Trying to register the VirtualBox kernel modules using DKMSError! echo
Your kernel headers for kernel 4.4.7-300.fc23.i686+PAE cannot be found at
/lib/modules/4.4.7-300.fc23.i686+PAE/build or /lib/modules/4.4.7-300.fc23.i686+PAE/source.
[FAILED]
(Failed, trying without DKMS)
Recompiling VirtualBox kernel modules [FAILED]
(Look at /var/log/vbox-install.log to find out what went wrong)


Could you please help?
Thanks



Uninstalling modules from DKMS
removing old DKMS module vboxhost version 5.0.18

------------------------------
Deleting module version: 5.0.18
completely from the DKMS tree.
------------------------------
Done.
Attempting to install using DKMS

Creating symlink /var/lib/dkms/vboxhost/5.0.18/source ->
/usr/src/vboxhost-5.0.18

DKMS: add completed.
Failed to install using DKMS, attempting to install without
Makefile:185: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again. Stop.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Fedora 23 and VirtualBox 5 Kernel Modules wont load

Post by Perryg »

@ xalpage,
Your kernel headers for kernel 4.4.7-300.fc23.i686+PAE cannot be found at
/lib/modules/4.4.7-300.fc23.i686+PAE/build or /lib/modules/4.4.7-300.fc23.i686+PAE/source.
This usually means you do not have matching header for the running kernel. Did you install them?
xalpage
Posts: 2
Joined: 23. Apr 2016, 18:01

Re: Fedora 23 and VirtualBox 5 Kernel Modules wont load

Post by xalpage »

@ PerryG

Thanks for your response. As I mentioned I am very new at linux and fedora 23 is my first distro ever.

I don't know if I have installed Kernel headers, neither I know how to do or check.



Could you please help me further? A link or set of commands?

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

Re: Fedora 23 and VirtualBox 5 Kernel Modules wont load

Post by Perryg »

You need to learn how to use your most valuable, tool the search engine. Put "how to install headers in fedora 23" in your favorite search engine and follow the instructions.
Using the following for now:
  • as su/sudo in a terminal type yum or dnf for newer Fedora OSes.
    Example: dnf install kernel-headers-$(uname -r)
You may also need the development package. kernel-devel
Post Reply