fedora 24 64bit 安装 virtualbox 5.1

output

virtualbox

input

https://www.if-not-true-then-false.com/2010/install-virtualbox-with-yum-on-fedora-centos-red-hat-rhel/
http://askubuntu.com/questions/762136/cannot-reinstall-virtualbox-on-ubuntu-16-04

algo

  1. 切换root用户
    su

  2. 安装VB依赖
    dnf install binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel dkms
    PS:这里可能安装不完整,例如kernel-devel是最新的而不是匹配的,但是后面有解决方案。

  3. 安装VB
    wget http://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo -P /etc/yum.repos.d/
    dnf install VirtualBox-5.1

  4. 添加用户到用户组
    usermod -a -G vboxusers user_name

sum

  • 一般出问题是在第三步,我的问题是kernel-devel版本不对,解决如下:
    dnf install kernel-devel-4.5.5-300.fc24.x86_64 (我的内核版本是这个,但是第三步安装到了4.8版本)
    /sbin/vboxconfig (重建VB模块)
  • 如果提示“modprobe vboxdrv failed. Please use ‘dmesg’ to find out why”错误,我的问题是需要去BIOS关闭secure boot启动,参考#input的链接2
  • 有的教程需要你dnf update所有软件,没必要,这样很浪费时间资源,例如#input的链接1就是
[dragon@localhost ~]$ rpm -qa | grep qt5-qtbase # 查看当前版本 qt5-qtbase-postgresql-5.11.1-23.ky10.x86_64 qt5-qtbase-mysql-5.11.1-23.ky10.x86_64 qt5-qtbase-common-5.11.1-23.ky10.noarch qt5-qtbase-gui-5.11.1-23.ky10.x86_64 qt5-qtbase-5.11.1-23.ky10.x86_64 [dragon@localhost ~]$ strings /usr/lib64/libQt5Core.so.5 | grep "Qt_5\." # 检查符号版本 Qt_5.11.1_PRIVATE_API Qt_5.0 Qt_5.1 Qt_5.2 Qt_5.3 Qt_5.4 Qt_5.5 Qt_5.6 Qt_5.7 Qt_5.8 Qt_5.9 Qt_5.10 Qt_5.11 [dragon@localhost ~]$ sudo yum install -y https://download-ib01.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/q/qt5-qtbase-5.15.3-1.el8.x86_64.rpm Last metadata expiration check: 0:18:08 ago on 202511月03日 星期一 19时03分31. [MIRROR] qt5-qtbase-5.15.3-1.el8.x86_64.rpm: Status code: 404 for https://download-ib01.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/q/qt5-qtbase-5.15.3-1.el8.x86_64.rpm (IP: 198.18.2.16) [MIRROR] qt5-qtbase-5.15.3-1.el8.x86_64.rpm: Status code: 404 for https://download-ib01.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/q/qt5-qtbase-5.15.3-1.el8.x86_64.rpm (IP: 198.18.2.16) [MIRROR] qt5-qtbase-5.15.3-1.el8.x86_64.rpm: Status code: 404 for https://download-ib01.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/q/qt5-qtbase-5.15.3-1.el8.x86_64.rpm (IP: 198.18.2.16) [MIRROR] qt5-qtbase-5.15.3-1.el8.x86_64.rpm: Status code: 404 for https://download-ib01.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/q/qt5-qtbase-5.15.3-1.el8.x86_64.rpm (IP: 198.18.2.16) [FAILED] qt5-qtbase-5.15.3-1.el8.x86_64.rpm: Status code: 404 for https://download-ib01.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/q/qt5-qtbase-5.15.3-1.el8.x86_64.rpm (IP: 198.18.2.16) Status code: 404 for https://download-ib01.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/q/qt5-qtbase-5.15.3-1.el8.x86_64.rpm (IP: 198.18.2.16) [dragon@localhost ~]$ sudo ldconfig [dragon@localhost ~]$ echo 'export PATH=$PATH:/usr/lib/virtualbox' | sudo tee -a /etc/profile export PATH=$PATH:/usr/lib/virtualbox [dragon@localhost ~]$ source /etc/profile [dragon@localhost ~]$ sudo /sbin/vboxconfig # 查看详细错误 vboxdrv.sh: Stopping VirtualBox services. vboxdrv.sh: Starting VirtualBox services. vboxdrv.sh: Building VirtualBox kernel modules. vboxdrv.sh: failed: Look at /var/log/vbox-setup.log to find out what went wrong. 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. [dragon@localhost ~]$ dmesg | grep vboxdrv # 检查内核日志 dmesg: 读取内核缓冲区失败: 不允许的操作 [dragon@localhost ~]$ sudo yum install -y kernel-devel-$(uname -r) gcc make Last metadata expiration check: 0:19:01 ago on 202511月03日 星期一 19时03分31. Package kernel-devel-4.19.90-23.59.v2101.ky10.x86_64 is already installed. Package gcc-7.3.0-20190804.h30.p05.ky10.x86_64 is already installed. Package make-1:4.2.1-15.ky10.x86_64 is already installed. Dependencies resolved. Nothing to do. Complete! [dragon@localhost ~]$ # 生成密钥 sudo mokutil --import MOK.der # 导入密钥(需设置密码) [dragon@localhost ~]$ sudo openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -days 36500 -subj "/CN=VirtualBox/" Generating a RSA private key ..............................+++++ ..........+++++ writing new private key to 'MOK.priv' ----- [dragon@localhost ~]$ sudo mokutil --import MOK.der # 导入密钥(需设置密码)input password: input password again: [dragon@localhost ~]$ sudo rpm -ivh VirtualBox-6.1-6.1.46_158378_el8-1.x86_64.rpm 警告:VirtualBox-6.1-6.1.46_158378_el8-1.x86_64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID 2980aecf: NOKEY 错误:依赖检测失败: libQt5Core.so.5(Qt_5.12)(64bit) 被 VirtualBox-6.1-6.1.46_158378_el8-1.x86_64 需要 libSDL-1.2.so.0()(64bit) 被 VirtualBox-6.1-6.1.46_158378_el8-1.x86_64 需要 libvpx.so.5()(64bit) 被 VirtualBox-6.1-6.1.46_158378_el8-1.x86_64 需要 [dragon@localhost ~]$ sudo VBoxManage extpack install Oracle_VM*.vbox-extpack --accept-license=56be48f923303c8cbabbgbbg WARNING: The vboxdrv kernel module is not loaded. Either there is no module available for the current kernel (4.19.90-23.59.v2101.ky10.x86_64) or it failed to load. Please recompile the kernel module and install it by sudo /sbin/vboxconfig You will not be able to start VMs until this problem is fixed. VBoxManage: error: Failed to create the VirtualBox object! VBoxManage: error: Code NS_ERROR_FACTORY_NOT_REGISTERED (0x80040154) - Class not registered (extended info not available) VBoxManage: error: Most likely, the VirtualBox COM server is not running or failed to start. [dragon@localhost ~]$ sudo rpm -ivh VirtualBox-6.1-6.1.46_158378_el8-1.x86_64.rpm --nodeps 警告:VirtualBox-6.1-6.1.46_158378_el8-1.x86_64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID 2980aecf: NOKEY Verifying... ################################# [100%] 准备中... ################################# [100%] 软件包 VirtualBox-6.1-6.1.46_158378_el8-1.x86_64 已经安装 [dragon@localhost ~]$ sudo VBoxManage extpack install Oracle_VM*.vbox-extpack --accept-license=56be48f923303c8cbabbgbbg WARNING: The vboxdrv kernel module is not loaded. Either there is no module available for the current kernel (4.19.90-23.59.v2101.ky10.x86_64) or it failed to load. Please recompile the kernel module and install it by sudo /sbin/vboxconfig You will not be able to start VMs until this problem is fixed. VBoxManage: error: Failed to create the VirtualBox object! VBoxManage: error: Code NS_ERROR_FACTORY_NOT_REGISTERED (0x80040154) - Class not registered (extended info not available) VBoxManage: error: Most likely, the VirtualBox COM server is not running or failed to start. [dragon@localhost ~]$ VBoxManage list extpacks | grep "Extension Packs" VBoxManage: error: Failed to create the VirtualBox object! VBoxManage: error: Code NS_ERROR_FACTORY_NOT_REGISTERED (0x80040154) - Class not registered (extended info not available) VBoxManage: error: Most likely, the VirtualBox COM server is not running or failed to start.
最新发布
11-04
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值