Installing, Debian Buster as Host

Discussions related to using VirtualBox on Linux hosts.
Post Reply
timothylegg
Posts: 16
Joined: 20. Dec 2017, 09:53
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: WinXP, Ubuntu, FreeDOS, Android
Location: Guin, AL, USA or Nürnberg, Germany
Contact:

Installing, Debian Buster as Host

Post by timothylegg »

Hello,

I've used VirtualBox for years on my Lenovo ThinkPad for several years with Ubuntu 16.04. I have not entered my BIOS for years, so I haven't dis/en-abled any features by installing Debian.

I installed a new hard disk and selected Debian Buster AMD64 as my new OS. It seems the installation documentation is out of date and those exact steps do not present the user with an operable VirtualBox installation.

From webpage:

https://www.virtualbox.org/wiki/Linux_Downloads

I downloaded:
virtualbox-6.1_6.1.10-138449~Debian~buster_amd64.deb
as specified for my operating system and proceeded through the installation process, but this DEB file is not fully compatible with Debian Buster and provides an error text:
WARNING: The vboxdrv kernel module is not loaded. Either there is no module
         available for the current kernel (4.19.0-9-amd64) 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 installation page says nothing of compiling kernel modules. So I proceed run the command:
sudo /sbin/vboxconfig
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
    linux-headers-amd64 linux-headers-4.19.0-9-amd64
This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
    linux-headers-amd64 linux-headers-4.19.0-9-amd64

There were problems setting up VirtualBox.  To re-start the set-up process, run
  /sbin/vboxconfig
as root.  If your system is using EFI Secure Boot you may need to sign the
kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load
them. Please see your Linux system's documentation for more information.
This isn't helpful at all. So the DEB file was not actually correctly built for Debian 10. It's time to use an alternative method for installing VirtualBox

So I proceeded to the subsection on the webpage titled "Debian-based Linux distributions" and followed those steps.

I added to
/etc/apt/sources.list
the following line:
deb https://download.virtualbox.org/virtualbox/debian buster contrib
Debian would not update without the key, which was quite annoying.

There isn't a key for Debian 10, just Debian 8 or Ubuntu 16.04 which are older distributions. I tried the Debian 8 key on hopes that it would work and amazingly, it actually worked.

I issued the command:
sudo apt-get install virtualbox-6.1
and got
Reading package lists... Done
Building dependency tree       
Reading state information... Done
virtualbox-6.1 is already the newest version (6.1.10-138449~Debian~buster).
0 upgraded, 0 newly installed, 0 to remove and 12 not upgraded.
So apparently nothing changed. I still have a broken VirtualBox with "The vboxdrv kernel module is not loaded".

When can we be expected to find this module loaded into a future version such that Debian 10 is fully supported?
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Installing, Debian Buster as Host

Post by scottgus1 »

Not being a Linux guy, I am not certain, but doesn't this indicate the problem:
This system is currently not set up to build kernel modules.
I vaguely remember reading once that said you have to apt-get or sudo something to fix this problem first.
fth0
Volunteer
Posts: 5677
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Installing, Debian Buster as Host

Post by fth0 »

/sbin/vboxconfig wrote: This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
linux-headers-amd64 linux-headers-4.19.0-9-amd64

There were problems setting up VirtualBox. To re-start the set-up process, run
/sbin/vboxconfig
as root. If your system is using EFI Secure Boot you may need to sign the
kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load
them. Please see your Linux system's documentation for more information.
timothylegg wrote: This isn't helpful at all.
This is as much help as VirtualBox can give you. How to do what you are being told in those messages is Linux distribution specific, and part of what (wannabe) Linux admins are usually expected to know or learn from the Linux resources on the Internet. The command that you need first probably is

Code: Select all

sudo apt install linux-headers-amd64 linux-headers-4.19.0-9-amd64
timothylegg
Posts: 16
Joined: 20. Dec 2017, 09:53
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: WinXP, Ubuntu, FreeDOS, Android
Location: Guin, AL, USA or Nürnberg, Germany
Contact:

Re: Installing, Debian Buster as Host

Post by timothylegg »

fth0 wrote:
/sbin/vboxconfig wrote:
This is as much help as VirtualBox can give you. How to do what you are being told in those messages is Linux distribution specific, and part of what (wannabe) Linux admins are usually expected to know or learn from the Linux resources on the Internet. The command that you need first probably is

Code: Select all

sudo apt install linux-headers-amd64 linux-headers-4.19.0-9-amd64
All I did is strictly test the installation instructions. This machine had no additional software installed at the time of the test and was a 'stock' AMD64 Debian Buster installation. The documentation should never assume expertise from the user, but instead be complete enough to fulfill a minimum level of installation. Maybe for some the existence of an executable binary is enough, but I do envision something better than that. Aside from modernizing the text to reflect modern operating systems that people install today, which is not likely to still be Debian 8 nor Ubuntu 16.04, this apt command must be included early in the installation steps.
fth0
Volunteer
Posts: 5677
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Installing, Debian Buster as Host

Post by fth0 »

timothylegg wrote:All I did is strictly test the installation instructions.
FWIW, more detailed (but not perfect either) installation instructions can be found in the VirtualBox User Manual (2.3. Installing on Linux Hosts). They are mostly written Linux distribution agnostic, and tell you that you (may) need to install the kernel header files. And this boundary exists for a reason: There are more than a hundred different Linux distributions out there, with more than 10 different graphical and textual package management softwares, and some of them even evolve over time. As a software vendor, would you document that in more detail and keep it current? In consequence, the documentation assumes no VirtualBox specific expertise, but Linux specific expertise from the user. I can understand your position, though.

Regarding differences between Debian 8|9|10 or Ubuntu 16.04|18.04|20.04, the apt command would probably be the same, with the exception of the kernel versions of course.

PS: Most volunteers and moderators in the VirtualBox forums are not affiliated to Oracle at all. What I write here is my personal opinion.
Post Reply