安裝軟體
sudo apt install virtualbox
sudo apt install virtualbox-dkms
啟動軟體建立虛拟機
發現報錯
The VirtualBox Linux kernel driver is either not loaded or not set up correctly. Please reinstall virtualbox-dkms package and load the kernel module by executing
'modprobe vboxdrv'
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.
按照提示重裝dkms
sudo apt --reinstall install virtualbox-dkms
執行後終端顯示如下
确定後,進入輸入密碼界面,輸入secure boot 密碼(忘記的話把常用密碼都試一下)
然後提示DKMS: install completed.
再次嘗試重新開機虛拟機,還是報相同的錯誤
執行提示的指令
sudo modprobe vboxdrv
提示
modprobe: ERROR: could not insert 'vboxdrv': Operation not permitted
重新開機系統
reboot
然後會進入一個從沒見過的界面,一次按下面選擇的确認,倒數第二步輸入secure boot 密碼,最後重新開機
之後遇到另一個問題
建立linux虛拟機,發現隻能選擇32位系統,這是由于沒有開啟CPU虛拟化技術,需要進入bois開啟,具體步驟不再贅述。
最後終于可以正常建立虛拟機。
參考:https://blog.csdn.net/liangjiu2009/article/details/72056947https://blog.csdn.net/yongf2014/article/details/49282333