VirtualBox is complaining that the kernel module is not loaded Ubuntu 18.04


Upgraded my ubuntu 18.04 and virtualbox stopped working. The following error was thrown:

The provider ‘virtualbox’ that was requested to back the machine
‘default’ is reporting that it isn’t usable on this system. The
reason is shown below:

VirtualBox is complaining that the kernel module is not loaded. Please
run `VBoxManage –version` or open the VirtualBox GUI to see the error
message which should contain instructions on how to fix this error.


  • Run VBoxManage –version

$ VBoxManage –version
WARNING: The vboxdrv kernel module is not loaded. Either there is no module
available for the current kernel (4.15.0-91-generic) or it failed to
load. Please recompile the kernel module and install it by

sudo /sbin/vboxconfig

You will not be able to start VMs until this problem is fixed.

  • The recompile the virtualbox kernel module

$ sudo /sbin/vboxconfig
[sudo] password for jeremyo:
Sorry, try again.
[sudo] password for jeremyo: Stopping VirtualBox services. Starting VirtualBox services. Building VirtualBox kernel modules.


Installing virtualbox plus GUI ubuntu 16.04


Had virtual box installed and was using it from the command line. The process of creating a new virtual machine using this approach proved difficult. Tools like vagrant make this process easier but I needed to share this image with a non vagrant user.


Installed the default version of virtualbox that comes with ubuntu 16.04.

When I tried installing the latest version of virtual box, I would get the following error when starting a newly defined image:

Failed to open a session for the virtual machine bandago.

The virtual machine 'vmImage' has terminated unexpectedly during startup with exit code 1 (0x1).

Result Code: NS_ERROR_FAILURE (0x80004005)
Component: MachineWrap
Interface: IMachine {85cd948e-a71f-4289-281e-0ca7ad48cd89}

The solution maybe to after installing virtualbox, additionally installing the following packages:

(I never got to test this though)





Install virtualbox and the above packages:

imela@whiscardz ~ $ sudo apt-get install virtualbox virtualbox-guest-additions-iso virtualbox-qt
Reading package lists... Done
Building dependency tree
Reading state information... Done
virtualbox is already the newest version (5.1.38-dfsg-0ubuntu1.16.04.2).
The following NEW packages will be installed:
virtualbox-guest-additions-iso virtualbox-qt
0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
Need to get 47.4 MB of archives.
After this operation, 87.4 MB of additional disk space will be used.
Do you want to continue? [Y/n]

Note: After defining a new vm, when it’s time to link the ISO, double click on the vm definition and then select the iso.


Creating a Virtual Machine

Installing Oracle VM VirtualBox and Extension Packs

Oracle Linux_Downloads

How to Install VirtualBox 5.2 on Ubuntu 16.04 LTS

Exporting and Importing Virtual Box Images


Needed to save a virtual box image to be shared with someone else


Using vboxmanage command line to export the image and then test importing the image.


  • First list the virtual box images available

imela@whiscardz$ vboxmanage list vms
"test_default_1549514247520_18667" {6e29d56a-6531-4274-9d91-c6719e9fdaf3}
  • Then export the image you want to a file

imela@whiscardz$ vboxmanage export test_default_1549514247520_18667 -o test_default_1549514247520_18667.ova

  • Then copy it to the machine that you want to import the image.
  • Finally import the image.

imela@whiscardz2$ vboxmanage import test_default_1549514247520_18667.ova

Potential Issues

When I tried exporting to a file name other than the name of the image, it failed and threw the error below (it could be the extention):

imela@whiscardz2$ vboxmanage export test_default_1549514247520_18667 --output otherFileName.ovf
Progress state: VBOX_E_IPRT_ERROR
VBoxManage: error: Appliance write failed
VBoxManage: error: RTVfsFsStrmAdd failed for 'otherFileName.ovf' (VERR_ALREADY_EXISTS)
VBoxManage: error: Details: code VBOX_E_IPRT_ERROR (0x80bb0005), component ApplianceWrap, interface IAppliance
VBoxManage: error: Context: "RTEXITCODE handleExportAppliance(HandlerArg*)" at line 1263 of file VBoxManageAppliance.cpp


How to export and import VirtualBox VM images?

VBoxManage registervm/unregistervm

Export to OVF

VBoxManage export

VBoxManage import

virtualbox commandline options

Update 2019-01-15


Also needed to delete virtual box images that were not being used via the command line


  • First list the vms

$ VBoxManage list vms
"20180126" {00953737-12d0-49eb-a1d2-c749047ccacf}
"1519895285801_90671" {ac82a1dc-ef6b-40de-8a35-ce4dbee3e6e3}
"1522057779833_1088" {87021084-3202-4131-8f9c-5839774140a8}
  • Use the unregistervm flag along with the –delete option to delete the vm and it’s associated files.

$ vboxmanage unregistervm {ac82a1dc-ef6b-40de-8a35-ce4dbee3e6e3} --delete


Needed a way to be able to start and stop GuestOS on virtualbox using the commandline.


  • First list the vms

$ VBoxManage list runningvms
"academy_default_1522238466753_84362" {3a36e205-e8e2-4a96-b9c3-9f76f2ad17e5}

Here are some more options that can be used with the list command. NB If your vm was started with a specific user then running list without switching to the user that started the vm causes the result to be blank:

~$ vboxmanage list

VBoxManage list [--long|-l] [--sorted|-s] vms|runningvms|ostypes|hostdvds|hostfloppies|

  • Then shutdown the vms

~$ vboxmanage controlvm "academy_default_1522238466753_84362" poweroff
:~$ vboxmanage list runningvms


vboxmanage command line options

How to safely shutdown Guest OS in VirtualBox using command line

How to automatically start and shut down VirtualBox machines?

VBoxManage control and manage Virtualbox from command line

How to run VirtualBox virtual machines from the command line

VBoxManage registervm/unregistervm or delete vm


Virtual Box – Port Forward Guest to Host


Needed to assess a web port on the Guest VM on Virtual Box.


From the virtualbox manager gui, right click on the vm, click on settings, then click on network. Select NAT, then click on advanced and then port forwarding.

Choose a host port, the guest port should be port 80. You dont have the include the guest and host ip as this will allow connections from any host.

Update 2019 March 06

You need to choose a large number for the port on the host otherwise vbox might not allow you to port forward to a lower port number such as 222.

Use NAT and then port forward Guest to Host
Guest to Host port forwarding using NAT


How to access a NAT guest from host with VirtualBox

NAT Port Forwarding in VirtualBox

How to Forward Ports to a Virtual Machine and Use It as a Server

How To: Port Forwarding on VirtualBox