将 Linux Mint 升级到 17.1 后,VirtualMachine 5 无法工作

将 Linux Mint 升级到 17.1 后,VirtualMachine 5 无法工作

在我提出问题之前,我花了两个星期的时间来解决它,但我做不到。

所以我来这里帮助我,因为我在主机中有重要的文件。

当我运行 virtualbox 并尝试运行 Windows 机器时出现此错误:

Failed to open a session for the virtual machine Windows 8.1 (AboSami).

The virtual machine 'Windows 8.1 (AboSami)' has terminated unexpectedly during startup with exit code 1 (0x1).
Result Code: NS_ERROR_FAILURE (0x80004005)
Component: MachineWrap
Interface: IMachine {f30138d4-e5ea-4b3a-8858-a059de4c93fd}

当我进入终端并输入 virtualbox: 时出现此错误

WARNING: The vboxdrv kernel module is not loaded. Either there is no module
         available for the current kernel (3.16.0-25-generic) 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.

(VirtualBox:10912): Gtk-CRITICAL **: IA__gtk_widget_get_direction: assertion 'GTK_IS_WIDGET (widget)' failed

(VirtualBox:10912): Gtk-CRITICAL **: IA__gtk_widget_get_direction: assertion 'GTK_IS_WIDGET (widget)' failed

之后我运行这个命令:sudo /etc/init.d/vboxdrv setup

Stopping VirtualBox kernel modules ...done.
Uninstalling old VirtualBox DKMS kernel modules ...done.
Trying to register the VirtualBox kernel modules using DKMSError! echo
Your kernel headers for kernel 3.16.0-25-generic cannot be found at
/lib/modules/3.16.0-25-generic/build or /lib/modules/3.16.0-25-generic/source.
 ...failed!
  (Failed, trying without DKMS)
Recompiling VirtualBox kernel modules ...failed!
  (Look at /var/log/vbox-install.log to find out what went wrong)

然后我转到 /var/log/vbox-install.log

Uninstalling modules from DKMS
  removing old DKMS module vboxhost version  5.0.4

------------------------------
Deleting module version: 5.0.4
completely from the DKMS tree.
------------------------------
Done.
Attempting to install using DKMS

Creating symlink /var/lib/dkms/vboxhost/5.0.4/source ->
                 /usr/src/vboxhost-5.0.4

DKMS: add completed.
Failed to install using DKMS, attempting to install without
Makefile:185: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again.  Stop.

uname -r

Linux MajeedLinux 3.16.0-25-generic #33-Ubuntu SMP Fri Nov 7 01:53:40 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=17.1
DISTRIB_CODENAME=rebecca
DISTRIB_DESCRIPTION="Linux Mint 17.1 Rebecca"
NAME="Ubuntu"
VERSION="14.04.3 LTS, Trusty Tahr"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 14.04.3 LTS"
VERSION_ID="14.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
cat: /etc/upstream-release: Is a directory

来源列表

#deb cdrom:[Linux Mint 17.1 _Rebecca_ - Release amd64 20150107]/ utopic contrib main non-free
        deb http://packages.linuxmint.com qiana main upstream import #id:linuxmint_main
           deb http://extra.linuxmint.com qiana main #id:linuxmint_extra
           deb http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
           deb http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
           deb http://security.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
           deb http://archive.canonical.com/ubuntu/ trusty partner

抱歉,我的英语不好,如果有人能帮助我,请帮忙。

========================================

apt-cache 策略 linux-headers-generic

linux-headers-generic:
  Installed: 3.13.0.63.71
  Candidate: 3.13.0.63.71
  Version table:
 *** 3.13.0.63.71 0
        500 http://archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
        100 /var/lib/dpkg/status
     3.13.0.24.28 0
        500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages

apt-cache 显示 linux-headers-generic

Package: linux-headers-generic
Priority: optional
Section: devel
Installed-Size: 29
Maintainer: Ubuntu Kernel Team <[email protected]>
Architecture: amd64
Source: linux-meta
Version: 3.13.0.63.71
Depends: linux-headers-3.13.0-63-generic
Filename: pool/main/l/linux-meta/linux-headers-generic_3.13.0.63.71_amd64.deb
Size: 2380
MD5sum: 1d57e3d8b3dc262af709dfc98ba82cc1
SHA1: ea82b800783c945cd0dc37f66e21b6b5d4290c81
SHA256: 8712a621d35d3e05f7e1d814e4c7ad5d848d7fffa3bebe99f73f296f8852716f
Description-en: Generic Linux kernel headers
 This package will always depend on the latest generic kernel headers
 available.
Description-md5: 9c9742ab9c289b1e900fab477bc0070d
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
Supported: 5y
Task: ubuntu-live, kubuntu-live, kubuntu-active-live, edubuntu-dvd-live, xubuntu-live, mythbuntu-live, lubuntu-live, ubuntu-gnome-live

Package: linux-headers-generic
Priority: optional
Section: devel
Installed-Size: 27
Maintainer: Ubuntu Kernel Team <[email protected]>
Architecture: amd64
Source: linux-meta
Version: 3.13.0.24.28
Depends: linux-headers-3.13.0-24-generic
Filename: pool/main/l/linux-meta/linux-headers-generic_3.13.0.24.28_amd64.deb
Size: 2314
MD5sum: 670c9305200ecd72c323a28abb64f8b2
SHA1: 3dbe6e886bae5484538947f0e6b76271d3185120
SHA256: 01f177e7a799bf4d80b69a1be9a33200527dae15e7fbbc4b9beaa6a070694a93
Description-en: Generic Linux kernel headers
 This package will always depend on the latest generic kernel headers
 available.
Description-md5: 9c9742ab9c289b1e900fab477bc0070d
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
Supported: 5y
Task: ubuntu-live, kubuntu-live, kubuntu-active-live, edubuntu-dvd-live, xubuntu-live, mythbuntu-live, lubuntu-live, ubuntu-gnome-live

答案1

我解决了这个问题,我重新安装了 virtualbox-dkms 并重新启动了电脑

sudo apt-get --reinstall install virtualbox-dkms

谢谢@nephente

答案2

无法构建模块的原因正如错误所暗示的,是缺少内核头文件。

使用以下方式安装

sudo apt-get install linux-headers-generic

它将安装一个元包,该元包始终指向存储库中最新的内核头文件。如果在系统更新期间有新内核可用并安装,则相应的头文件也将自动安装。

之后,尝试vboxdrv再次安装模块。

相关内容