Virtualbox fails to run.. kernel driver not loaded

Discussions related to using VirtualBox on Mac OS X hosts.
aegirth
Posts: 2
Joined: 31. Oct 2012, 10:43

Virtualbox fails to run.. kernel driver not loaded

Post by aegirth »

I'm getting this error every time I need to reboot my system and try to run my VM's. Happens with all 3 ( I have a XP, Win7 & Ubuntu VM's). The error is always the same. 'Error: Kernel Driver not loaded'. I have usually fixed this by reinstalling the Virtualbox app, but isn't there another way, like creating a shell script to load the driver as needed when it fails to load normally?
aegirth
Posts: 2
Joined: 31. Oct 2012, 10:43

Re: Virtualbox fails to run.. kernel driver not loaded

Post by aegirth »

for Google's sake, thought I'd add here some code I found on Github that fixes this for me. It's a shell script that unloads all the Virtualbox kernel extensions and reloads them.

Code: Select all

!/bin/bash

unload() {
        kextstat | grep "org.virtualbox.kext.VBoxUSB" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxUSB
        kextstat | grep "org.virtualbox.kext.VBoxNetFlt" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxNetFlt
        kextstat | grep "org.virtualbox.kext.VBoxNetAdp" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxNetAdp
        kextstat | grep "org.virtualbox.kext.VBoxDrv" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxDrv
}

load() {
        sudo kextload /Library/Extensions/VBoxDrv.kext -r /Library/Extensions/
        sudo kextload /Library/Extensions/VBoxNetFlt.kext -r /Library/Extensions/
        sudo kextload /Library/Extensions/VBoxNetAdp.kext -r /Library/Extensions/
        sudo kextload /Library/Extensions/VBoxUSB.kext -r /Library/Extensions/
}

case "$1" in
        unload|remove)
                unload
                ;;
        load)
                load
                ;;
        *|reload)
                unload
                load
                ;;
esac
If you have this problem, save this to a file somewhere on your hard drive, chmod -x it to make it executable, and then run it.
zabouti
Posts: 11
Joined: 20. May 2009, 04:33
Primary OS: Mac OS X Leopard
VBox Version: OSE other
Guest OSses: ubuntu-9.04-server

Re: Virtualbox fails to run.. kernel driver not loaded

Post by zabouti »

Thank you so much for googling that for me and saving me who knows how much time!! That worked perfectly.
jlb
Posts: 1
Joined: 7. Oct 2013, 17:45

Re: Virtualbox fails to run.. kernel driver not loaded

Post by jlb »

OMG thank you so much for posting this! :D
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Virtualbox fails to run.. kernel driver not loaded

Post by mpack »

Hmm. Might be worth making this a sticky, even though I don't have the means to test it... done.
ChipMcK
Volunteer
Posts: 1095
Joined: 20. May 2009, 02:17
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Windows, OSX
Location: U S of A

Re: Virtualbox fails to run.. kernel driver not loaded

Post by ChipMcK »

these are interesting Mac OS 10.9 Mavericks
and Ticket #8940
and Network Error... was working yesterday
and Changelog for VirtualBox 4.3 (8940)

edited to add ticket info
edited 20131010 to add Network Error... was working yesterday reference
edited 20131018 to add reference the v4.3 Changelog
Wolfie B
Posts: 3
Joined: 24. Oct 2013, 19:52

Re: Virtualbox fails to run.. kernel driver not loaded

Post by Wolfie B »

I've been running VirtualBox 4.3 since it was released, and had no problems with it on OS X Mountain Lion. Then, since I upgraded to OS X Mavericks, I've been having the kernel driver error.

Re-installing fixes the error until the next system restart, so isn't really a solution. So, I uninstalled Virtual Box using the VirtualBox_uninstall.tool that comes as part of the DMG, shut the system down, restarted and reinstalled VirtualBox 4.3. Since then, I don't get the kernel driver error - even after a system restart.

Worth noting that I did not lose any of my created VMs. They are stored on a NAS rather than on the same computer VirtualBox is installed on, so I don't know if the uninstall tool would delete VMs on the same computer. If you try this method, you may want to back up your VMs first.
stevemaser
Posts: 28
Joined: 6. Sep 2011, 20:48
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Windows 7

Re: Virtualbox fails to run.. kernel driver not loaded

Post by stevemaser »

Thank you for this tip. I was seeing the same problems after upgrading to the Mavericks GM. Your uninstall/reinstall method seems to have worked (so far).

- Steve
Yoc
Posts: 6
Joined: 5. Sep 2008, 14:01

Re: Virtualbox fails to run.. kernel driver not loaded

Post by Yoc »

Uninstalling and reinstalling did the trick for me as well.
Don't worry about the VM, they are not deleted with the uninstall procedure.
magadred
Posts: 1
Joined: 26. Oct 2013, 12:56

Re: Virtualbox fails to run.. kernel driver not loaded

Post by magadred »

Modified that kernel load unload script to be a bit more useful. Got tired of the uninstall - reinstall cycle.

Code: Select all

#!/bin/bash

unload() {
        if [ `ps -ef | grep -c VirtualBox$` -ne 0 ]
        then
                echo "VirtualBox still seems to be running. Please investigate!!"
                exit 1;
        elif [ `ps -ef | grep -c [V]ir` -gt 0 ]
        then
                echo "Stopping running processes before unloading Kernel Extensions"
                ps -ef | grep [V]ir | awk '{print $2}' | xargs kill
        fi
        echo "Unloading Kernel Extensions"
        kextstat | grep "org.virtualbox.kext.VBoxUSB" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxUSB
        kextstat | grep "org.virtualbox.kext.VBoxNetFlt" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxNetFlt
        kextstat | grep "org.virtualbox.kext.VBoxNetAdp" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxNetAdp
        kextstat | grep "org.virtualbox.kext.VBoxDrv" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxDrv
}

load() {
        echo "Loading Kernel Extentions"
        sudo kextload "/Library/Application Support/VirtualBox/VBoxDrv.kext" -r "/Library/Application Support/VirtualBox/"
        sudo kextload "/Library/Application Support/VirtualBox/VBoxNetAdp.kext" -r "/Library/Application Support/VirtualBox/"
        sudo kextload "/Library/Application Support/VirtualBox/VBoxNetFlt.kext" -r "/Library/Application Support/VirtualBox/"
        sudo kextload "/Library/Application Support/VirtualBox/VBoxUSB.kext" -r "/Library/Application Support/VirtualBox/"
}

case "$1" in
        unload|remove)
                unload
                ;;
        load)
                load
                ;;
        *|reload)
                unload
                load
                ;;
esac
Wolfie B
Posts: 3
Joined: 24. Oct 2013, 19:52

Re: Virtualbox fails to run.. kernel driver not loaded

Post by Wolfie B »

magadred wrote:Got tired of the uninstall - reinstall cycle.
I've obviously been quite lucky - I uninstalled / re-installed once and it has solved the problem permanently.

I did find that simply re-installing Virtual Box over the top of the existing installation was not enough; it had to be uninstalled first, using the uninstall tool provided (rather than just dragging to Trash as you normally would).
Niro Together
Posts: 1
Joined: 28. Oct 2013, 19:12

Re: Virtualbox fails to run.. kernel driver not loaded

Post by Niro Together »

I too have the same problem. Have followed previous posts in complete uninstall then full installation. I have noticed that when running Win 7 under VM (host Mavericks) Win 7 becoming unresponsive with mouse pointer showing the spiny rainbow wheel. I must add that normally run VM Win 7 at full size on separate monitor connected to MAC book pro via HDMI, now the screen scaling is off due to Mavericks top dock bar. Any suggestions would be great.....
rolandow
Posts: 2
Joined: 25. Oct 2013, 11:14

Re: Virtualbox fails to run.. kernel driver not loaded

Post by rolandow »

I uninstalled virtualbox using the uninstall tool that can be found in the dmg. I rebooted, and found that SmoothMouse is now working right at boot time. So apparently VirtualBox was conflicting with this??

Then I reinstalled VirtualBox. Indeed, all virtual machine's are still in the list.

Now the virtual machine's are able to boot, even the next time when I fire up my MBP. SmoothMouse isn't working though, I have to go to the settings again and use the slider to adjust the speed, then it's working again.

I also see the rainbow loader a lot. I found that when I press the left command key on my macbook pro, the loader immediately stops, and virtualbox is responsive. This only works on my MBP, if I use the command key on my keyboard that is attached, the loader remains. When has disappeared, I can use my normal keyboard.

So for now it kind of works. The loader appears every now and then, and also it seems that the screen of the guest OS isn't always updated. I found this when installing Ubuntu. But then again, pressing left command seems to kick VirtualBox alive, and make it responsive again.

I am using KeyRemap4MacBook, maybe this is conflicting. I didn't have this issue on mountain lion though.
hihiheping@qq.com
Posts: 1
Joined: 30. Oct 2013, 19:22

Re: Virtualbox fails to run.. kernel driver not loaded

Post by hihiheping@qq.com »

aegirth wrote:for Google's sake, thought I'd add here some code I found on Github that fixes this for me. It's a shell script that unloads all the Virtualbox kernel extensions and reloads them.

Code: Select all

!/bin/bash

unload() {
        kextstat | grep "org.virtualbox.kext.VBoxUSB" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxUSB
        kextstat | grep "org.virtualbox.kext.VBoxNetFlt" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxNetFlt
        kextstat | grep "org.virtualbox.kext.VBoxNetAdp" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxNetAdp
        kextstat | grep "org.virtualbox.kext.VBoxDrv" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxDrv
}

load() {
        sudo kextload /Library/Extensions/VBoxDrv.kext -r /Library/Extensions/
        sudo kextload /Library/Extensions/VBoxNetFlt.kext -r /Library/Extensions/
        sudo kextload /Library/Extensions/VBoxNetAdp.kext -r /Library/Extensions/
        sudo kextload /Library/Extensions/VBoxUSB.kext -r /Library/Extensions/
}

case "$1" in
        unload|remove)
                unload
                ;;
        load)
                load
                ;;
        *|reload)
                unload
                load
                ;;
esac
If you have this problem, save this to a file somewhere on your hard drive, chmod -x it to make it executable, and then run it.
这个脚本非常有用,使用的版本是virtualbox 4.2.18,能完美解决,重启后虚拟机不能启动的问题。如果换成4.3.0后会出现虚拟机关闭后,virtual vm进程假死。
Alwyn
Posts: 3
Joined: 14. Jul 2013, 11:03

Re: Virtualbox fails to run.. kernel driver not loaded

Post by Alwyn »

aegirth wrote:for Google's sake, thought I'd add here some code I found on Github that fixes this for me. It's a shell script that unloads all the Virtualbox kernel extensions and reloads them.

Code: Select all

!/bin/bash

unload() {
        kextstat | grep "org.virtualbox.kext.VBoxUSB" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxUSB
        kextstat | grep "org.virtualbox.kext.VBoxNetFlt" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxNetFlt
        kextstat | grep "org.virtualbox.kext.VBoxNetAdp" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxNetAdp
        kextstat | grep "org.virtualbox.kext.VBoxDrv" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxDrv
}

load() {
        sudo kextload /Library/Extensions/VBoxDrv.kext -r /Library/Extensions/
        sudo kextload /Library/Extensions/VBoxNetFlt.kext -r /Library/Extensions/
        sudo kextload /Library/Extensions/VBoxNetAdp.kext -r /Library/Extensions/
        sudo kextload /Library/Extensions/VBoxUSB.kext -r /Library/Extensions/
}

case "$1" in
        unload|remove)
                unload
                ;;
        load)
                load
                ;;
        *|reload)
                unload
                load
                ;;
esac
If you have this problem, save this to a file somewhere on your hard drive, chmod -x it to make it executable, and then run it.
I'm afraid this is all quite beyond me. Can't somebody adapt Virtual Box so that it works as it did before Mavericks came along?
Post Reply