Ubuntu 20.04安装 virtualbox6.1.26 安装问题Kernel driver not installed (rc=-1908) 处理

1、官网下载安装包 在安装包下载目录执行如下指令

sudo dpkg -i virtualbox-6.1_6.1.26.deb 

安装出现依赖错误

正在选中未选择的软件包 virtualbox-6.1。
(正在读取数据库 ... 系统当前共安装有 151585 个文件和目录。)
准备解压 virtualbox-6.1_6.1.26.deb  ...
正在解压 virtualbox-6.1 (6.1.26-145957~Ubuntu~eoan) ...
dpkg: 依赖关系问题使得 virtualbox-6.1 的配置工作不能继续:
 virtualbox-6.1 依赖于 libqt5opengl5 (>= 5.0.2);然而:
  未安装软件包 libqt5opengl5。
 virtualbox-6.1 依赖于 libqt5printsupport5 (>= 5.0.2);然而:
  未安装软件包 libqt5printsupport5。
 virtualbox-6.1 依赖于 libsdl1.2debian (>= 1.2.11);然而:
  未安装软件包 libsdl1.2debian。
 virtualbox-6.1 依赖于 python (<< 2.8);然而:
  未安装软件包 python。
 virtualbox-6.1 依赖于 python (>= 2.7);然而:
  未安装软件包 python。
 virtualbox-6.1 依赖于 python:any (>= 2.6.6-7~);然而:
dpkg: 处理软件包 virtualbox-6.1 (--install)时出错:
 依赖关系问题 - 仍未被配置
正在处理用于 systemd (245.4-4ubuntu3.11) 的触发器 ...
正在处理用于 gnome-menus (3.36.0-1ubuntu1) 的触发器 ...
正在处理用于 desktop-file-utils (0.24-1ubuntu3) 的触发器 ...
正在处理用于 bamfdaemon (0.5.3+18.04.20180207.2-0ubuntu2) 的触发器 ...
Rebuilding /usr/share/applications/bamf-2.index...
正在处理用于 mime-support (3.64ubuntu1) 的触发器 ...
正在处理用于 hicolor-icon-theme (0.17-2) 的触发器 ...
正在处理用于 shared-mime-info (1.15-1) 的触发器 ...
在处理时有错误发生:
 virtualbox-6.1

执行下发指令进行安装修复

sudo apt install -f

安装成功后配置虚拟机成功
启动虚拟机时 报如图错误


错误提示

Kernel driver not installed (rc=-1908)

根据错误提示 需要执行如下指令

sudo /sbin/vboxconfig

执行对应指令,再次报错
错误原因:大致意思内核需要 build

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-generic linux-headers-5.11.0-25-generic
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-generic linux-headers-5.11.0-25-generic
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.

根据提示内容 注意 第8 行,每个人的电脑提示的 内核版本应该是不一样的,按照自己的提示
执行如下指令

sudo apt install linux-headers-generic linux-headers-5.11.0-25-generic

安装成功 ,再次执行

sudo /sbin/vboxconfig

执行结果如下:

test@test:~/download$ sudo /sbin/vboxconfig 
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.

问题解决,虚拟机可以正常启用

你可能感兴趣的:(Ubuntu 20.04安装 virtualbox6.1.26 安装问题Kernel driver not installed (rc=-1908) 处理)