首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Ubuntu18.04上安装VirtualBox失败

在Ubuntu18.04上安装VirtualBox失败
EN

Ask Ubuntu用户
提问于 2018-08-14 12:19:15
回答 1查看 9K关注 0票数 2

为了在我的Ubuntu18.04机器上安装VirtualBox (基本上是这里),我运行以下命令

代码语言:javascript
复制
echo "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian bionic contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
sudo apt-get update     

他们都跑得很好。而是为了

代码语言:javascript
复制
sudo apt-get install virtualbox-5.2

我发现了一个错误:

代码语言:javascript
复制
The following packages have unmet dependencies:
 virtualbox-5.2 : Depends: libqt5opengl5 (>= 5.0.2) but it is not installable
                  Depends: libqt5printsupport5 (>= 5.0.2) but it is not installable
                  Depends: libqt5x11extras5 (>= 5.6.0) but it is not installable
                  Depends: libsdl1.2debian (>= 1.2.11) but it is not installable
                  Recommends: libsdl-ttf2.0-0 but it is not installable
E: Unable to correct problems, you have held broken packages.

当我使用默认的Ubuntu存储库时,安装将返回准确描述为这里的错误。

安装之后,我无法启动任何VM (例如NAME),并且得到了错误

代码语言:javascript
复制
WARNING: The character device /dev/vboxdrv does not exist.
     Please install the virtualbox-dkms package and the appropriate
     headers, most likely linux-headers-generic.

     You will not be able to start VMs until this problem is fixed.
Waiting for VM "NAME" to power on...
VBoxManage: error: The virtual machine 'NAME' has terminated unexpectedly during startup with exit code 1 (0x1)

当然,已经安装了virtualbox-dkms包。

模型名(cat /proc/cpuinfo | grep "model name" | uniq)为Intel(R) Core(TM) i5-6500T CPU @ 2.50GHzgrep -E "svm|vmx" /proc/cpuinfo | wc -l返回4。

正如梅莱比乌斯所建议的,在这里运行sudo dpkg-reconfigure virtualbox-dkms后的完整输出:

代码语言:javascript
复制
-------- Uninstall Beginning --------
Module:  virtualbox
Version: 5.2.10
Kernel:  4.15.0-30-generic (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

vboxdrv.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.15.0-30-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxnetadp.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.15.0-30-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxnetflt.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.15.0-30-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxpci.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.15.0-30-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

depmod...

DKMS: uninstall completed.

-------- Uninstall Beginning --------
Module:  virtualbox
Version: 5.2.10
Kernel:  4.15.0-33-generic (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

vboxdrv.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.15.0-33-generic/
rmdir: failed to remove '': No such file or directory
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxnetadp.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.15.0-33-generic/
rmdir: failed to remove '': No such file or directory
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxnetflt.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.15.0-33-generic/
rmdir: failed to remove '': No such file or directory
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxpci.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.15.0-33-generic/
rmdir: failed to remove '': No such file or directory
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

depmod...

DKMS: uninstall completed.

------------------------------
Deleting module version: 5.2.10
completely from the DKMS tree.
------------------------------
Done.
Loading new virtualbox-5.2.10 DKMS files...
Building for 4.15.0-30-generic 4.15.0-33-generic
Building initial module for 4.15.0-30-generic
Done.

vboxdrv:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.15.0-30-generic/updates/dkms/

vboxnetadp.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.15.0-30-generic/updates/dkms/

vboxnetflt.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.15.0-30-generic/updates/dkms/

vboxpci.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.15.0-30-generic/updates/dkms/

depmod...

DKMS: install completed.
Building initial module for 4.15.0-33-generic
Done.

vboxdrv:
Running module version sanity check.
modinfo: ERROR: could not get modinfo from 'vboxdrv': Invalid argument
 - Original module
 - Installation
   - Installing to /lib/modules/4.15.0-33-generic/updates/dkms/

vboxnetadp.ko:
Running module version sanity check.
modinfo: ERROR: could not get modinfo from 'vboxnetadp': Invalid argument
 - Original module
 - Installation
   - Installing to /lib/modules/4.15.0-33-generic/updates/dkms/

vboxnetflt.ko:
Running module version sanity check.
modinfo: ERROR: could not get modinfo from 'vboxnetflt': Invalid argument
 - Original module
 - Installation
   - Installing to /lib/modules/4.15.0-33-generic/updates/dkms/

vboxpci.ko:
Running module version sanity check.
modinfo: ERROR: could not get modinfo from 'vboxpci': Invalid argument
 - Original module
 - Installation
   - Installing to /lib/modules/4.15.0-33-generic/updates/dkms/

depmod...

DKMS: install completed.
Job for virtualbox.service failed because the control process exited with error code.
See "systemctl status virtualbox.service" and "journalctl -xe" for details.
invoke-rc.d: initscript virtualbox, action "restart" failed.
● virtualbox.service - LSB: VirtualBox Linux kernel module
   Loaded: loaded (/etc/init.d/virtualbox; generated)
   Active: failed (Result: exit-code) since Mon 2018-08-27 15:38:36 UTC; 5ms ago
     Docs: man:systemd-sysv-generator(8)
  Process: 9229 ExecStart=/etc/init.d/virtualbox start (code=exited, status=1/FAILURE)

Aug 27 15:38:36 cmsuite-build-machine systemd[1]: Starting LSB: VirtualBox Linux kernel module...
Aug 27 15:38:36 cmsuite-build-machine virtualbox[9229]:  * Loading VirtualBox kernel modules...
Aug 27 15:38:36 cmsuite-build-machine virtualbox[9229]:  * modprobe vboxdrv failed. Please use 'dmesg' to find out why
Aug 27 15:38:36 cmsuite-build-machine virtualbox[9229]:    ...fail!
Aug 27 15:38:36 cmsuite-build-machine systemd[1]: virtualbox.service: Control process exited, code=exited status=1
Aug 27 15:38:36 cmsuite-build-machine systemd[1]: virtualbox.service: Failed with result 'exit-code'.
Aug 27 15:38:36 cmsuite-build-machine systemd[1]: Failed to start LSB: VirtualBox Linux kernel module.

我做错了什么?

EN

回答 1

Ask Ubuntu用户

回答已采纳

发布于 2018-08-27 16:21:49

我也面临着同样的问题。我建议您在UEFI设置中禁用TPM和SecureBoot。

票数 3
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1065275

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档