Ubuntu – Cannot run virtual machines after upgrading virtualbox from 5.0 to 5.1

16.04virtualboxvirtualbox-networking

after upgrading from virtualbox 5.0 to 5.1 , when i try to run my old virtual machines i get this error

NS_ERROR_FAILURE (0x80004005)

I am using ubuntu 16.04 as my host machine

Looking at other tutorials i have tried running

sudo /etc/init.d/vboxdrv setup

But no command exists

Best Answer

Seeing this, I had to add to the last answer as there is some possible improvement.

If you removed virtualbox 5.0 and upgraded to 5.1, there may be some packages that were not fully removed.

Here is what works best if you want to keep everything fine without any corrupt packages:

  • close virtualbox

  • remove Virtualbox 5.1

    sudo apt-get remove virtualbox-5.1
    
  • Remove all unused packages, which will remove some Virtualbox packages. It may also remove more packages and previous linux headers if you upgraded and did not run this command before.

    sudo apt-get autoremove
    
  • Make sure there is nothing left from virtualbox

    sudo apt-get purge virtualbox virtualbox-qt
    
  • Reinstall virtualbox 5.1 (or virtualbox, if you want 5.0)

    sudo apt-get install virtualbox-5.1
    

    or

    sudo apt-get install virtualbox
    
  • Configure virtualbox

    sudo vboxconfig
    

If you want to rollback, you may use the same process, but install virtualbox instead of virtualbox-5.1, but if you add some virtualbox modules installed like guest additions, you may have to reconfigure it.

Related Question