如何安装virtualbox-dkms?

尝试安装虚拟机内核模块时出现以下错误:

------------------------------ Deleting module version: 4.1.18 completely from the DKMS tree. ------------------------------ Done. Loading new virtualbox-4.1.18 DKMS files... Building only for 3.5.0-17-generic Module build for the currently running kernel was skipped since the kernel source for this kernel does not seem to be installed. 

我尝试安装linux-source包,但不确定ubuntu如何处理内核源代码和头文件。 有关如何从Ubuntu角度进行此操作的任何想法?

我的Virtual Box告诉我没有安装内核驱动程序。 我运行apt-get remove virtualbox-dkms来删除驱动程序,然后重新安装它们( apt-get install virtualbox-dkms )重建了驱动程序,我能够运行虚拟机而没有任何问题

其他方式:

 apt-get install linux-headers-`uname -r` dpkg-reconfigure virtualbox-dkms 

正常方式:

 /etc/init.d/vboxdrv setup 

您还需要内核头。 根据你的输出,sudo apt-get install kernel-headers-3.5.0-17-generic应该这样做。 在来宾VM上,自动运行ISO映像或sudo sh ./VBoxLinuxAdditions.run应该在shell提示符下工作。 出现这是最新12.10版本的已知问题。

不适合我。 通过运行解决它:

 gksudo synaptic 

搜索“dkms”并(重新)安装VirtualBox并按“应用”按钮。 输出应该说虚拟机内核驱动程序已启动并正在运行。