"FATAL: Module vboxdrv not found in directory /lib/modules/4.10.0-20-generic"

Try do reinstall "virtualbox-dkms"

sudo apt install --reinstall virtualbox-dkms

For me, reinstalling virtualbox-dkms always gave an error. It was my first time upgrading the kernel, and hadn't upgraded the headers. I needed to also do

sudo aptitude install linux-headers-`uname -r`

and not accept it's first solution (which was to actually do nothing), but accept the second solution which was to upgrade some further library. After that, then

sudo apt install --reinstall virtualbox-dkms

worked for me.


Reinstallation as mentioned above - had not helped me (within (X)Ubuntu 18.04, with the recently updated kernel). What worked in my case:

  1. Setup key with:

    wget -q -O - http://download.virtualbox.org/virtualbox/debian/oracle_vbox_2016.asc | sudo apt-key add -
    
  2. Setup repository with:

    sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian cosmic non-free contrib" >> /etc/apt/sources.list.d/virtualbox.org.list'
    
  3. Download and install the latest version of VirtualBox (with all the extra packages) from this link.

Tags:

Virtualbox