[Linux] VirtualBox 出現 Kernel driver not installed 錯誤

[Linux] VirtualBox 出現 Kernel driver not installed 錯誤

今天想要開啟 CentOS 7 上面的 VirtualBox VM 時,

突然跳出了 Kernel driver not installed (rc=-1908) 的錯誤訊息:

Screenshot from 2015-05-04 11:22:02  

 

可能是 Linux kernel 有更新,導致 VirtualBox 的 kernel driver 必須重新編譯~

照著上面的說明修正了一下,VM 又可以跑囉~

 

1. 安裝 dkms 模組

DKMS (Dynamic Kernel Module Support) 這個模組是在 kernel 有改變時,

自動重新編譯相關連的 kernel module,

這樣就不用每次 kernel 一改變時,就又看到上面的錯誤訊息視窗了~

用 yum 裝一下吧:

sudo yum install dkms

 

2. 重新編譯 VirtualBox Kernel modules 

上面步驟 1 應該是作好以後,以後有 kernel 更新時,

不用再重新編譯 VirtualBox kernel module,

不過現在這一次還是得自己做~

用 root 執行 /etc/init.d/vboxdrv setup:

root@localhost /etc/yum.repos.d # /etc/init.d/vboxdrv setup
Stopping VirtualBox kernel modules                         [  OK  ]
Uninstalling old VirtualBox DKMS kernel modulesldconfig: Can't create temporary cache file /etc/ld.so.cache~: Permission denied
ldconfig exited ungracefully
Error! There are no instances of module: vboxhost
4.3.14 located in the DKMS tree.
                                                           [  OK  ]
Trying to register the VirtualBox kernel modules using DKMSldconfig: Can't create temporary cache file /etc/ld.so.cache~: Permission denied
ldconfig exited ungracefully
[  OK  ]
Starting VirtualBox kernel modules                         [  OK  ]

 

嗯… 出現了奇怪的 Permission denied 問題…

在網路上查了一下,是說先把 SELinux 關掉,再執行就可以了:

root@localhost /etc/yum.repos.d # setenforce 0
root@localhost /etc/yum.repos.d # /etc/init.d/vboxdrv setup
Stopping VirtualBox kernel modules                         [  OK  ]
Uninstalling old VirtualBox DKMS kernel modulesError! There are no instances of module: vboxhost
4.3.14 located in the DKMS tree.
[  OK  ]
Trying to register the VirtualBox kernel modules using DKMS[  OK  ]
Starting VirtualBox kernel modules                         [  OK  ]

 

 

 

(本頁面已被瀏覽過 612 次)

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料