解决VirtualBox需要安装内核的DKMS的问题
解决VirtualBox需要安装内核的DKMS的问题
参考:https://wiki.archlinux.org/title/Dynamic_Kernel_Module_Support
######################
## VirtualBox 提示信息
Kernel driver not installed (rc=-1908)
The VirtualBox Linux kernel driver is either not loaded or not set up correctly. Please try setting it up again by executing
'/sbin/vboxconfig'
as root.
If your system has EFI Secure Boot enabled you may also 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.
where: suplibOsInit what: 3 VERR_VM_DRIVER_NOT_INSTALLED (-1908) - The support driver is not installed. On linux, open returned ENOENT.
######################
## 查看安装了多少内核
[jian@dell ~]$ ls /lib/modules
5.15.13-stable 5.15.14-stable 5.16.1-arch1-1
## 安装所有内核,并检查内核是否安装了DKMS。
sudo dkms autoinstall
(如果5.15.13-stable与5.15.14-stable内核可能会提示出错,因为是自编译内核。5.16.1-arch1-1内核是ArchLinux系统linux包的内核只要安装了linux头文件包就可以安装DKMS了。)
## 安装ArchLinux中默认linux内核包的DKMS。
# 安装linux包对应的头文件包
sudo pacman -S linux-headers
# ("-k 5.16.1-arch1-1"指定linux包提供的内核名称)
sudo dkms autoinstall -k 5.16.1-arch1-1
## 对于自编译内核,用以下命令安装内核的DKMS。
## “--kernelsourcedir=”参数是指定内核源文件
sudo dkms autoinstall -k 5.15.14-stable --kernelsourcedir=/data/jian/Kernels/5.15.14/linux-5.15.14.current/
sudo dkms autoinstall -k 5.15.13-stable --kernelsourcedir=/data/jian/Kernels/5.15.13/linux-5.15.13.current/
## 安装了DKMS之后记得要重启系统,这样VirtualBox才会跑起来。