VirtualBox failed to load R0 module

Hi,

I installed VirtualBox a few days ago and whenever I try to start a VirtualBox VM I get an error along the lines (different virtual machine names for different machines, ofc):



Failed to open a session for the virtual machine **Debian (Unstable)**.
Failed to load R0 module /usr/lib/virtualbox/VMMR0.r0: The owner is not root: **'/usr/lib'** (VERR_SUPLIB_OWNER_NOT_ROOT).
Failed to load VMMR0.r0 (VERR_SUPLIB_OWNER_NOT_ROOT).
|Result Code:|NS_ERROR_FAILURE (0x80004005)|
|---|---|
|Component:|ConsoleWrap|
|Interface:|IConsole {872da645-4a9b-1727-bee2-5585105b9eed}|



I saw this ticket at virtualbox.org and in response to comment #15 I ran:


sudo chown -R root:root /usr/lib/virtualbox

all this did was change the error to that shown here:
http://imgur.com/SssXDZS.png
then I ran:


sudo chmod 4711 /usr/lib/virtualbox/VirtualBox

also in response to comment #15, and then when I started the VM up again it returned my original error.

I have virtualbox-host-kmp-default installed (from the default repository) and I am using the correct kernel for it (4.4.0, although I was previously using the 4.4.1 kernel from an unofficial repository, this issue seems to have begun after I removed this 4.4.1 kernel, before this time I was able to start VMs without issue), I even tried reinstalling virtualbox-host-kmp-default to no effect. I also tried running (as I also had virtualbox-host-source installed), as root:


cd /usr/src/kernel-modules/virtualbox
make
make install

and this too failed to correct the problem. I then tried rebooting in case, some new kernel modules this command gave me weren’t going to be loaded until I rebooted and still I am encountering this error. Any ideas of how to fix this problem per chance?

Thanks for your time,
Brenton

Nvm, this Unix & Linux SE post lead me to the answer. I ran:


ls -ld /usr /usr/lib /usr/lib/virtualbox /usr/lib/virtualbox/VMMR0.r0

to get the output:


drwxr-xr-x 1 root      root          180 Feb 12 10:00 /usr
drwxr-xr-x 1 fusion809 users       28560 Dec 11 05:51 /usr/lib
drwxr-xr-x 1 root      vboxusers    1562 Feb 12 16:33 /usr/lib/virtualbox
-rw-r--r-- 1 root      vboxusers 1422976 Feb  2 13:46 /usr/lib/virtualbox/VMMR0.r0

so then I ran:


sudo chown root:root /usr/lib

then when I tried to start the VM I got the same error message box pop up I showed in my previous comment. Then I decided to give running:


sudo chmod 4711 /usr/lib/virtualbox/VirtualBox 

another go and it seemed to fix this issue.

How did you install it in the first place? If you use the RPM packages (either openSUSE’s included in Tumbleweed or Oracle’s from virtualbox.org), everything should be ok.

Try to run “sudo chkstat --system”, that should fix all file permissions/ownership.

And:

drwxr-xr-x 1 fusion809 users       28560 Dec 11 05:51 /usr/lib

That’s wrong. /usr/lib/ should not be owned by your user, but rather root.

Please don’t randomly change file/folder permissions or ownership unless you know what you are doing, this is bound to give problems.

Note also in a normal install your user must be a member of the VirtualBox group