在 Ubuntu 上启动 VirtualBox 时出错

在 Ubuntu 上启动 VirtualBox 时出错

我正在使用 Ubuntu,并且尝试安装 virtualbox。但我收到此错误。如果有人知道如何解决这个问题,请告诉我。

Error:
WARNING: The vboxdrv kernel module is not loaded. Either there is no module
available for the current kernel (2.6.32-042stab092.2) or it failed to
load. Please recompile the kernel module and install it by

   sudo /etc/init.d/vboxdrv setup

You will not be able to start VMs until this problem is fixed.

*编辑:ThomasW 回答后出现:

ERROR ON LOG: Error log file:
Uninstalling modules from DKMS
Attempting to install using DKMS
Failed to install using DKMS, attempting to install without
Makefile:183: *** Error: unable to find the sources of your current Linux kernel.
Specify KERN_DIR=<directory> and run Make again. Stop

答案1

您需要运行错误中提供的命令,并重新编译它。

首先,通过安装build-essential来获取构建事物所需的基本库:

sudo apt-get install build-essential

接下来,运行错误指定的命令:

sudo /etc/init.d/vboxdrv setup

答案2

首先,请先阅读 Thomas W. 的回答:

sudo apt-get install build-essential

其次是

sudo /etc/init.d/vboxdrv setup 

要修复您的错误,请运行:

sudo apt-get install linux-generic linux-headers-generic

答案3

对我有用的是:

sudo apt-get install linux-headers-amd64 

用你的架构替换 amd64。

相关内容