VisualBox之因此在Linux上比傳統的VMware快得多,關鍵一點就是它和Linux內核的結合比較緊密,這也是開源的優勢。html
不過Linux內核更新很頻繁,每次更新內核後啓動VirtualBox都會提示:linux
VirtualBox kernel driver not installed. The vboxdrv kernel module was either not loaded or /dev/vboxdrv was not created for some reason. Re-setup the kernel module by executing ‘/etc/init.d/vboxdrv setup’ as root.spa
因此須要從新編譯VirtualBox的內核,Ubuntu下執行以下命令:orm
sudo /etc/init.d/vboxdrv setuphtm
若是提示blog
* Stopping VirtualBox kernel modules [ OK ]
* Uninstalling old VirtualBox DKMS kernel modules [ OK ]
* Trying to register the VirtualBox kernel modules using DKMS
* Failed, trying without DKMS
* Recompiling VirtualBox kernel modules
* Look at /var/log/vbox-install.log to find out what went wrongci
找到/var/log/vbox-install.log文件,內容大體爲:get
Makefile:172: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again. Stop.it
因此須要安裝當前Linux內核的源文件,編譯VirtualBox內核的時候須要它,Ubuntu下執行以下命令安裝當前Linux內核的源文件:io
sudo apt-get install linux-headers-`uname -r`
注意括起uname -r的不是單引號,而是Esc鍵下面的那個符號。
而後再編譯VirtualBox內核執行以下命令:
sudo /etc/init.d/vboxdrv setup