Fedora38安装VirtualBox

Fedora38安装VirtualBox

2023.07.08

背景

我的电脑使用的Fedora38系统,但由于某些原因,需要使用其它操作系统,通过虚拟机安装其它系统是一个最好的选择,在linux系统中,VirtualBox是比较知名的虚拟机软件,但VirtualBox对Fedora系统的支持目前只支持到Fedora36,而现在Fedora早已经发布了Fedora38版本,我的电脑使用的即是Fedora38系统,于是开始了一番折腾。

环境

操作系统: Fedora Linux 38 (Workstation Edition)

CPU:11th Gen Intel® Core™ i5-11300H × 8

下载软件

VirtualBox: VirtualBox 7.0.8

由于VirtualBox不再支持更高版本的Fedora系统,导入一些RMP源我又觉得麻烦,而VirtualBox官网又提供了"All distributions(build on EL6 and therefore not requiring recent system libraries)"版本,于是决定安装此版本。在官网上找到下载界面,选中"All distributions”,鼠标右键,选择“链接另存为”按钮,如下图所示:
在这里插入图片描述

点击按钮后,弹出保存界面,如下图所示:
在这里插入图片描述

将名字改为sh后缀。不改应该也可以,因为我的电脑上保存的时候,默认的后缀是txt,看着不太习惯,毕竟是一个可执行程序,于是修改为了sh后缀。

安装

下载下来后,加上可执行权限,以root用户执行下载的软件,直接安装即可,命令如下:

[root@fedora 下载]# chmod +x VirtualBox-7.0.8-156879-Linux_amd64.sh 
[root@fedora 下载]# ./VirtualBox-7.0.8-156879-Linux_amd64.sh 
Verifying archive integrity...  100%   MD5 checksums are OK. All good.
Uncompressing VirtualBox for Linux installation  100%  
VirtualBox Version 7.0.8 r156879 (2023-04-17T17:29:53Z) installer
Removing previous installation of VirtualBox 7.0.6 r155176 from /opt/VirtualBox
Installing VirtualBox to /opt/VirtualBox
  warnings.warn(
/usr/lib/python3.11/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
zip_safe flag not set; analyzing archive contents...
vboxdrv.sh: failed: modprobe vboxdrv failed. Please use 'dmesg' to find out why.

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.

VirtualBox has been installed successfully.

可以看到,安装到了/opt/VirualBox目录,安装之前还会卸载之前安装的版本(因为我之前安装了7.0.6版本)。但是也可以看到执行modprobe vboxdrv failed,后面也给出了提示:If your system is using EFI secure Boot you may need to sign the kernel modules(vboxdrv,vboxnetflt,vboxnetadp,vboxpci)。刚好我的电脑是EFI Secure Boot,所以会有此提示。解决方案有两个:关闭secure boot或者使用自签名证书为自己想要加载的内核模块签名。由于自己没接触过给内核模块签名,所以想挑战一把。

此时,电脑菜单中已经可以看到VirtualBox的图标了,也可以打开,但无法正常运行虚拟机,还需要解决上面提示的错误才可以。

使用自签证书对内核模块进行签名

但很遗憾的是,当时折腾的时候,没想到要记录,所以没有详细记录下具体的步骤,也没有拍照。但在写这篇文章的时候,从网上搜了一些资料,和当时自己折腾的内容很相似,所以有些内容就直接盗用网上的资料了。在Fedora中全自动签名英伟达驱动内核模块以支持安全启动(Secure Boot)_mokutil_KylinDemo

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值