Установка VirtualBox на Ubuntu 18.04 завершается неудачно

Чтобы установить VirtualBox (в основном, как описано здесь) на мою машину с Ubuntu 18.04, я запускаю следующие команды

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     

Все они работают нормально. Но для

sudo apt-get install virtualbox-5.2

Я получил ошибку:

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 по умолчанию, при установке возвращается ошибка, которая точно описана здесь.

После установки я не могу запустить любую виртуальную машину (например, NAME) и я получил ошибку

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.50GHz а также grep -E "svm|vmx" /proc/cpuinfo | wc -l возвращает 4.

Как предполагает Melebius, здесь полный вывод после запуска sudo dpkg-reconfigure virtualbox-dkms:

-------- 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.

Что я делаю неправильно?

1 ответ

Решение

Я столкнулся с той же проблемой. Я предлагаю вам отключить TPM и SecureBoot в настройках UEFI.

Другие вопросы по тегам