VirtualBox

Ticket #7536 (reopened defect)

Opened 5 years ago

Last modified 2 weeks ago

kernel driver not installed

Reported by: matteosistisette Owned by:
Priority: major Component: host support
Version: VirtualBox 3.2.8 Keywords: vboxdrv, kernel module, recompile
Cc: Guest type: Windows
Host type: Linux

Description (last modified by michael) (diff)

Every once in a while (I suppose every time the kernel gets updated thruough ubuntu's automatic update manager), after I reboot my ubuntu host and try to open Virtual Box and start one of my virtual machines, I get the following error:

""" The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Please reinstall the kernel module by executing

'/etc/init.d/vboxdrv setup'

as root. Users of Ubuntu, Fedora or Mandriva should install the DKMS package first. This package keeps track of Linux kernel changes and recompiles the vboxdrv kernel module if necessary. """

Then I run the abovementioned command and everything gets fixed, but it is ridiculous that I have to do so every time. Would you imagine if EVERY application I use required the same??

Needless to say, I HAVE dkms installed but this happens allthesame.

Attachments

vbox-install.log Download (5.7 KB) - added by matteosistisette 5 years ago.

Change History

comment:1 Changed 5 years ago by Technologov

Unfortunately the problem is that Linux breaks backward compatibility on every upgrade. So point this problem to Linus Torvalds. I had a discussion with Creg-Hartman, one of Linus' Captains from Novell SUSE Linux on this topic but we are completely disagree with each other. This problem affects *all* the Linux distros.

And you have to do that only to EVERY application that had drivers/kernel modules (very few have). This obviously includes NVIDIA drivers as well.

-Technologov

comment:2 Changed 5 years ago by matteosistisette

Ok, I see.

Then what does the second part of the error message mean?

"Users of Ubuntu, Fedora or Mandriva should install the DKMS package first. This package keeps track of Linux kernel changes and recompiles the vboxdrv kernel module if necessary"

If the dkms package does not recompile the kernel module when necessary, then that part should be suppressed.

By the way I never recompiled any nvidia drivers and never got any error message related to nvidia... but maybe an nvidia driver package update is included and hence automatically downloaded every time a new version of the kernel is?

comment:3 Changed 5 years ago by Technologov

I am not sure how DKMS works. But it is a good question.

comment:4 Changed 5 years ago by michael

It definitely works here (Ubuntu 64bit host, recently upgraded to Maverick) and DKMS should do this by design. Perhaps there is a problem with the way DKMS is set up on your system? Or perhaps DKMS is not being used on your system for some reason? Could you take a look in (and attach) the log file from the module build (/var/log/vbox-install.log)?

Changed 5 years ago by matteosistisette

comment:5 Changed 5 years ago by matteosistisette

attached

comment:6 Changed 5 years ago by matteosistisette

there are indeed a lot of error messages somewhat related to dkms, but I have no idea what exactly is wrong

comment:7 Changed 5 years ago by michael

My feeling here is that dkms has got slightly confused due to older versions of modules which got left on your system and that this is keeping it from working correctly. Perhaps you could file a bug for this with Ubuntu? The maintainer of the Ubuntu dkms package is also the upstream maintainer, so he should have a pretty good idea of whether this is working correctly or not. If you write the link to the Ubuntu bug on this bug tracker we will be able to follow the ticket too and possibly resolve this together.

comment:8 Changed 5 years ago by frank

Still relevant with VBox 3.2.10?

comment:9 Changed 5 years ago by matteosistisette

I don't know. I'll have to wait untill a new version of the kernel gets released and the kernel gets automatically updated

comment:10 Changed 4 years ago by frank

  • Status changed from new to closed
  • Resolution set to worksforme

comment:11 Changed 4 years ago by matteosistisette

  • Status changed from closed to reopened
  • Resolution worksforme deleted

This is still an issue at least with VB 4.0.12

Here's the output when I run vboxdrv setup:

$ sudo /etc/init.d/vboxdrv setup
sudo: /etc/sudoers.d/puredata is mode 0644, should be 0440
[sudo] password for teo: 
WARNING: All config files need .conf: /etc/modprobe.d/blacklist, it will be ignored in a future release.
 * Stopping VirtualBox kernel modules                                    [ OK ] 
 * Uninstalling old VirtualBox DKMS kernel modules                              Error! Could not locate dkms.conf file.
File:  does not exist.
Error! Could not locate dkms.conf file.
File:  does not exist.
Error! Could not locate dkms.conf file.
File:  does not exist.
                                                                         [ OK ]
 * Trying to register the VirtualBox kernel modules using DKMS           [ OK ] 
 * Starting VirtualBox kernel modules                                    [ OK ]

comment:12 Changed 4 years ago by frank

Your DKMS config is somehow screwed up. What Linux distribution is that?

comment:13 Changed 4 years ago by matteosistisette

Hey for some reason I didn't get a notification for the reply...

This is Ubuntu 11.10

The kernel got updated again and I got the issue again. Here's the output from vboxdrv setup again:

$ sudo /etc/init.d/vboxdrv setup
[sudo] password for teo: 
WARNING: All config files need .conf: /etc/modprobe.d/blacklist, it will be ignored in a future release.
 * Stopping VirtualBox kernel modules                                    [ OK ] 
 * Uninstalling old VirtualBox DKMS kernel modules                              Error! Could not locate dkms.conf file.
File:  does not exist.
Error! Could not locate dkms.conf file.
File:  does not exist.
Error! Could not locate dkms.conf file.
File:  does not exist.
                                                                         [ OK ]
 * Trying to register the VirtualBox kernel modules using DKMS           [ OK ] 
 * Starting VirtualBox kernel modules                                    [ OK ]

comment:14 Changed 3 years ago by Christian2111

Your problems are probably based on directories that old versions of virtualbox have left behind in the directory /var/lib/dkms/vboxhost. Delete all sub-directories of old virtualbox versions from this directory.

Also see:

 https://bugs.launchpad.net/ubuntu/+source/dkms/+bug/830915  http://8thstring.blogspot.com/2012/01/error-could-not-locate-dkmsconf-file.html

comment:15 Changed 9 months ago by andrex

This problem has existed for years, and still does with Virtualbox 4.3.20 and the latest kernels (currently 3.13.0.40.47 in Ubuntu). At each kernel update, the infamous error message

Error! Could not locate dkms.conf file.
File:  does not exist.

appears, and the vbox kernel drivers (vboxhost, etc.) don't get rebuilt. After reboot, you have to run /etc/init.d/vboxhost setup or dpkg-reconfigure virtualbox-4.3 to rebuild them, before you can run any virtual guests, as the OP reported.

The standard advice is to remove old directories in /var/lib/dkms/vboxhost, and try again. Or uninstall dkms, remove /var/lib/dkms, reinstall dkms, and try again, which amounts to the same thing. I've done that many times, and each time the problem has come back on the next kernel update. It just happened again with the versions I cited above.

I haven't tried to do any debugging of the vbox install scripts, but to me, the error

File:  does not exist.

plainly shows that a parameter that's supposed to hold the name of the vbox dkms.conf file is unexpectedly empty, and so of course the file isn't found or processed.

If you can suggest some debugging steps, I'll be glad to perform them on the next kernel update.

Thanks for your attention to this old bug. It's only a nuisance bug, but it's been a nuisance for a long time.

comment:16 Changed 9 months ago by michael

  • Description modified (diff)

A bit of research shows that this happens with other dkms drivers too (not just the VirtualBox ones). If you have any experience with debugging shell scripts (running them using "sh -x <script name> <parameters...>" or "bash -x ..." is usually my approach) you could try debugging the /usr/bin/dkms script. The functionality we use is:

# /usr/bin/dkms remove -m $MODULE -v $VERSION --all
# /usr/bin/dkms add -m $MODULE -v $VERSION
# /usr/bin/dkms build -m $MODULE -v $VERSION
# /usr/bin/dkms install -m $MODULE -v $VERSION --force

For reference, the error message you are seeing is the following lines of /usr/bin/dkms:

    [[ -r $read_conf_file ]] || die 4 $"Could not locate dkms.conf file." \
	$"File: $conf does not exist."

Noting that the wrong variable is used in the second line, which rather makes sure that you will not find out the file name.

comment:17 Changed 2 weeks ago by frank

Removed the last inappropriate comment. Actually comment 16 contains instructions how to fix the problem. DKMS works very well here, tested a couple of Linux distributions. If this is still not working for someone, please post the exact version of the Linux distribution you are using and the exact package name of the VirtualBox package you are using.

comment:18 Changed 2 weeks ago by teo8976

I don't know what was inappropriate in pointing out that this bug is still not fixed, which you confirm, given that you're telling me that I have to run a manual workaround which requires having "experience with debugging shell scripts" in order to get rid of a problem which was put in place by VirtualBox.

comment:19 Changed 2 weeks ago by teo8976

Your problems are probably based on directories that old versions of virtualbox have left behind in the directory /var/lib/dkms/vboxhost. Delete all sub-directories of old virtualbox versions from this directory.

I already did that.

comment:20 Changed 2 weeks ago by frank

I already said that DKMS works very well for us on various distributions and it works for many other users.

At the moment I don't see any evidence that this problem is caused by VirtualBox. As I said I think it's a local screwup, perhaps by some incorrect installed application, by an old version of DKMS or something else. The VirtualBox installer scripts are available, it's open source. If you want any progress with your problem, provide a reliable reproduction scenario and start with the information I asked for in my previous comment.

comment:21 Changed 2 weeks ago by teo8976

I already said that DKMS works very well for us on various distributions

Have you ever tried on a distribution that has been upgraded several times, and where you have upgraded VirtualBox several times? I have no doubt a fresh install works pretty well, but you cannot expect users to always wipe out their hard drive and reinstall everything from scratch every time they need to upgrade VB.

As I said I think it's a local screwup,

Yes of course it IS a local screwup, and somebody ages ago, I don't remember if here in this thread or in the forum, confirmed it was caused by some garbage left behind by previous versions OF VIRTUALBOX. Which either I was unable to clean up because I couldn't safely distinguish it from current stuff, or I did and didn't fix the issue. All I know is I tried to do what I was told to do by whomever triaged the issue, and either it was impossible to do or it didn't work, I don't remember which one. It's not my job to investigate the issue further, it's yours.

All I did was always install every new version of Virtual Box by following the official instructions, so if some version left behind a "local screwup" it's the responsibility of newer VirtualBox versions to clean it up.

This is just like the 3d-driver stuff on Windows: at some version you created a driver that had to be installed in such a way that was later impossible to remove on the guest Windows system. Then you released a new version where that was superseded by some more modern driver, but you didn't give a sh about providing upgrading users a way to fix their destroyed guest OS. (yes, there were instructions in the manual to deal with that, and they didn't work for everybody, and you refused to admit it).

Fixing bugs doesn't only mean making sure that the new version, freshly installed on a virgin system, works, it also means fixing the screwups that were caused by bugs of older versions when upgrading.

comment:22 Changed 2 weeks ago by teo8976

Now if you tell me a command that I can run and post the output, and then tell me what I can do to manually fix the "local screwup", I'll be happy to try that. Perhaps this time it will work. But this bug won't be fixed until every user experiencing this issue will see it disappear without having to do anything.

comment:23 Changed 2 weeks ago by frank

You are demanding for help without providing real facts. As long as we don't have a simple reproduction scenario there is nothing which can be fixed. What you say is essentially Some version of VirtualBox did something wrong, now fix it! will not work, sorry.

comment:24 Changed 2 weeks ago by teo8976

I provided some more data than that.

Anyway, as I said, just tell me what more data you need (e.g. the contents of some directory or the output of dkms --whatever) and I'll provide it

comment:25 Changed 2 weeks ago by frank

Let's start by providing the information I asked for several times, your current Linux distribution (exact version number) and the VirtualBox package you installed (exact file name) please.

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use