How to install VirtualBox in Debian 8?

11,609

Use the Debian jessie-backports virtualbox package. The version is 5.0.14-dfsg-1~bpo8+1. I'm using it with zero problems on my AMD64 Jessie installation. Make sure you get rid of all other related packages and local installations first, of course.

To install, add:

deb httpredir.debian.org/debian jessie-backports main contrib non-free

to your /etc/apt/sources.list. Then run apt-get update. To install, do

apt-get install -t jessie-backports virtualbox

For the record, these are the versions of virtualbox currently available in Debian, for jessie and later.

apt-cache policy virtualbox
virtualbox:
  Installed: 5.0.14-dfsg-1~bpo8+1
  Candidate: 5.0.14-dfsg-1~bpo8+1
  Version table:
     5.0.14-dfsg-2+b1 0
         50 tor+http://httpredir.debian.org/debian/ unstable/contrib amd64 Packages
 *** 5.0.14-dfsg-1~bpo8+1 0
        100 tor+http://httpredir.debian.org/debian/ jessie-backports/contrib amd64 Packages
        100 /var/lib/dpkg/status
     4.3.36-dfsg-1+deb8u1 0
        500 tor+http://security.debian.org/ jessie/updates/contrib amd64 Packages
     4.3.32-dfsg-1+deb8u2 0
        500 tor+http://httpredir.debian.org/debian/ jessie/contrib amd64 Package

This list does not include the testing version.

Share:
11,609

Related videos on Youtube

Flare Cat
Author by

Flare Cat

I am a 15 year old student, that enjoys programming in C++. Youtube: https://www.youtube.com/channel/UC5W7n0gefWSWXBqefZPrgLQ/

Updated on September 18, 2022

Comments

  • Flare Cat
    Flare Cat over 1 year

    So, I have been crying for hours over this. I have been trying to install virtual box 5.0 in 64-bit Debian Jessie, and for the life of me can not figure it out. I have tried installing it from .deb, source, and then I found this, all to no avail. This last one seemed to be the most promising, so I decided to go with it. I updated my sources.list file, ran wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -, and then finally:

    sudo apt-get update
    sudo apt-get install virtualbox-5.0 
    

    Well, on the last command I get the following output (keep in mind I have already done sudo apt-get install linux-headers-$(uname -r)):

    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following extra packages will be installed:
      libsdl-ttf2.0-0
    Recommended packages:
      linux-headers
    The following NEW packages will be installed:
      libsdl-ttf2.0-0 virtualbox-5.0
    0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
    Need to get 0 B/64.1 MB of archives.
    After this operation, 158 MB of additional disk space will be used.
    Do you want to continue? [Y/n] y
    Preconfiguring packages ...
    Selecting previously unselected package libsdl-ttf2.0-0:amd64.
    (Reading database ... 238408 files and directories currently installed.)
    Preparing to unpack .../libsdl-ttf2.0-0_2.0.11-3_amd64.deb ...
    Unpacking libsdl-ttf2.0-0:amd64 (2.0.11-3) ...
    Selecting previously unselected package virtualbox-5.0.
    Preparing to unpack .../virtualbox-5.0_5.0.14-105127~Debian~jessie_amd64.deb ...
    Unpacking virtualbox-5.0 (5.0.14-105127~Debian~jessie) ...
    Processing triggers for systemd (215-17+deb8u3) ...
    Processing triggers for hicolor-icon-theme (0.13-1) ...
    Processing triggers for shared-mime-info (1.3-1) ...
    Processing triggers for desktop-file-utils (0.22-1) ...
    Processing triggers for gnome-menus (3.13.3-6) ...
    Processing triggers for mime-support (3.58) ...
    Setting up libsdl-ttf2.0-0:amd64 (2.0.11-3) ...
    Setting up virtualbox-5.0 (5.0.14-105127~Debian~jessie) ...
    addgroup: The group `vboxusers' already exists as a system group. Exiting.
    Stopping VirtualBox kernel modules ...done.
    Uninstalling old VirtualBox DKMS kernel modules ...done.
    Trying to register the VirtualBox kernel modules using DKMSError! Bad return status for module build on kernel: 3.16.0-4-amd64 (x86_64)
    Consult /var/lib/dkms/vboxhost/5.0.14/build/make.log for more information.
     ...failed!
      (Failed, trying without DKMS)
    Recompiling VirtualBox kernel modules ...failed!
      (Look at /var/log/vbox-install.log to find out what went wrong)
    Processing triggers for libc-bin (2.19-18+deb8u2) ...
    

    Then, when I try to run virtualbox, I get:

    WARNING: The vboxdrv kernel module is not loaded. Either there is no module
             available for the current kernel (3.16.0-4-amd64) or it failed to
             load. Please recompile the kernel module and install it by
    
               sudo /sbin/rcvboxdrv setup
    
             You will not be able to start VMs until this problem is fixed.
    

    So, naturally I do sudo /sbin/rcvboxdrv setup, to get:

    Bad argument setup

    So, I do sudo /sbin/rcvboxdrv, and get no output. I then run virtualbox again and get the same error I gave above. Any ideas?

    Update: Using the backports install, I get this error:

    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following package was automatically installed and is no longer required:
      libsdl-ttf2.0-0
    Use 'apt-get autoremove' to remove it.
    The following extra packages will be installed:
      libgsoap5 libvncserver0 virtualbox-dkms virtualbox-qt
    Suggested packages:
      vde2 virtualbox-guest-additions-iso
    The following NEW packages will be installed:
      libgsoap5 libvncserver0 virtualbox virtualbox-dkms virtualbox-qt
    0 upgraded, 5 newly installed, 0 to remove and 82 not upgraded.
    Need to get 22.0 MB of archives.
    After this operation, 97.0 MB of additional disk space will be used.
    Do you want to continue? [Y/n] y
    Get:1 http://ftp.us.debian.org/debian/ jessie/main libgsoap5 amd64 2.8.17-1 [202 kB]
    Get:2 http://ftp.us.debian.org/debian/ jessie/main libvncserver0 amd64 0.9.9+dfsg2-6.1+deb8u1 [191 kB]
    Get:3 http://httpredir.debian.org/debian/ jessie-backports/contrib virtualbox-dkms all 5.0.14-dfsg-1~bpo8+1 [639 kB]
    Get:4 http://httpredir.debian.org/debian/ jessie-backports/contrib virtualbox-qt amd64 5.0.14-dfsg-1~bpo8+1 [7,030 kB]
    Get:5 http://httpredir.debian.org/debian/ jessie-backports/contrib virtualbox amd64 5.0.14-dfsg-1~bpo8+1 [14.0 MB]
    Fetched 22.0 MB in 4s (4,454 kB/s)                                            
    Selecting previously unselected package libgsoap5:amd64.
    (Reading database ... 238416 files and directories currently installed.)
    Preparing to unpack .../libgsoap5_2.8.17-1_amd64.deb ...
    Unpacking libgsoap5:amd64 (2.8.17-1) ...
    Selecting previously unselected package libvncserver0:amd64.
    Preparing to unpack .../libvncserver0_0.9.9+dfsg2-6.1+deb8u1_amd64.deb ...
    Unpacking libvncserver0:amd64 (0.9.9+dfsg2-6.1+deb8u1) ...
    Selecting previously unselected package virtualbox-dkms.
    Preparing to unpack .../virtualbox-dkms_5.0.14-dfsg-1~bpo8+1_all.deb ...
    Unpacking virtualbox-dkms (5.0.14-dfsg-1~bpo8+1) ...
    Selecting previously unselected package virtualbox.
    Preparing to unpack .../virtualbox_5.0.14-dfsg-1~bpo8+1_amd64.deb ...
    Unpacking virtualbox (5.0.14-dfsg-1~bpo8+1) ...
    Selecting previously unselected package virtualbox-qt.
    Preparing to unpack .../virtualbox-qt_5.0.14-dfsg-1~bpo8+1_amd64.deb ...
    Unpacking virtualbox-qt (5.0.14-dfsg-1~bpo8+1) ...
    Processing triggers for systemd (215-17+deb8u3) ...
    Processing triggers for man-db (2.7.0.2-5) ...
    Processing triggers for shared-mime-info (1.3-1) ...
    Processing triggers for hicolor-icon-theme (0.13-1) ...
    Processing triggers for desktop-file-utils (0.22-1) ...
    Processing triggers for gnome-menus (3.13.3-6) ...
    Processing triggers for mime-support (3.58) ...
    Setting up libgsoap5:amd64 (2.8.17-1) ...
    Setting up libvncserver0:amd64 (0.9.9+dfsg2-6.1+deb8u1) ...
    Setting up virtualbox-dkms (5.0.14-dfsg-1~bpo8+1) ...
    Loading new virtualbox-5.0.14 DKMS files...
    First Installation: checking all kernels...
    Building only for 3.16.0-4-amd64
    Building initial module for 3.16.0-4-amd64
    Error! Bad return status for module build on kernel: 3.16.0-4-amd64 (x86_64)
    Consult /var/lib/dkms/virtualbox/5.0.14/build/make.log for more information.
    Setting up virtualbox (5.0.14-dfsg-1~bpo8+1) ...
    [ ok ] Stopping VirtualBox kernel modules.
    [....] Starting VirtualBox kernel modules[....] No suitable module for running k[FAIL found ... failed!
     failed!
    invoke-rc.d: initscript virtualbox, action "restart" failed.
    Setting up virtualbox-qt (5.0.14-dfsg-1~bpo8+1) ...
    Processing triggers for libc-bin (2.19-18+deb8u2) ...
    Processing triggers for systemd (215-17+deb8u3) ...
    
    • Alen Milakovic
      Alen Milakovic about 8 years
      Use the Debian jessie-backports virtualbox package. It's 5.0.14-dfsg-1~bpo8+1. I'm using it with zero problems on my AMD64 Jessie installation. Make sure you get rid of all other related packages and local installations first, of course.
    • Flare Cat
      Flare Cat about 8 years
      @FaheemMitha what is the command to install that? I tried sudo apt-get install <package you gave>, but it said it was unable to locate the package.
    • ThatGuy
      ThatGuy about 8 years
      Add jessie-backports to /etc/apt/sources.list, then install the package using sudo apt-get -t jessie-backports install virtualbox. See backports.debian.org/Instructions for details.
    • Alen Milakovic
      Alen Milakovic about 8 years
      What ThatGuy said. Though I use httpredir. I.e. "deb httpredir.debian.org/debian jessie-backports main contrib non-free".
    • Flare Cat
      Flare Cat about 8 years
      @FaheemMitha after adding backports, the package cannot be found using thatguys command. I did do apt-get update
    • Alen Milakovic
      Alen Milakovic about 8 years
      Output of apt-cache policy virtualbox, please. Add it to the question, don't post as a comment. And paste error messages from apt-get install as well, please.
  • Flare Cat
    Flare Cat about 8 years
    With the httpredir, it installed, but I still got an error during install. I'll post it to q now.
  • Flare Cat
    Flare Cat about 8 years
    OK, I posted the new apt-get error (the one with backports)
  • Alen Milakovic
    Alen Milakovic about 8 years
    Post /var/lib/dkms/virtualbox/5.0.14/build/make.log and /var/log/vbox-install.log, please. If that is too long, you could use gist. Do gist-paste /var/lib/dkms/virtualbox/5.0.14/build/make.log, and then post the link. And the same for install.log. Also post the output of apt-cache policy and dpkg -C. Also, first give the command you are using before pasting the output, to avoid confusion. Regardless whether you are doing an apt-get install... or anything else. You write "Update: Using the backports install, I get this error:" Just give the command instead.
  • user3814606
    user3814606 almost 8 years
    When I tried this it installed the backports version of the linux-headers (4.6.0), but kept the base version of the linux-image (3.16), which doesn't seem right.