22

Running the sudo sh vboxsign.sh and getting "FATAL: Module vboxdrv not found in directory /lib/modules/4.10.0-20-generic"

What am I missing? This ran fine last time, but I've since upgraded, and must have forgotten something. I set working directory correctly.

17

Try do reinstall "virtualbox-dkms"

sudo apt install --reinstall virtualbox-dkms
| improve this answer | |
  • 2
    Worked! For edification, will you explain why that likely fixed the problem? – Tom Mercer May 8 '17 at 1:57
  • 2
    I get: E: Unable to locate package virtualbox-dkms. I have added virtualbox to my sources list, any ideas why this is? – Christopher John Feb 28 '19 at 13:02
3

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.

| improve this answer | |
2

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.

| improve this answer | |
2

Based on other answers and the Virtualbox official documentation, here is something that worked:

sudo apt-get install build-essential linux-headers-`uname -r`
sudo apt-get install autoconf automake bc bison build-essential flex gcc g++ make python -y
sudo apt-get purge virtualbox

sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian $(lsb_release -c | cut -f2) non-free contrib" >> /etc/apt/sources.list.d/virtualbox.org.list'

wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
sudo apt-get update
sudo apt-get install virtualbox-6.0
| improve this answer | |
0

i had the same problem after updating Kernel to 5.4.0-37 and i faced some problems worth mentioning:

turns out you can't install Guest additions using old versions of Virtual-box (i guess any version before 5.2) while using this new kernel and Virtualbox-dkms is not supported anymore. the only way to solve the problem is to remove old version and install Virtual-box 6 from Oracle but this code:sudo apt-get purge virtualbox leaves some stuff behind.

after using purge to remove Virtualbox, search "virtualbox" in system directory (/) and manually remove everything then install Virtualbox 6 and Guest addition.

that worked for me.

| improve this answer | |

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