解決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才會跑起來。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM