Virtualbox not working in Debian 9
by dedec0 from LinuxQuestions.org on (#4TARX)
I am on a Debian 9, and i just installed https://download.virtualbox.org/virt...etch_amd64.deb (found now in https://www.virtualbox.org/wiki/Linux_Downloads).
I installed that file with dpkg, no problem. But i found it strange that no system menu entry appeared. Anyway, i do not mind calling it from the command line or with a manual call. I decided to start playing with VMs - literally only to test VB a bit.
I called it from the command line, but i got this:
Code:> $ virtualbox &
> [2] 23060
> $ WARNING: The vboxdrv kernel module is not loaded. Either there is no
> module
> available for the current kernel (4.9.0-3-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.So, i did that command with root, but still no use:
Code:> # /sbin/vboxconfig
> Created symlink
> /etc/systemd/system/multi-user.target.wants/vboxdrv.service a'
> /lib/systemd/system/vboxdrv.service.
> Created symlink
> /etc/systemd/system/multi-user.target.wants/vboxballoonctrl-service.service
> a' /lib/systemd/system/vboxballoonctrl-service.service.
> Created symlink
> /etc/systemd/system/multi-user.target.wants/vboxautostart-service.service
> a' /lib/systemd/system/vboxautostart-service.service.
> Created symlink
> /etc/systemd/system/multi-user.target.wants/vboxweb-service.service a'
> /lib/systemd/system/vboxweb-service.service.
> 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.9.0-3-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.9.0-3-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.I do not know what to do now. Can you help me?


I installed that file with dpkg, no problem. But i found it strange that no system menu entry appeared. Anyway, i do not mind calling it from the command line or with a manual call. I decided to start playing with VMs - literally only to test VB a bit.
I called it from the command line, but i got this:
Code:> $ virtualbox &
> [2] 23060
> $ WARNING: The vboxdrv kernel module is not loaded. Either there is no
> module
> available for the current kernel (4.9.0-3-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.So, i did that command with root, but still no use:
Code:> # /sbin/vboxconfig
> Created symlink
> /etc/systemd/system/multi-user.target.wants/vboxdrv.service a'
> /lib/systemd/system/vboxdrv.service.
> Created symlink
> /etc/systemd/system/multi-user.target.wants/vboxballoonctrl-service.service
> a' /lib/systemd/system/vboxballoonctrl-service.service.
> Created symlink
> /etc/systemd/system/multi-user.target.wants/vboxautostart-service.service
> a' /lib/systemd/system/vboxautostart-service.service.
> Created symlink
> /etc/systemd/system/multi-user.target.wants/vboxweb-service.service a'
> /lib/systemd/system/vboxweb-service.service.
> 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.9.0-3-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.9.0-3-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.I do not know what to do now. Can you help me?