Page 1 of 2

Local VBox build fails, kernel driver not found

Posted: 1. Sep 2015, 23:45
by RicV
After following the Linux build instructions for debian, and encountering only minor issues with the required packages, I was able to build successfully on Ubuntu 14-64 (from a 5.0.0 drop that I downloaded recently), including making the Virtual Box kernel module.

https://www.virtualbox.org/wiki/Linux%2 ... structions

The instructions say I should be able to run from the build directory, and indeed I can run the GUI front-end and even create a VM with it, but I cannot start any VM, whether newly created or known to work with an installed copy of Virtual Box 5.0.0. When I run my local build, and then try to start a VM, it pops up an error box saying Kernel driver not accessible. Clicking OK gives another error with little additional information. No log file is created in the VM directory, though logging is enabled in the GUI, and I do get a log when the same VM is run from a properly installed Virtual Box.

I also tried VBoxManage startvm, and of course got the same Kernel driver not accessible error, but curiously after clicking OK it said the VM was started when in fact it was not.

Code: Select all

$ ./VBoxManage startvm Ubuntu-X1
Waiting for VM "Ubuntu-X1" to power on...
VM "Ubuntu-X1" has been successfully started.
$
I rebuilt from scratch with LOG_ENABLED=1; then ran it with the following env vars set:

Code: Select all

VBOXSVC_RELEASE_LOG_FLAGS=time tid thread
VBOXSVC_RELEASE_LOG=main.e.l.f+gui.e.l.f
VBOXSVC_RELEASE_LOG_DEST=dir=/home/rvilbig/temp
VBOX_RELEASE_LOG_FLAGS=time
VBOX_RELEASE_LOG=main.e.l.f+gui.e.l.f
VBOX_RELEASE_LOG_DEST=dir=/home/rvilbig/temp
VBOX_LOG_DEST=dir=/home/rvilbig/temp
The result failed the same way. I did get 4 log files, but none provided any clues at all, just some boiler plate.

I have noticed that after powering off the host then booting up, lsmod reports that vboxdrv is loaded with 3 additional vbox modules. And I was unable to remove them with modprobe -r because it said they were in use. So I suppose when I had done the modprobe to install my locally built drivers it had failed though it had not said so.

Q1: Is it viable to run a locally built Virtual Box on the same host where there is an installed copy? I am obviously not trying to run them at the same time, but is something running behind the scenes due to the installed version which interferes with either the locally built version or modprobe?

Q2: Am I just botching the modprobe step somehow? Can someone provide more specific steps to take between building and running Virtual Box?

Q3: Are there more appropriate log flags or settings that I should be using to debug this?

Thanks in advance

Re: Local VBox build fails, kernel driver not found

Posted: 1. Sep 2015, 23:55
by Perryg
Q1: Is it viable to run a locally built Virtual Box on the same host where there is an installed copy? I am obviously not trying to run them at the same time, but is something running behind the scenes due to the installed version which interferes with either the locally built version or modprobe?
No. It will fail and neither will run. If you want to compile your own ( and I applaud you for it ) you must remove the already installed version.

Re: Local VBox build fails, kernel driver not found

Posted: 2. Sep 2015, 00:01
by RicV
Thanks for the lightening fast response, Perryg. I sure wish the Linux build and run instructions said that, because as someone new to Virtual Box it just seemed natural to install it first, learn how to use it, and then try to build it. But no worries, now I know how to proceed which I didn't an hour ago.

BTW, it's not so much that I want to build it myself, but I need to in order to track down the problem I reported last week where my virtual device constructor is not called even though the registration request returns successfully.

Anyway, thanks a gig.

Re: Local VBox build fails, kernel driver not found

Posted: 2. Sep 2015, 00:05
by Perryg
I understand. The issue is the kernel modules are called the same but they are built differently.

Re: Local VBox build fails, kernel driver not found

Posted: 2. Sep 2015, 00:39
by RicV
Closer, but still having the same problem. I removed it with sudo apt-get remove virtualbox-5.0, then shut down the host, then booted up again. The vboxdrv and others have persisted.

Code: Select all

$ lsmod | grep vbox
vboxpci                23273  0 
vboxnetadp             25670  0 
vboxnetflt             27880  0 
vboxdrv               442337  3 vboxnetadp,vboxnetflt,vboxpci
$
Though dubious, I tried to run my local build again, and got the same results. Then I did use modprobe -r to remove them all (which hadn't worked before), then did modprobe vboxdrv to load my version, then started VirtualBox GUI front end. I still got the Kernel driver not found error on launching a VM.

Does it have to be a host on which virtual box was never installed in the first place?

Re: Local VBox build fails, kernel driver not found

Posted: 2. Sep 2015, 01:26
by Perryg
Nope. Just needs to be removed. If you still have mods when you reboot they did not get removed. How did you install to begin with ( the original ) and where did you get the package from?

Re: Local VBox build fails, kernel driver not found

Posted: 2. Sep 2015, 01:46
by RicV
I followed these (debian, trusty) instructions to download and install the virtualbox-5.0 package:

https://www.virtualbox.org/wiki/Linux_Downloads

Re: Local VBox build fails, kernel driver not found

Posted: 2. Sep 2015, 01:54
by Perryg
Maybe I am confused. Was this the first install on this machine? and then you decided to build the OSE version and run it too?

Re: Local VBox build fails, kernel driver not found

Posted: 2. Sep 2015, 02:01
by RicV
Correct. Here's the sequence of events.

1. Fresh install of Ubuntu 14.04 -64 on the host
2. Install virtual box per the instructions mentioned, confirm VBox is running well with U14-64 guests.
3. Add a virtual device that I wrote to the VM, confirmed that my VBoxDevicesRegister() is being called, and successfully registering my device, but my constructor is never called.
4. Tried to enable logs to troubleshoot while waiting for my other post to get an answer, but could not get useful logs.
5. Decided I will have to build OSE myself to get the logs I need.
6. Got OSE built but could not run it, so I added this new topic. The rest is covered in this topic.

Re: Local VBox build fails, kernel driver not found

Posted: 2. Sep 2015, 02:15
by Perryg
OK so given that you did install pulling in VirtualBox through the VBox repo did it use the software center to actually do the install?

I ask because Ubuntu tries to play a trick on you by convincing you that they have the right version and you should install that one.

The reason I ask is because it make a real difference on what you need to do. You can verify this by looking at one of the guests log files at the top and see if it lists OSE. If not then you have the PUEL version and you should be able to remove it with sudo apt-get purge ...

I would do a test with Virtu* or virtu* and see if it list either or both.

Re: Local VBox build fails, kernel driver not found

Posted: 2. Sep 2015, 02:23
by RicV
I do not remember the details from the original installation, it was several weeks ago. Here is the top of one log file which predates my attempt to build OSE.

Code: Select all

VirtualBox VM 5.0.2 r102096 linux.amd64 (Aug 13 2015 16:42:27) release log
00:00:00.583204 Log opened 2015-08-21T16:58:45.234829000Z
00:00:00.583205 Build Type: release
00:00:00.583207 OS Product: Linux
00:00:00.583208 OS Release: 3.16.0-46-generic
00:00:00.583209 OS Version: #62~14.04.1-Ubuntu SMP Tue Aug 11 16:27:16 UTC 2015
00:00:00.583226 DMI Product Name: Precision M4500
00:00:00.583237 DMI Product Version: 0001
00:00:00.583316 Host RAM: 3886MB total, 3400MB available
00:00:00.583319 Executable: /usr/lib/virtualbox/VirtualBox
00:00:00.583320 Process ID: 2776
00:00:00.583320 Package type: LINUX_64BITS_UBUNTU_14_04
00:00:00.621222 Installed Extension Packs:
00:00:00.621237   None installed!
00:00:00.622512 Console: Machine state changed to 'Starting'
00:00:00.627576 GUI: UIMediumEnumerator: Medium-enumeration finished!
00:00:00.628824 Using XKB for keycode to scan code conversion
00:00:00.715266 SUP: Loaded VMMR0.r0 (/usr/lib/virtualbox/VMMR0.r0) at 0xffffffffc0000020 - ModuleInit at ffffffffc001f4a0 and ModuleTerm at ffffffffc001f970
00:00:00.715289 SUP: VMMR0EntryEx located at ffffffffc0022ed0, VMMR0EntryFast at ffffffffc0022700 and VMMR0EntryInt at ffffffffc00226f0
00:00:00.719300 Guest OS type: 'Ubuntu_64'
00:00:00.722809 fHMForced=true - 64-bit guest
00:00:00.736406 File system of '/usr/share/virtualbox/VBoxGuestAdditions.iso' (DVD) is ext4
00:00:00.751801 File system of '/home/rvilbig/VirtualBox VMs/Ubuntu14-64_2/Snapshots' (snapshots) is unknown
00:00:00.751816 File system of '/home/rvilbig/VirtualBox VMs/Ubuntu14-64_2/Ubuntu14-64#2.vdi' is ext4
I cannot purge it, because I already removed it:

Code: Select all

rvilbig@RicV-M4500:~/vbox/VirtualBox-5.0.0/out/linux.amd64/release/bin$ sudo apt-get purge Virtu*
[sudo] password for rvilbig: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'virtualbox' is not installed, so not removed
The following packages were automatically installed and are no longer required:
  account-plugin-windows-live libsdl-ttf2.0-0 libupstart1
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 27 not upgraded.
rvilbig@RicV-M4500:~/vbox/VirtualBox-5.0.0/out/linux.amd64/release/bin$ sudo apt-get purge virtu*
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package virtualbox.desktop
E: Couldn't find any package by regex 'virtualbox.desktop'
E: Unable to locate package virtualbox.xml
E: Couldn't find any package by regex 'virtualbox.xml'
rvilbig@RicV-M4500:~/vbox/VirtualBox-5.0.0/out/linux.amd64/release/bin$ 
Now I will try the auotremove that it recommended...

Re: Local VBox build fails, kernel driver not found

Posted: 2. Sep 2015, 02:49
by RicV
Sigh. It took several rounds of reboot, apt-get remove / purge / update... Finally I reached the point where after a reboot, lsmod does NOT show any vbox* modules. Then I rebuilt the kernel modules, used modprobe to add them, and everything looked good. But STILL have the same problem of kernel driver not found.

Short of trying a new OSE build on a fresh host that never saw Virtual Box before, I am not sure what to do now.

Re: Local VBox build fails, kernel driver not found

Posted: 2. Sep 2015, 02:59
by Perryg
The build does not need to be on a new host. There is something that you are missing in your build steps.

What instruction are you using?

Re: Local VBox build fails, kernel driver not found

Posted: 2. Sep 2015, 03:06
by RicV
I am using these instructions:

https://www.virtualbox.org/wiki/Linux%2 ... structions

There were a few hickups with the packages but I got around them. One thing, though, it mentioned that certain libraries are missing and wants me to add links to a set of so files in /usr/lib32, but those files don't exist for me.

I did disable hardening.

I built with kmk LOG_ENABLED=1 per advice in a different thread on logging details. But I had the same problem with just knk.

Re: Local VBox build fails, kernel driver not found

Posted: 2. Sep 2015, 03:13
by Perryg
The hickups make me concerned. I build just about everyday and I can tell you that hickups usually mean something serious.

If you like you can run the build again and send me the terminal output for the entire run and I will see what it says.

Post it as an attachment here please.