2

In order to install VirtualBox (basically as it is described here) on my Ubuntu 18.04 machine, I run the following commands

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     

All of them run fine. But for

sudo apt-get install virtualbox-5.2

I got the error:

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.

When I use the default Ubuntu repository, the installation returns the error which is exactly described here.

After the installation, I cannot start any VM (e.g. NAME) and I got the error

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)

Of course, virtualbox-dkms package is installed.

The model name (cat /proc/cpuinfo | grep "model name" | uniq) is Intel(R) Core(TM) i5-6500T CPU @ 2.50GHz and grep -E "svm|vmx" /proc/cpuinfo | wc -l returns 4.

As suggested by Melebius, here the full output after running 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.

What am I doing wrong?

12
  • As far as I understood I need the [arch=amd64] in order to avoid the error message N: Skipping acquire of configured file 'contrib/binary-i386/Packages' as repository 'http://download.virtualbox.org/virtualbox/debian bionic InRelease' doesn't support architecture 'i386'. Aug 14, 2018 at 12:45
  • 1
    Possible duplicate of Unable to correct problems, you have held broken packages
    – Melebius
    Aug 14, 2018 at 12:46
  • Thanks for the related post, but this means the official instructions made by Oracle are not working! Aug 14, 2018 at 12:56
  • You could get virtualbox-5.2 using the default Ubuntu repository. I wouldn’t bother with 3rd party repositories unless there is an important improvement in the version provided by them.
    – Melebius
    Aug 14, 2018 at 13:03
  • 1
    Did you forget to enable CPU virtualization in BIOS? Are you sure that your CPU supports it? Please add output of cat /proc/cpuinfo | grep "model name" | uniq and grep -E "svm|vmx" /proc/cpuinfo | wc -l to the question.
    – N0rbert
    Aug 14, 2018 at 13:49

1 Answer 1

3

I was facing the same issue. I suggest you disable TPM and SecureBoot in your UEFI settings.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.